diff options
author | Joey Hess <joey@kitenet.net> | 2014-04-29 18:01:14 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-04-29 18:08:02 -0400 |
commit | e7bb1e85fbfa7b691ed4248cc0359a87cb2fb71e (patch) | |
tree | ae6519ac6c37251d6de3e973ee4e160effcb1ee2 /Assistant/Types/CredPairCache.hs | |
parent | bb925fe8111b5e807942d1fdd6dc079e4953e905 (diff) |
add CredPair cache
Note that this does not yet use SecureMem. It would probably make sense for
the Password part of a CredPair to use SecureMem, and making that change
is better than passing in a String and having it converted to SecureMem in
this code.
Diffstat (limited to 'Assistant/Types/CredPairCache.hs')
-rw-r--r-- | Assistant/Types/CredPairCache.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Assistant/Types/CredPairCache.hs b/Assistant/Types/CredPairCache.hs new file mode 100644 index 000000000..a1e11c257 --- /dev/null +++ b/Assistant/Types/CredPairCache.hs @@ -0,0 +1,18 @@ +{- git-annex assistant CredPair cache. + - + - Copyright 2014 Joey Hess <joey@kitenet.net> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Assistant.Types.CredPairCache where + +import Types.Creds + +import Control.Concurrent +import qualified Data.Map as M + +type CredPairCache = MVar (M.Map Login Password) + +newCredPairCache :: IO CredPairCache +newCredPairCache = newMVar M.empty |