5 Commits
0.3.0 ... 0.3.1

Author SHA1 Message Date
b9d52070f1 version 0.3.1 2021-05-14 13:55:01 -04:00
6585d63385 allow user to specify temporary alternate master password 2021-05-14 13:46:52 -04:00
258ebf29fe max version for transformers package
...because I'm an idiot.
2021-05-09 14:41:20 -04:00
1d6fbb5f40 version 0.3.0.2
more dependency versions
2021-05-09 13:36:27 -04:00
08d2827613 version 0.3.0.1
- updated to latest lts
- specified dependency versions
2021-05-09 12:57:38 -04:00
7 changed files with 161 additions and 30 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,2 @@
.stack-work/ .stack-work/
passman.cabal
*~ *~

View File

@@ -1,5 +1,19 @@
# Changelog for passman # Changelog for passman
## 0.3.1
- set maximum version of transformers package
- allow user to specifiy a temporary master password to retrieve a password
## 0.3.0.2
- more dependency versions
## 0.3.0.1
- updated to latest stackage LTS
- specified versions for dependencies
## 0.3.0 ## 0.3.0
- updated to more recent LTS snapshot - updated to more recent LTS snapshot

View File

@@ -27,7 +27,7 @@ module UI (getMasterPass, mainMenu) where
import Control.Monad (when) import Control.Monad (when)
import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Class (lift)
import qualified Control.Monad.Trans.State as S import qualified Control.Monad.Trans.State as S
import Lens.Micro (over, set, (^.)) import Lens.Micro (over, set, (^.), (.~))
import Lens.Micro.Extras (view) import Lens.Micro.Extras (view)
import System.Console.HCL import System.Console.HCL
( Request ( Request
@@ -161,11 +161,12 @@ selectServ xs = menu "Select Service" $
servMenu :: String -> S.StateT Status IO () servMenu :: String -> S.StateT Status IO ()
servMenu x = menu x servMenu x = menu x
[ ( "show password", showPass x >> servMenu x ) [ ( "show password", showPass x >> servMenu x )
, ( "edit password", editPassMenu x ) , ( "show alternate password", showAltPass x )
, ( "remove service", removeServ x ) , ( "edit password", editPassMenu x )
, ( "rename service", renameServ x ) , ( "remove service", removeServ x )
, ( "back", mainMenu ) , ( "rename service", renameServ x )
, ( "back", mainMenu )
] ]
editPassMenu :: String -> S.StateT Status IO () editPassMenu :: String -> S.StateT Status IO ()
@@ -225,15 +226,24 @@ doEditPolicy x = withService x mainMenu $ \d -> do
editPassMenu x editPassMenu x
showPass :: String -> S.StateT Status IO () showPass :: String -> S.StateT Status IO ()
showPass x = do showPass x = withService x
(lift $ putStrLn "The service could not be found in the database.") $
\d -> do
lift $ putStrLn ""
mp <- S.gets $ view masterPass
lift $ putStrLn $ case pwGenerate mp d of
Nothing -> "The password data were not valid."
Just pw -> "password for " ++ x ++ ": " ++ pw
showAltPass :: String -> S.StateT Status IO ()
showAltPass srv = do
lift $ putStrLn "" lift $ putStrLn ""
withService x old <- S.gets $ view masterPass
(lift $ putStrLn "The service could not be found in the database.") $ Just new <- lift $ runRequest $ required $ prompt "alternate master password: " reqPassword
\d -> do S.modify $ masterPass .~ new
mp <- S.gets $ view masterPass showPass srv
lift $ putStrLn $ case pwGenerate mp d of S.modify $ masterPass .~ old
Nothing -> "The password data were not valid." servMenu srv
Just pw -> "password for " ++ x ++ ": " ++ pw
-- TODO: refactor this monstrosity -- TODO: refactor this monstrosity
editPolicy :: PWPolicy -> Request PWPolicy editPolicy :: PWPolicy -> Request PWPolicy

View File

@@ -1,5 +1,5 @@
name: passman name: passman
version: 0.3.0 version: 0.3.1
github: "jlamothe/passman" github: "jlamothe/passman"
license: LGPL-3 license: LGPL-3
author: "Jonathan Lamothe" author: "Jonathan Lamothe"
@@ -21,12 +21,12 @@ description: Please see the README on GitHub at <https://github.com/jlam
dependencies: dependencies:
- base >= 4.7 && < 5 - base >= 4.7 && < 5
- aeson - aeson >= 1.5.6.0 && < 1.6
- bytestring - bytestring >= 0.10.12.0 && < 0.11
- containers - containers >= 0.6.2.1 && < 0.7
- microlens >= 0.4.11.2 && < 0.5 - microlens >= 0.4.11.2 && < 0.5
- microlens-th >= 0.4.3.6 && < 0.5 - microlens-th >= 0.4.3.6 && < 0.5
- random - random >=1.1 && < 1.2
ghc-options: ghc-options:
- -Wall - -Wall
@@ -34,10 +34,10 @@ ghc-options:
library: library:
source-dirs: src source-dirs: src
dependencies: dependencies:
- base16-bytestring - base16-bytestring >= 0.1.1.7 && < 0.2
- base64-bytestring - base64-bytestring >= 1.1.0.0 && < 1.2
- SHA - SHA >= 1.6.4.4 && < 1.7
- text - text >= 1.2.4.1 && < 1.3
executables: executables:
passman: passman:
@@ -51,7 +51,7 @@ executables:
- passman - passman
- easy-file >= 0.2.2 && < 0.3 - easy-file >= 0.2.2 && < 0.3
- HCL >= 1.8 && < 1.9 - HCL >= 1.8 && < 1.9
- transformers - transformers >= 0.5.6.2 && < 0.6
tests: tests:
passman-test: passman-test:

108
passman.cabal Normal file
View File

@@ -0,0 +1,108 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: e3bd0ca2b360b025666f4503e3115caaaed34c7719487d90ae4d5eb58f9621e9
name: passman
version: 0.3.1
synopsis: a simple password manager
description: Please see the README on GitHub at <https://github.com/jlamothe/passman#readme>
category: Security
homepage: https://github.com/jlamothe/passman#readme
bug-reports: https://github.com/jlamothe/passman/issues
author: Jonathan Lamothe
maintainer: jonathan@jlamothe.net
copyright: (C) 2018-2021 Jonathan Lamothe
license: LGPL-3
license-file: LICENSE
build-type: Simple
extra-source-files:
README.md
ChangeLog.md
source-repository head
type: git
location: https://github.com/jlamothe/passman
library
exposed-modules:
Password
other-modules:
Paths_passman
hs-source-dirs:
src
ghc-options: -Wall
build-depends:
SHA >=1.6.4.4 && <1.7
, aeson >=1.5.6.0 && <1.6
, base >=4.7 && <5
, base16-bytestring >=0.1.1.7 && <0.2
, base64-bytestring >=1.1.0.0 && <1.2
, bytestring >=0.10.12.0 && <0.11
, containers >=0.6.2.1 && <0.7
, microlens >=0.4.11.2 && <0.5
, microlens-th >=0.4.3.6 && <0.5
, random >=1.1 && <1.2
, text >=1.2.4.1 && <1.3
default-language: Haskell2010
executable passman
main-is: Main.hs
other-modules:
Types
UI
Util
Paths_passman
hs-source-dirs:
app
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
build-depends:
HCL >=1.8 && <1.9
, aeson >=1.5.6.0 && <1.6
, base >=4.7 && <5
, bytestring >=0.10.12.0 && <0.11
, containers >=0.6.2.1 && <0.7
, easy-file >=0.2.2 && <0.3
, microlens >=0.4.11.2 && <0.5
, microlens-th >=0.4.3.6 && <0.5
, passman
, random >=1.1 && <1.2
, transformers >=0.5.6.2 && <0.6
default-language: Haskell2010
test-suite passman-test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Spec.JSON
Spec.NewPWData
Spec.NewPWDatabase
Spec.NewPWPolicy
Spec.NewPWSalt
Spec.PWGenerate
Spec.PWGetService
Spec.PWHasService
Spec.PWRemoveService
Spec.PWSearch
Spec.PWSetService
Spec.ValidatePWData
Spec.ValidatePWDatabase
Spec.ValidatePWPolicy
Paths_passman
hs-source-dirs:
test
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
build-depends:
HUnit
, aeson >=1.5.6.0 && <1.6
, base >=4.7 && <5
, bytestring >=0.10.12.0 && <0.11
, containers >=0.6.2.1 && <0.7
, microlens >=0.4.11.2 && <0.5
, microlens-th >=0.4.3.6 && <0.5
, passman
, random >=1.1 && <1.2
default-language: Haskell2010

View File

@@ -17,7 +17,7 @@
# #
# resolver: ./custom-snapshot.yaml # resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml # resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-16.27 resolver: lts-17.10
# User packages to be built. # User packages to be built.
# Various formats can be used as shown in the example below. # Various formats can be used as shown in the example below.

View File

@@ -13,7 +13,7 @@ packages:
hackage: HCL-1.8@sha256:39ec0da0cd6157f20c395e1b0df474df45efb0088afdaab20bb9dfb3662baf7c,1726 hackage: HCL-1.8@sha256:39ec0da0cd6157f20c395e1b0df474df45efb0088afdaab20bb9dfb3662baf7c,1726
snapshots: snapshots:
- completed: - completed:
size: 533252 size: 567241
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/27.yaml url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/17/10.yaml
sha256: c2aaae52beeacf6a5727c1010f50e89d03869abfab6d2c2658ade9da8ed50c73 sha256: 321b3b9f0c7f76994b39e0dabafdc76478274b4ff74cc5e43d410897a335ad3b
original: lts-16.27 original: lts-17.10