import type IStorage from "./IStorage"; import type IStorageUtility from "./IStorageUtility"; import type { IIssuerConfig } from "../login/oidc/IIssuerConfig"; import type { IIssuerConfigFetcher } from "../login/oidc/IIssuerConfigFetcher"; import type { KeyPair } from "../authenticatedFetch/dpopUtils"; export type OidcContext = { issuerConfig: IIssuerConfig; codeVerifier?: string; redirectUrl?: string; dpop: boolean; keepAlive: boolean; }; export declare function getSessionIdFromOauthState(storageUtility: IStorageUtility, oauthState: string): Promise; /** * Based on the provided state, this looks up contextual information stored * before redirecting the user to the OIDC issuer. * @param sessionId The state (~ correlation ID) of the OIDC request * @param storageUtility * @param configFetcher * @returns Information stored about the client issuing the request */ export declare function loadOidcContextFromStorage(sessionId: string, storageUtility: IStorageUtility, configFetcher: IIssuerConfigFetcher): Promise; /** * Stores information about the session in the provided storage. Note that not * all storage are equally secure, and it is strongly advised not to store either * the refresh token or the DPoP key in the browser's local storage. * * @param storageUtility * @param sessionId * @param webId * @param clientId * @param isLoggedIn * @param refreshToken * @param secure * @param dpopKey */ export declare function saveSessionInfoToStorage(storageUtility: IStorageUtility, sessionId: string, webId?: string, clientId?: string, isLoggedIn?: string, refreshToken?: string, secure?: boolean, dpopKey?: KeyPair): Promise; /** * @hidden */ export default class StorageUtility implements IStorageUtility { private secureStorage; private insecureStorage; constructor(secureStorage: IStorage, insecureStorage: IStorage); private getKey; private getUserData; private setUserData; get(key: string, options?: { errorIfNull?: boolean; secure?: boolean; }): Promise; set(key: string, value: string, options?: { secure?: boolean; }): Promise; delete(key: string, options?: { secure?: boolean; }): Promise; getForUser(userId: string, key: string, options?: { errorIfNull?: boolean; secure?: boolean; }): Promise; setForUser(userId: string, values: Record, options?: { secure?: boolean; }): Promise; deleteForUser(userId: string, key: string, options?: { secure?: boolean; }): Promise; deleteAllUserData(userId: string, options?: { secure?: boolean; }): Promise; }