/** * Harper OAuth Plugin * * Provides OAuth 2.0 authentication for Harper applications. * Supports any standard OAuth 2.0 provider through configuration. */ import type { Scope, OAuthHooks } from './types.ts'; export { HookManager } from './lib/hookManager.ts'; export { OAuthResource } from './lib/resource.ts'; export type { OAuthHooks, OAuthUser, TokenResponse, OnLoginResult, OnLoginResultOk, OnLoginResultDenied, OnLoginResultNeedsConfirmation, } from './types.ts'; export { TenantManager } from './lib/tenantManager.ts'; export type { TenantConfig, TenantRegistryEntry } from './lib/tenantManager.ts'; export { validateDomainSafety, validateDomainAllowlist, validateEmailDomain, validateTenantId, sanitizeTenantName, validateAzureTenantId, } from './lib/providers/validation.ts'; export { getProvider } from './lib/providers/index.ts'; export { withOAuthValidation, getOAuthProviders } from './lib/withOAuthValidation.ts'; export type { OAuthValidationOptions } from './lib/withOAuthValidation.ts'; export { withMCPAuth } from './lib/mcp/withMCPAuth.ts'; export type { WithMCPAuthOptions } from './lib/mcp/withMCPAuth.ts'; export type { MCPRequestClaims } from './types.ts'; /** * Register OAuth hooks programmatically * Call this from your application code to register lifecycle hooks * * This can be called: * - At module load time (before the plugin initializes) - hooks will be queued * - After plugin initialization - hooks will be applied immediately * * NOTE: This registers hooks at the module level, shared across all instances * of the OAuth plugin. For most applications with a single OAuth plugin instance, * this is the simplest and recommended approach. * * @example * ```typescript * import { registerHooks } from '@harperfast/oauth'; * * // Can be called at module load time or later * registerHooks({ * onLogin: async (oauthUser, tokenResponse, session, request, provider) => { * console.log(`User logged in: ${oauthUser.username}`); * } * }); * ``` */ export declare function registerHooks(hooks: OAuthHooks): void; /** * Plugin entry point */ export declare function handleApplication(scope: Scope): Promise;