@openfga/sdk
Version:
JavaScript and Node.js SDK for OpenFGA
100 lines (99 loc) • 2.36 kB
TypeScript
/**
* JavaScript and Node.js SDK for OpenFGA
*
* API version: 1.x
* Website: https://openfga.dev
* Documentation: https://openfga.dev/docs
* Support: https://openfga.dev/community
* License: [Apache-2.0](https://github.com/openfga/js-sdk/blob/main/LICENSE)
*
* NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT.
*/
export declare enum CredentialsMethod {
None = "none",
ApiToken = "api_token",
ClientCredentials = "client_credentials"
}
type BaseClientCredentialsConfig = {
/**
* Client ID
*
* @type {string}
* @memberof Configuration
*/
clientId: string;
/**
* API Token Issuer
*
* @type {string}
*/
apiTokenIssuer: string;
/**
* API Audience
*
* @type {string}
*/
apiAudience: string;
/**
* Claims to be included in the token exchange request.
*
* @type {Record<string, string>}
*/
customClaims?: Record<string, string>;
};
export type ClientSecretConfig = BaseClientCredentialsConfig & {
/**
* Client Secret
*
* @type {string}
* @memberof Configuration
*/
clientSecret: string;
};
export type PrivateKeyJWTConfig = BaseClientCredentialsConfig & {
/**
* Client assertion signing key
*
* @type {string}
* @memberof Configuration
*/
clientAssertionSigningKey: string;
/**
* Client assertion signing algorithm,
* defaults to `RS256` if not specified.
* @type {string}
* @memberof Configuration
*/
clientAssertionSigningAlgorithm?: string;
};
export type ClientCredentialsConfig = ClientSecretConfig | PrivateKeyJWTConfig;
export interface ApiTokenConfig {
/**
* API Token Value
*
* @type {string}
*/
token: string;
/**
* API Token Header Name (default = Authorization)
*
* @type {string}
*/
headerName: string;
/**
* API Token Value Prefix (default = Bearer)
*
* @type {string}
*/
headerValuePrefix: string;
}
export type AuthCredentialsConfig = {
method: CredentialsMethod.None | undefined;
} | {
method: CredentialsMethod.ApiToken;
config: ApiTokenConfig;
} | {
method: CredentialsMethod.ClientCredentials;
config: ClientCredentialsConfig;
} | undefined;
export {};