keystore 0.1.0.0 → 0.1.1.0
raw patch · 8 files changed
+35/−20 lines, 8 files
Files
- examples/psd/psd.hs +1/−1
- keystore.cabal +1/−1
- src/Data/KeyStore.hs +4/−2
- src/Data/KeyStore/CLI.hs +3/−2
- src/Data/KeyStore/Command.hs +13/−4
- src/Data/KeyStore/IO.hs +7/−4
- src/Data/KeyStore/KeyStore.hs +0/−1
- src/Data/KeyStore/Types.hs +6/−5
examples/psd/psd.hs view
@@ -11,7 +11,7 @@ ic :: IC-ic = instanceCtx_ $ CtxParams (Just ex_ks) True+ic = instanceCtx_ $ CtxParams (Just ex_ks) True True ex_dir :: FilePath ex_dir = "examples/psd"
keystore.cabal view
@@ -1,5 +1,5 @@ Name: keystore-Version: 0.1.0.0+Version: 0.1.1.0 Synopsis: Managing stores of secret things Homepage: http://github.com/cdornan/keystore Author: Chris Dornan
src/Data/KeyStore.hs view
@@ -10,7 +10,7 @@ module Data.KeyStore ( readSettings , CtxParams(..)- , IC+ , IC(..) , module Data.KeyStore.Types , defaultSettingsFilePath , settingsFilePath@@ -76,6 +76,7 @@ import Control.Applicative import qualified Control.Exception as X import Control.Lens+import Control.Monad import System.IO import System.Locale @@ -378,7 +379,8 @@ put :: IC -> Ctx -> State -> IO () put IC{..} ctx st = do maybe (return ()) (flip writeIORef (ctx,st)) ic_cache- LBS.writeFile (ctx_store ctx) $ KS.keyStoreBytes $ st_keystore st+ when (not $ cp_readonly ic_ctx_params) $+ LBS.writeFile (ctx_store ctx) $ KS.keyStoreBytes $ st_keystore st report :: String -> IO () report = hPutStrLn stderr
src/Data/KeyStore/CLI.hs view
@@ -52,8 +52,9 @@ where pr p = p >>= B.putStrLn cp = CtxParams- { cp_store = cmd_store- , cp_debug = cmd_debug+ { cp_store = cmd_store+ , cp_debug = cmd_debug+ , cp_readonly = cmd_readonly } create :: IC
src/Data/KeyStore/Command.hs view
@@ -16,9 +16,10 @@ data Command = Command- { cmd_store :: Maybe FilePath- , cmd_debug :: Bool- , cmd_sub :: SubCommand+ { cmd_store :: Maybe FilePath+ , cmd_debug :: Bool+ , cmd_readonly :: Bool+ , cmd_sub :: SubCommand } data SubCommand@@ -59,7 +60,7 @@ p_version :: Parser Command p_version =- flag' (Command Nothing False Version)+ flag' (Command Nothing False False Version) $ long "version" <> help "display the version" @@ -69,6 +70,7 @@ Command <$> optional p_store <*> p_debug_flg+ <*> p_readonly_flg <*> p_sub_command p_store :: Parser FilePath@@ -84,6 +86,13 @@ $ long "debug" <> short 'd' <> help "enable debug logging"++p_readonly_flg :: Parser Bool+p_readonly_flg =+ switch+ $ long "readonly"+ <> short 'r'+ <> help "disable updating of keystore" p_sub_command :: Parser SubCommand p_sub_command =
src/Data/KeyStore/IO.hs view
@@ -44,16 +44,19 @@ -- | The parameters used to set up a KeyStore session. data CtxParams = CtxParams- { cp_store :: Maybe FilePath -- ^ location of any explictlt specified keystore file- , cp_debug :: Bool -- ^ whether debug output has been enabled or noe+ { cp_store :: Maybe FilePath -- ^ location of any explictlt specified keystore file+ , cp_debug :: Bool -- ^ whether debug output has been enabled or noe+ , cp_readonly :: Bool -- ^ True => do not update keystore }+ deriving (Show) -- | Suitable default 'CtxParams'. defaultCtxParams :: CtxParams defaultCtxParams = CtxParams- { cp_store = Nothing- , cp_debug = False+ { cp_store = Nothing+ , cp_debug = False+ , cp_readonly = False } -- | The default place for keystore settings (settings).
src/Data/KeyStore/KeyStore.hs view
@@ -41,7 +41,6 @@ import Data.List import Data.Time import Text.Printf-import Crypto.PubKey.RSA import Control.Applicative import Control.Lens import Control.Monad
src/Data/KeyStore/Types.hs view
@@ -16,7 +16,10 @@ {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-} ++ -- | The KeyStore and Associated Types -- -- Note that most of these types and functions were generated by the@@ -28,13 +31,13 @@ , ks_keymap , ks_config , Configuration(..)- , TriggerMap(..)+ , TriggerMap , Trigger(..) , Settings(..) , cfg_settings , cfg_triggers , TextJsonAssoc(..)- , KeyMap(..)+ , KeyMap , NameKeyAssoc(..) , Key(..) , key_name@@ -50,9 +53,8 @@ , key_created_at , Hash(..) , HashDescription(..)- , EncrypedCopyMap(..)+ , EncrypedCopyMap , EncrypedCopy(..)- , Safeguard(..) , EncrypedCopyData(..) , RSASecretData(..) , AESSecretData(..)@@ -67,7 +69,6 @@ , Pattern(..) , Iterations(..) , Octets(..)- , Name(..) , Identity(..) , SettingID(..) , TriggerID(..)