import { AuthenticationRecord, ConnectionRecord, DatabaseAdapter } from '@/adapters/database/index.js'; import { DBTokenResponse, AuthenticationURLOptions, ActionParams, ActionResponse, DirectAuthConfig } from '@/core/types.js'; import { OAuthAuthenticator, SecretSharingAuthenticator, WalletAuthenticator } from '@/adapters/auth/base.js'; export type ServiceAuthenticator = OAuthAuthenticator | SecretSharingAuthenticator | WalletAuthenticator; export interface AuthOptions { useHub?: boolean; hubConfig?: { baseUrl: string; clientId: string; clientSecret: string; }; directAuth?: DirectAuthConfig; database?: DatabaseAdapter; logger?: (msg: string) => void; } /** * Main authentication manager for MCP servers * Supports both centralized hub authentication and direct service authentication */ export declare class AuthManager { private hubAuth?; private directAuthenticators; private database?; private useHub; private logger; constructor(options: AuthOptions); private setupDirectAuthenticators; getDatabase(): DatabaseAdapter | undefined; /** * Register a custom authenticator for a service */ registerAuthenticator(service: string, authenticator: ServiceAuthenticator): void; /** * Get an authenticator for a specific service */ getAuthenticator(service: string): ServiceAuthenticator | undefined; /** * Get a list of registered services */ getRegisteredServices(): string[]; getRegisteredServicesWithType(): Map; /** * Generate authorization URL for a service */ getAuthorizationUrl(service: string, redirectUri: string, scopes: string[], options?: AuthenticationURLOptions): string; /** * Handle callback from authorization server */ handleCallback(service: string, callbackUrl: string, params: Record | undefined, logger: any): Promise; /** * Perform an action with a service */ performAction(service: string, actionParams: ActionParams, config: { accessToken?: string; refreshToken?: string; secrets?: any; }): Promise; /** * Get deployment information from hub */ getDeploymentInfo(deploymentId: string, clientId: string, clientSecret: string): Promise; /** * Store authentication for a specific service in a connection */ storeAuthentication(connectionId: string, service: string, token: DBTokenResponse, userInfo: { uniqueId: string; } | any): Promise; updateAuthentication(connectionId: string, service: string, updates: Partial>): Promise; deleteAuthentication(id: string): Promise; getAuthenticationRecord(connectionId: string, service: string): Promise; getAuthenticationRecordsForConnection(connectionId: string): Promise; /** * Get authentication for a specific service in a connection */ getAuthentication(connectionId: string, service: string): Promise; /** * Get all authentications for a connection */ getAuthenticationsForConnection(connectionId: string): Promise>; /** * Create a new connection */ createConnection(id: string, packageId: string, name: string, services: string[], isDirectAuth: boolean, userId: string, description?: string): Promise; /** * Get a connection by ID */ getConnection(connectionId: string): Promise; /** * Update connection status */ updateConnectionStatus(connectionId: string, status: 'active' | 'inactive' | 'pending'): Promise; /** * Get all connections for a package */ getConnectionsForPackage(packageId: string): Promise; /** * Check if all required services are authenticated for a connection */ isConnectionReady(connectionId: string): Promise; /** * Complete connection setup (activate if all services are authenticated) */ completeConnection(connectionId: string): Promise; /** * Refresh an access token */ refreshToken(service: string, refreshToken: string): Promise; getUserInfo(service: string, accessToken: string): Promise<{ uniqueId: string; } | any>; } //# sourceMappingURL=auth-manager.d.ts.map