/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import { ScopeType } from "@fluidframework/driver-definitions/internal"; import { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-driver"; import { IInsecureUser } from "./insecureUsers.js"; /** * Provides an in memory implementation of {@link @fluidframework/routerlicious-driver#ITokenProvider} that can be * used to insecurely connect to the Fluid Relay. * * As the name implies, this is not secure and should not be used in production. * It simply makes examples where authentication is not relevant easier to bootstrap. * @sealed * @internal */ export declare class InsecureTokenProvider implements ITokenProvider { /** * Private server tenantKey for generating tokens. */ private readonly tenantKey; /** * User with whom generated tokens will be associated. */ private readonly user; /** * Optional. Override of scopes. If a param is not provided, InsecureTokenProvider * will use the default scopes which are document read, write and summarizer write. * * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes} * * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ] */ private readonly scopes?; /** * Optional. Override of attach container scopes. If a param is not provided, * InsecureTokenProvider will use the value of {@link InsecureTokenProvider.scopes}. * * @remarks Common use of this parameter is to allow write for container * attach and just read for all other access. Effectively can create a * container and then read-only client. * * @param attachContainerScopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes} * * @defaultValue {@link InsecureTokenProvider.scopes} */ private readonly attachContainerScopes?; constructor( /** * Private server tenantKey for generating tokens. */ tenantKey: string, /** * User with whom generated tokens will be associated. */ user: IInsecureUser, /** * Optional. Override of scopes. If a param is not provided, InsecureTokenProvider * will use the default scopes which are document read, write and summarizer write. * * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes} * * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ] */ scopes?: ScopeType[] | undefined, /** * Optional. Override of attach container scopes. If a param is not provided, * InsecureTokenProvider will use the value of {@link InsecureTokenProvider.scopes}. * * @remarks Common use of this parameter is to allow write for container * attach and just read for all other access. Effectively can create a * container and then read-only client. * * @param attachContainerScopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes} * * @defaultValue {@link InsecureTokenProvider.scopes} */ attachContainerScopes?: ScopeType[] | undefined); private fetchToken; readonly fetchOrdererToken: (tenantId: string, documentId?: string) => Promise; readonly fetchStorageToken: (tenantId: string, documentId?: string) => Promise; } //# sourceMappingURL=insecureTokenProvider.d.ts.map