n8n
Version:
n8n Workflow Automation Tool
24 lines (23 loc) • 1.05 kB
TypeScript
import type { User } from '@n8n/db';
export type AuthFailureReason = 'missing_authorization_header' | 'invalid_bearer_format' | 'jwt_decode_failed' | 'invalid_token' | 'token_not_found_in_db' | 'user_not_found' | 'user_id_not_in_auth_info' | 'unknown_error' | 'verifier_not_registered' | 'insufficient_scope';
export type Mcpauth_type = 'oauth' | 'api_key' | 'unknown';
export type TelemetryAuthContext = {
reason: AuthFailureReason;
auth_type: Mcpauth_type;
error_details?: string;
};
export type UserWithContext = {
user: User | null;
actor?: User;
context?: TelemetryAuthContext;
authType?: Mcpauth_type;
scopes?: string[];
};
export interface OAuthTokenVerifier {
verifyOAuthAccessToken(token: string, expectedAudience?: string): Promise<UserWithContext>;
}
export declare class OAuthTokenVerifierProxy implements OAuthTokenVerifier {
private provider;
registerProvider(provider: OAuthTokenVerifier): void;
verifyOAuthAccessToken(token: string, expectedAudience?: string): Promise<UserWithContext>;
}