Constructs a new ChRISConnection instance.
Optionalconfig: ConnectionConfig
The connection configuration object.
OptionalstorageProvider: IStorageProvider
The storage provider for persistence.
How a failed login asks the network what happened; a test stands one in.
Access the connection configuration.
Retrieves the authentication token.
OptionalforceLoad: boolean
If true, forces loading the token from storage.
A Promise resolving to the authentication token or null.
Retrieves the ChRIS CUBE URL.
A Promise resolving to the ChRIS URL or null.
Retrieves the ChRIS API client instance.
A Promise resolving to the Client instance or null.
Refreshes the ChRIS API client with current token and URL.
A Promise resolving to the refreshed Client instance or null.
Establishes a connection to the ChRIS CUBE and authenticates the user.
Connection options including user, password, debug flag, and URL.
A Promise resolving to the authentication token on success, or null on failure.
Establishes a connection from a CUBE token somebody else already minted.
The password path exchanges a password for a token and saves it. A front that authenticated the operator itself — a login door on a shared host — holds the token and never the password, so it hands the token over as it is. The token is proved against the server BEFORE anything is written: a refused token leaves the saved context and the last-user pointer exactly as they were. Nothing here exits the process, and nothing lands on the error stack; the refusal travels in the outcome, because the caller is a boot that has its own row to write.
The identity the token was minted for, and the token.
Connected, or refused with the server's reason.
Checks if the client is currently connected.
True if connected, false otherwise.
Logs out the user by clearing the authentication token from storage.
Sets the ChRIS context based on a context string (e.g., user@url?folder=...).
The context string.
A Promise resolving to true on success, false otherwise.
Executes one operation with a non-persistent CUBE client for supplied credentials. The client follows only the nested operation's asynchronous context, so concurrent normal and elevated commands retain their own identities.
The normal session token, cached client, and token storage remain intact.
Credentials for the requested CUBE identity.
Work to perform while the temporary client is active.
The operation's result.
Proves a token against a CUBE without reading its root, which is the feed list and can outlast the check for an identity that sees thousands of feeds (#1280).
Base URL of the CUBE API, ending in /.
The token to prove.
Retrieves the current authenticated user's username.
A Promise resolving to the username string or null if not authenticated.
Manages the connection and authentication with a ChRIS CUBE.