ai-auth
Version:
Complete Auth-Agent SDK - Agent authentication for AI developers + OAuth client integration for website developers
33 lines • 1.07 kB
TypeScript
/**
* Utility functions for api.oAuth-Agent SDK
*/
import type { PKCEPair } from './types';
/**
* Generate PKCE code verifier and challenge (synchronous, simplified)
* Note: This version doesn't use proper SHA-256 hashing
* Use generatePKCEAsync() for production
*/
export declare function generatePKCE(): PKCEPair;
/**
* Generate PKCE code verifier and challenge (async, with SHA-256)
* This is the recommended function for OAuth 2.1 compliance
*/
export declare function generatePKCEAsync(): Promise<PKCEPair>;
/**
* Generate a random state parameter for CSRF protection
*/
export declare function generateState(): string;
/**
* Parse JWT token (without verification)
* Only use for reading claims, not for security validation
*/
export declare function parseJWT(token: string): any;
/**
* Check if token is expired
*/
export declare function isTokenExpired(expiresAt: number): boolean;
/**
* Get time until token expires (in milliseconds)
*/
export declare function getTimeUntilExpiry(expiresAt: number): number;
//# sourceMappingURL=utils.d.ts.map