import { Context } from "@webiny/handler/types"; export interface AuthenticationContext extends Context { authentication: Authentication; } export interface Authenticator { (token: string): Promise; } export interface Authentication { getIdentity(): TIdentity; setIdentity(identity: TIdentity): void; addAuthenticator(authenticator: Authenticator): void; getAuthenticators(): Authenticator[]; authenticate(token: string): Promise; } export interface Identity { id: string; type: string; displayName: string | null; group?: string; team?: string; groups?: string[]; teams?: string[]; [key: string]: any; }