unison-credentials-0.0.0
Safe HaskellNone
LanguageHaskell2010

Unison.Auth.CredentialManager

Synopsis

Documentation

saveCredentials :: CredentialManager -> CodeserverId -> CodeserverCredentials -> IO () 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 :: CredentialManager -> IO 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 :: CodeserverCredentials -> IO Bool Source #

Checks whether CodeserverCredentials are expired.