@zestic/oauth-core
Version:
Framework-agnostic OAuth authentication library with support for multiple OAuth flows
71 lines • 2.13 kB
TypeScript
/**
* Registry for managing OAuth flow handlers
*/
import { CallbackFlowHandler, CallbackFlowDetectionResult, CallbackFlowRegistryOptions } from '../types/CallbackFlowTypes';
import { OAuthConfig } from '../types/OAuthTypes';
export declare class CallbackFlowRegistry {
private handlers;
private options;
constructor(options?: CallbackFlowRegistryOptions);
/**
* Register a flow handler
*/
register(handler: CallbackFlowHandler): void;
/**
* Unregister a flow handler
*/
unregister(name: string): boolean;
/**
* Get a specific flow handler by name
*/
getHandler(name: string): CallbackFlowHandler | undefined;
/**
* Get all registered handlers
*/
getAllHandlers(): CallbackFlowHandler[];
/**
* Get handlers sorted by priority
*/
getHandlersByPriority(): CallbackFlowHandler[];
/**
* Auto-detect which flow to use based on parameters
*/
detectFlow(params: URLSearchParams, config: OAuthConfig): CallbackFlowHandler | undefined;
/**
* Detect flow with confidence scoring
*/
detectFlowWithConfidence(params: URLSearchParams, config: OAuthConfig): CallbackFlowDetectionResult | undefined;
/**
* Get all handlers that can handle the given parameters
*/
getCompatibleHandlers(params: URLSearchParams, config: OAuthConfig): CallbackFlowHandler[];
/**
* Check if a specific flow is registered
*/
hasHandler(name: string): boolean;
/**
* Get the number of registered handlers
*/
getHandlerCount(): number;
/**
* Clear all registered handlers
*/
clear(): void;
/**
* Get handler names
*/
getHandlerNames(): string[];
/**
* Validate that all required handlers are registered
*/
validateRequiredHandlers(requiredHandlers: string[]): void;
/**
* Register multiple handlers at once
*/
registerMultiple(handlers: CallbackFlowHandler[]): void;
/**
* Create a copy of the registry
*/
clone(): CallbackFlowRegistry;
}
//# sourceMappingURL=CallbackFlowRegistry.d.ts.map