/** * memory-journal-mcp — OAuth Error Classes * * Module-prefixed error classes for OAuth 2.0 authentication * and authorization failures. Extends MemoryJournalMcpError * for harmonized error handling across the MCP ecosystem. */ import { MemoryJournalMcpError } from '../types/errors.js'; /** * OAuth error code constants */ export declare const AUTH_ERROR_CODES: { readonly TOKEN_MISSING: "AUTH_TOKEN_MISSING"; readonly TOKEN_INVALID: "AUTH_TOKEN_INVALID"; readonly TOKEN_EXPIRED: "AUTH_TOKEN_EXPIRED"; readonly SIGNATURE_INVALID: "AUTH_SIGNATURE_INVALID"; readonly SCOPE_DENIED: "AUTH_SCOPE_DENIED"; readonly DISCOVERY_FAILED: "AUTH_DISCOVERY_FAILED"; readonly JWKS_FETCH_FAILED: "AUTH_JWKS_FETCH_FAILED"; readonly REGISTRATION_FAILED: "AUTH_REGISTRATION_FAILED"; }; /** * Base class for OAuth-related errors. * Extends MemoryJournalMcpError with OAuth-specific properties. */ export declare class OAuthError extends MemoryJournalMcpError { /** HTTP status code for this error */ readonly httpStatus: number; /** WWW-Authenticate header value */ readonly wwwAuthenticate?: string | undefined; constructor(message: string, code: string, httpStatus: number, details?: Record, wwwAuthenticate?: string); } /** * Token is missing from the request */ export declare class TokenMissingError extends OAuthError { constructor(realm?: string); } /** * Token is invalid (malformed, wrong format, etc.) */ export declare class InvalidTokenError extends OAuthError { constructor(message?: string, details?: Record); } /** * Token has expired */ export declare class TokenExpiredError extends OAuthError { constructor(expiredAt?: Date); } /** * Token signature is invalid */ export declare class InvalidSignatureError extends OAuthError { constructor(message?: string); } /** * Token does not have required scope */ export declare class InsufficientScopeError extends OAuthError { constructor(requiredScope: string | string[], providedScopes?: string[]); } /** * Failed to discover authorization server metadata */ export declare class AuthServerDiscoveryError extends OAuthError { constructor(serverUrl: string, cause?: Error); } /** * Failed to fetch JWKS */ export declare class JwksFetchError extends OAuthError { constructor(jwksUri: string, cause?: Error); } /** * Failed to register client */ export declare class ClientRegistrationError extends OAuthError { constructor(message: string, details?: Record); } /** * Check if an error is an OAuth error */ export declare function isOAuthError(error: unknown): error is OAuthError; /** * Get WWW-Authenticate header for an OAuth error. * @deprecated Use error.wwwAuthenticate property directly instead */ export declare function getWWWAuthenticateHeader(error: OAuthError, realm?: string): string; //# sourceMappingURL=errors.d.ts.map