suitecrm-mcp-server
Version:
Model Context Protocol server for SuiteCRM integration with natural language SQL reporting
59 lines • 1.47 kB
TypeScript
/**
* Authentication service for SuiteCRM OAuth 2.0
*/
import { AuthCredentials, AuthResponse } from '../types';
export declare class AuthService {
private httpClient;
private tokenCache;
private readonly cacheCleanupInterval;
constructor(baseUrl: string, timeout?: number);
/**
* Authenticate with SuiteCRM using client credentials flow
*/
authenticate(credentials: AuthCredentials): Promise<AuthResponse>;
/**
* Get a valid token for the given credentials
*/
getValidToken(credentials: AuthCredentials): Promise<string>;
/**
* Check if a token is valid and not expired
*/
isTokenValid(token: string): boolean;
/**
* Invalidate a token (remove from cache)
*/
invalidateToken(token: string): void;
/**
* Clear all cached tokens
*/
clearCache(): void;
/**
* Get cache statistics
*/
getCacheStats(): {
total: number;
expired: number;
valid: number;
};
/**
* Cleanup expired tokens from cache
*/
private cleanupExpiredTokens;
/**
* Check if a stored token is expired
*/
private isTokenExpired;
/**
* Generate cache key for credentials
*/
private getCacheKey;
/**
* Mask token for logging (show only first and last 4 characters)
*/
private maskToken;
/**
* Cleanup resources
*/
destroy(): void;
}
//# sourceMappingURL=auth.d.ts.map