/** * postgres-mcp - OAuth Errors * * Error classes for OAuth 2.1 authentication and authorization. * Follows the harmonized error handling standard — OAuthError * extends PostgresMcpError for full category/suggestion/toResponse() support. */ import { PostgresMcpError } from "../types/errors.js"; /** * Base OAuth error class */ export declare class OAuthError extends PostgresMcpError { readonly httpStatus: number; readonly wwwAuthenticate: string; constructor(message: string, code: string, httpStatus?: number, options?: { details?: Record; wwwAuthenticate?: string; }); } /** * Token missing from request */ export declare class TokenMissingError extends OAuthError { constructor(message?: string); } /** * Token is invalid (malformed, wrong signature, etc.) */ export declare class InvalidTokenError extends OAuthError { constructor(message?: string); } /** * Token has expired */ export declare class TokenExpiredError extends OAuthError { constructor(message?: string); } /** * Token signature is invalid */ export declare class InvalidSignatureError extends OAuthError { constructor(message?: string); } /** * Token lacks required scope */ export declare class InsufficientScopeError extends OAuthError { readonly requiredScopes: string[]; constructor(requiredScopes: string[], message?: string); } /** * Authorization server discovery failed */ export declare class AuthServerDiscoveryError extends OAuthError { constructor(message?: string); } /** * JWKS fetch failed */ export declare class JwksFetchError extends OAuthError { constructor(message?: string); } /** * Client registration failed */ export declare class ClientRegistrationError extends OAuthError { constructor(message?: string); } /** * 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