@172ai/containers-mcp-server
Version: 
MCP server for 172.ai container management platform - enables AI assistants to manage containers, builds, and files with comprehensive workflow prompts
57 lines • 1.41 kB
TypeScript
import { AxiosInstance } from 'axios';
import { ApiKeyInfo } from './types.js';
/**
 * Authentication manager for the MCP server
 */
export declare class AuthManager {
    private httpClient;
    private currentToken?;
    private tokenExpiry?;
    constructor();
    /**
     * Get a valid authentication token
     */
    private getValidToken;
    /**
     * Get OAuth token using client credentials flow
     */
    private getOAuthToken;
    /**
     * Check if current token is valid and not expired
     */
    private isTokenValid;
    /**
     * Get authenticated HTTP client
     */
    getHttpClient(): AxiosInstance;
    /**
     * Test authentication by making a simple API call
     */
    testAuthentication(): Promise<boolean>;
    /**
     * Get current user's API keys (if using OAuth)
     */
    getApiKeys(): Promise<ApiKeyInfo[]>;
    /**
     * Validate API key
     */
    validateApiKey(apiKey: string): Promise<ApiKeyInfo>;
    /**
     * Refresh OAuth token if needed
     */
    refreshTokenIfNeeded(): Promise<void>;
    /**
     * Clear authentication state
     */
    clearAuth(): void;
    /**
     * Get authentication status
     */
    getAuthStatus(): {
        method: 'api_key' | 'oauth_token' | 'client_credentials' | 'none';
        isValid: boolean;
        expiresAt?: Date;
    };
}
export declare const authManager: AuthManager;
//# sourceMappingURL=auth.d.ts.map