From e7bb1e85fbfa7b691ed4248cc0359a87cb2fb71e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Apr 2014 18:01:14 -0400 Subject: 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. --- Assistant/Types/CredPairCache.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Assistant/Types/CredPairCache.hs (limited to 'Assistant/Types') 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 + - + - 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 -- cgit v1.2.3