unison-credentials-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Auth.CredentialManager

Synopsis

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.

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.

isExpired :: MonadIO m => CodeserverCredentials -> m Bool Source #

Checks whether CodeserverCredentials are expired.