mise API - v0.0.0
    Preparing search index...

    Class ChRISConnection

    Manages the connection and authentication with a ChRIS CUBE.

    Index
    loginProbe: (url: string) => Promise<string | null> = url_probe

    How a failed login asks the network what happened; a test stands one in.

    • Retrieves the authentication token.

      Parameters

      • OptionalforceLoad: boolean

        If true, forces loading the token from storage.

      Returns Promise<string | null>

      A Promise resolving to the authentication token or null.

    • Establishes a connection to the ChRIS CUBE and authenticates the user.

      Parameters

      • options: ConnectOptions

        Connection options including user, password, debug flag, and URL.

      Returns Promise<string | null>

      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.

      Parameters

      Returns Promise<TokenConnectOutcome>

      Connected, or refused with the server's reason.

    • Sets the ChRIS context based on a context string (e.g., user@url?folder=...).

      Parameters

      • context: string

        The context string.

      Returns Promise<boolean>

      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.

      Type Parameters

      • T

      Parameters

      • credentials: ElevationCredentials

        Credentials for the requested CUBE identity.

      • operation: () => Promise<T>

        Work to perform while the temporary client is active.

      Returns Promise<T>

      The operation's result.

      When no CUBE URL is available or authentication fails.

    • 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).

      Parameters

      • url: string

        Base URL of the CUBE API, ending in /.

      • token: string

        The token to prove.

      Returns Promise<void>

      chrisapi's error: carrying CUBE's response when it refused, "No server response!" when nothing came back.

    • Retrieves the current authenticated user's username.

      Returns Promise<string | null>

      A Promise resolving to the username string or null if not authenticated.