packages feed

passman-core 0.1.0.0 → 0.2.0.0

raw patch · 8 files changed

+51/−26 lines, 8 filesdep ~aesondep ~asyncdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: aeson, async, base, containers, csv-conduit, int-cast, template-haskell, temporary, yaml

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,3 +1,8 @@+## 0.2.0.0++* Export version number in Passman.Core.Version+* Make `passlistPath` non-optional in Config+ ## 0.1.0.0  * Initial release
passman-core.cabal view
@@ -1,5 +1,5 @@ name:                passman-core-version:             0.1.0.0+version:             0.2.0.0 synopsis:            Deterministic password generator core description:     Generates unique passwords deterministically from a single master password.@@ -30,6 +30,9 @@                        Passman.Core.Info                        Passman.Core.Entry                        Passman.Core.Entry.Lens+                       Passman.Core.Version+  other-modules:       Paths_passman_core+  autogen-modules:     Paths_passman_core   ghc-options:         -Wall   build-depends:       passman-core-internal                      , base            >= 4.9     && < 4.11
src/Passman/Core/Config.hs view
@@ -38,7 +38,7 @@  import Data.Text     (Text) import Data.Yaml     (encodeFile, decodeFileEither)-import Data.Aeson.TH (deriveJSON, defaultOptions, omitNothingFields)+import Data.Aeson.TH (deriveJSON, defaultOptions)  import System.FilePath          ((</>)) import System.Directory         (XdgDirectory(XdgConfig), getXdgDirectory, createDirectoryIfMissing)@@ -50,33 +50,22 @@ -- Intended to be saved to file in YAML format. This example config file: -- -- >masterPasswordHash: "$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy"------ Would be parsed as:------ >Config { masterPasswordHash = "$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy"--- >       , passlistPath = Nothing--- >       }------ Optionally, the `passlistPath` field can be present as well. This example--- config file:------ >masterPasswordHash: "$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy" -- >passlistPath: "/path/to/passlist.txt" -- -- Would be parsed as: -- -- >Config { masterPasswordHash = "$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy"--- >       , passlistPath = Just "/path/to/passlist.txt"+-- >       , passlistPath = "/path/to/passlist.txt" -- >       } data Config = Config {                        -- | Hash of the master password generated by                        -- `Passman.Core.Hash.hashMasterPassword`                        masterPasswordHash :: Text-                       -- | The path to the last used passlist file-                     , passlistPath       :: Maybe FilePath+                       -- | Path to the passlist file+                     , passlistPath       :: FilePath                      } deriving (Show, Eq) -$(deriveJSON defaultOptions {omitNothingFields = True} ''Config)+$(deriveJSON defaultOptions ''Config)  -- | Load a `Config` from file. loadConfig :: IO Config
src/Passman/Core/Config/Lens.hs view
@@ -43,7 +43,7 @@                                 -> C.Config -> f C.Config masterPasswordHash f (C.Config a b) = flip C.Config b <$> f a --- | The path to the last used passlist file-passlistPath :: Functor f => (Maybe FilePath -> f (Maybe FilePath))+-- | Path to the passlist file+passlistPath :: Functor f => (FilePath -> f FilePath)                           -> C.Config -> f C.Config passlistPath f (C.Config a b) = C.Config a <$> f b
src/Passman/Core/Entry.hs view
@@ -17,7 +17,7 @@  ----------------------------------------------------------------------------- -- |--- Module      : Passman.Core.PassList+-- Module      : Passman.Core.Entry -- Copyright   : Matthew Harm Bekkema 2017 -- License     : GPL-3 -- Maintainer  : mbekkema97@gmail.com
src/Passman/Core/Entry/Lens.hs view
@@ -17,7 +17,7 @@  ----------------------------------------------------------------------------- -- |--- Module      : Passman.Core.PassList.Lens+-- Module      : Passman.Core.Entry.Lens -- Copyright   : Matthew Harm Bekkema 2017 -- License     : GPL-3 -- Maintainer  : mbekkema97@gmail.com
+ src/Passman/Core/Version.hs view
@@ -0,0 +1,30 @@+-- Copyright (C) 2017  Matthew Harm Bekkema+--+-- This file is part of passman-core+--+-- passman-core is free software: you can redistribute it and/or modify+-- it under the terms of the GNU General Public License as published by+-- the Free Software Foundation, either version 3 of the License, or+-- (at your option) any later version.+--+-- passman-core is distributed in the hope that it will be useful,+-- but WITHOUT ANY WARRANTY; without even the implied warranty of+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+-- GNU General Public License for more details.+--+-- You should have received a copy of the GNU General Public License+-- along with this program.  If not, see <https://www.gnu.org/licenses/>.++-----------------------------------------------------------------------------+-- |+-- Module      : Passman.Core.Version+-- Copyright   : Matthew Harm Bekkema 2017+-- License     : GPL-3+-- Maintainer  : mbekkema97@gmail.com+-----------------------------------------------------------------------------++module Passman.Core.Version+    ( version+    ) where++import Paths_passman_core (version)
test/precomputed.hs view
@@ -51,12 +51,10 @@ configExamples = zip' wanted got   where     got = map (fromJust . decode . encodeUtf8 . T.unlines)-              [ ["masterPasswordHash: \"$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy\""]-              , ["masterPasswordHash: \"$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy\""-              ,"passlistPath: \"/path/to/passlist.txt\""]+              [ ["masterPasswordHash: \"$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy\""+                ,"passlistPath: \"/path/to/passlist.txt\""]               ]-    wanted = [ Config "$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy" Nothing-             , Config "$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy" (Just "/path/to/passlist.txt")+    wanted = [ Config "$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy" "/path/to/passlist.txt"              ]  -- | Ensure the examples in "Passman.Core.Entry" are correct.