zeebe-node
Version:
The Node.js client library for the Zeebe Workflow Automation Engine.
65 lines (64 loc) • 1.76 kB
TypeScript
/// <reference types="node" />
export interface OAuthProviderConfig {
/** OAuth Endpoint URL */
url: string;
/** OAuth Audience */
audience: string;
/** OAuth Scope */
scope?: string;
clientId: string;
clientSecret: string;
/** Custom TLS certificate for OAuth */
customRootCert?: Buffer;
/** Cache token in memory and on filesystem? */
cacheOnDisk?: boolean;
/** Override default token cache directory */
cacheDir?: string;
}
export declare class OAuthProvider {
private static readonly defaultTokenCache;
private static readonly getTokenCacheDirFromEnv;
cacheDir: string;
audience: string;
scope?: string;
url: string;
clientId: string;
clientSecret: string;
customRootCert?: Buffer;
useFileCache: boolean;
tokenCache: {};
userAgentString: string;
private currentBackoffTime;
private inflightTokenRequest?;
private expiryTimer?;
uuid: string;
constructor({
/** OAuth Endpoint URL */
url,
/** OAuth Audience */
audience,
/** OAuth Scope */
scope, cacheDir, clientId, clientSecret,
/** Custom TLS certificate for OAuth */
customRootCert,
/** Cache token in memory and on filesystem? */
cacheOnDisk, }: {
url: string;
audience: string;
scope?: string;
cacheDir?: string;
clientId: string;
clientSecret: string;
customRootCert?: Buffer;
cacheOnDisk: boolean;
});
getToken(): Promise<string>;
stopExpiryTimer(): void;
private debouncedTokenRequest;
private safeJSONParse;
private fromFileCache;
private toFileCache;
private isExpired;
private startExpiryTimer;
private cachedTokenFile;
}