| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Unison.Auth.CredentialManager
Synopsis
- saveCredentials :: MonadUnliftIO m => CredentialManager -> CodeserverId -> CodeserverCredentials -> m ()
- data CredentialManager
- globalCredentialManager :: CredentialManager
- getCodeserverCredentials :: MonadIO m => CredentialManager -> CodeserverId -> m (Either CredentialFailure CodeserverCredentials)
- getOrCreatePersonalKey :: MonadUnliftIO m => CredentialManager -> m PersonalPrivateKey
- isExpired :: MonadIO m => CodeserverCredentials -> m Bool
Documentation
saveCredentials :: MonadUnliftIO m => CredentialManager -> CodeserverId -> CodeserverCredentials -> m () Source #
Saves credentials to the active profile.
data CredentialManager Source #
A CredentialManager knows how to load, save, and cache credentials.
It's thread-safe and safe for use across multiple UCM clients.
Note: Currently the in-memory cache is _not_ updated if a different UCM updates
the credentials file, however this shouldn't pose any problems, since auth will still
be refreshed if we encounter any auth failures on requests.
globalCredentialManager :: CredentialManager Source #
A global CredentialManager instance/singleton.
getCodeserverCredentials :: MonadIO m => CredentialManager -> CodeserverId -> m (Either CredentialFailure CodeserverCredentials) Source #
getOrCreatePersonalKey :: MonadUnliftIO m => CredentialManager -> m PersonalPrivateKey Source #
Fetches the user's personal key from the active profile, if it exists. Otherwise it creates a new personal key, saves it to the active profile, and returns it.