/** * AuthRegistry * * Manages authentication provider registration and lookup. */ import { HttpRequest } from '../types'; import { IAuthProvider, AuthContext } from './IAuthProvider'; /** * Registration options */ export interface AuthRegistrationOptions { /** Force replace existing provider of same name */ force?: boolean; } export declare class AuthRegistry { private providers; /** * Register an auth provider * @param provider The provider to register * @param options Registration options * @throws Error if provider name already registered (unless force=true) */ register(provider: IAuthProvider, options?: AuthRegistrationOptions): void; /** * Get the number of registered providers */ getProviderCount(): number; /** * Find a provider that can handle the given request * @param request The HTTP request * @returns The provider or null if none found */ findProvider(request: HttpRequest): IAuthProvider | null; /** * Apply authentication to a request using the appropriate provider * @param request The HTTP request * @param context Authentication context * @returns Modified request with authentication applied */ applyAuth(request: HttpRequest, context: AuthContext): Promise; /** * Create a registry with all default providers */ static createDefault(): AuthRegistry; }