/** * API Key Authentication System * * Handles API key validation, scopes, and permissions for external APIs. */ export interface APIKeyValidation { valid: boolean; apiKeyId?: string; clientId?: string; userId?: string; scopes?: string[]; reason?: string; metadata?: Record; } export interface APIKeyValidationOptions { requiredScopes?: string[]; entityName?: string; allowInactive?: boolean; } interface APIKeyData { id: string; clientId: string; userId?: string; scopes: string[]; active: boolean; name: string; lastUsed?: string; expiresAt?: string; metadata?: Record; } /** * Validate API key and check permissions */ export declare function validateAPIKey(apiKey: string, options?: APIKeyValidationOptions): Promise; /** * Generate scope name for entity and action */ export declare function generateScope(entityName: string, action: 'read' | 'create' | 'update' | 'delete'): string; /** * Check if API key has specific scope */ export declare function hasScope(scopes: string[], requiredScope: string): boolean; /** * Create API key (mock implementation) */ export declare function createAPIKey(data: { clientId: string; userId?: string; scopes: string[]; name: string; expiresAt?: string; metadata?: Record; }): Promise<{ apiKey: string; keyData: APIKeyData; }>; /** * Revoke API key */ export declare function revokeAPIKey(apiKey: string): Promise; /** * List API keys for a client */ export declare function listAPIKeys(clientId: string): Promise; /** * Get API key analytics */ export declare function getAPIKeyAnalytics(apiKey: string): Promise<{ requests: number; lastUsed?: string; scopes: string[]; active: boolean; } | null>; export {}; //# sourceMappingURL=api-keys.d.ts.map