diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-11 14:06:50 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-11 14:07:56 -0400 |
commit | 066a06606aeb7f4a3cd70e7b592fef8dc6a9b71e (patch) | |
tree | 98458711a7dab3e3c669b513ed7b84cc2502374b /Remote/External.hs | |
parent | f779747a0d4d5c9e39a3c82498fe1809d56b4d25 (diff) |
plumb creds from webapp to initremote
Avoids abusing setting environment variables, which was always a hack
and won't work on windows.
Diffstat (limited to 'Remote/External.hs')
-rw-r--r-- | Remote/External.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Remote/External.hs b/Remote/External.hs index 96d665c26..50a0767ea 100644 --- a/Remote/External.hs +++ b/Remote/External.hs @@ -73,8 +73,8 @@ gen r u c gc = do where externaltype = fromMaybe (error "missing externaltype") (remoteAnnexExternalType gc) -externalSetup :: Maybe UUID -> RemoteConfig -> Annex (RemoteConfig, UUID) -externalSetup mu c = do +externalSetup :: Maybe UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID) +externalSetup mu _ c = do u <- maybe (liftIO genUUID) return mu let externaltype = fromMaybe (error "Specify externaltype=") $ M.lookup "externaltype" c @@ -225,8 +225,8 @@ handleRequest' lck external req mp responsehandler send $ VALUE value handleRemoteRequest (SETCREDS setting login password) = do c <- liftIO $ atomically $ readTMVar $ externalConfig external - c' <- setRemoteCredPair' c (credstorage setting) - (login, password) + c' <- setRemoteCredPair c (credstorage setting) $ + Just (login, password) void $ liftIO $ atomically $ swapTMVar (externalConfig external) c' handleRemoteRequest (GETCREDS setting) = do c <- liftIO $ atomically $ readTMVar $ externalConfig external |