@5minds/processcube_engine
Version:
The ProcessCube Engine. Stores and executes BPMNs.
41 lines (40 loc) • 1.81 kB
TypeScript
import jwt from 'jsonwebtoken';
import { IAMConfiguration, Logger, Identity as PublicIdentity } from '@5minds/processcube_engine_sdk';
import { InternalIdentity as Identity } from '../../Contracts/index';
import { IAMFetchClient } from './Internals';
import { TokenBody } from './TokenBody';
export type GetIdentityParams = {
token: string;
sessionId?: string;
ignoreTokenExpired?: boolean;
skipValidation?: boolean;
userId?: string;
};
export declare class IdentityService {
protected config: IAMConfiguration;
protected jsonWebToken: typeof jwt;
protected iamFetchClient: IAMFetchClient;
protected mock: boolean;
protected readonly logger: Logger;
protected readonly minimumRefreshTimeInMs = 1000;
protected readonly maximumRefreshTimeInMs: number;
initialize(jsonWebToken?: any, mock?: boolean): void;
getRootAccessTokenAllowed(): boolean;
getIdentity(params: GetIdentityParams): Promise<Identity>;
getIdentityForExtensionAdapters(identity?: PublicIdentity): Promise<Identity>;
getAvailableLaneClaims(identity: Identity): Array<string>;
getRootAccessIdentity(): Identity;
getInternalIdentity(): Identity;
isInternalToken(token: string): boolean;
isRootAccessToken(token: string): boolean;
protected getClaims(token: string): Promise<{
[claimName: string]: any;
}>;
protected decodeToken(token: string, skipValidation?: boolean, ignoreTokenExpired?: boolean): Promise<TokenBody>;
protected validateDecodedToken(decodedToken: TokenBody): void;
protected calculateMinimumTokenLifetime(tokenLifetime: number): number;
protected limitNumberWithinRange(number: number, min: number, max: number): number;
protected getClaimsForInternalIdentity(): {
[claimName: string]: any;
};
}