export interface AuthContext {
userId: string;
tenantId: string | null;
profile: any;
authenticated: boolean;
}
export declare class AuthManager {
private static instance;
private authContext;
private constructor();
static getInstance(): AuthManager;
/**
* Authenticate with various methods
*/
authenticate(method: 'token' | 'api_key', credentials: string): Promise<AuthContext>;
/**
* Authenticate with user session token (legacy - not used with API)
*/
private authenticateWithToken;
/**
* Authenticate with API key via Helios-9 API
*/
private authenticateWithApiKey;
/**
* Get current auth context
*/
getAuthContext(): AuthContext;
/**
* Check if authenticated
*/
isAuthenticated(): boolean;
/**
* Ensure authenticated before API calls
*/
ensureAuthenticated(): Promise<AuthContext>;
/**
* Clear authentication
*/
clearAuth(): void;
/**
* Middleware for MCP operations that require authentication
*/
requireAuth<T extends any[], R>(operation: (...args: T) => Promise<R>): (...args: T) => Promise<R>;
/**
* Get rate limiting info for current user
*/
getRateLimitInfo(): {
limit: number;
window: number;
current: number;
};
/**
* Validate permissions for specific operations
*/
validatePermission(resource: string, action: string, resourceId?: string): Promise<boolean>;
}
export declare const authManager: AuthManager;
export declare function authenticate(method: 'token' | 'api_key', credentials: string): Promise<AuthContext>;
export declare function requireAuth<T extends any[], R>(operation: (...args: T) => Promise<R>): (...args: T) => Promise<R>;