adk-typescript
Version:
TypeScript port of Google's Agent Development Kit (ADK)
63 lines (62 loc) • 1.96 kB
TypeScript
/**
* Base interface for authentication schemes
*/
export interface AuthScheme {
/**
* The type of authentication scheme
*/
type: string;
/**
* Generate authentication headers for HTTP requests
* @param credentials The credentials to use for authentication
* @returns The headers to include in HTTP requests
*/
generateHeaders: (credentials: any) => Record<string, string>;
}
/**
* API key authentication scheme
*/
export declare class ApiKeyAuthScheme implements AuthScheme {
type: string;
private headerName;
/**
* Initializes the API key authentication scheme
* @param headerName The name of the header to include the API key in
*/
constructor(headerName?: string);
/**
* Generate authentication headers for HTTP requests
* @param apiKey The API key to include in the headers
* @returns The headers to include in HTTP requests
*/
generateHeaders(apiKey: string): Record<string, string>;
}
/**
* Bearer token authentication scheme
*/
export declare class BearerAuthScheme implements AuthScheme {
type: string;
/**
* Generate authentication headers for HTTP requests
* @param token The bearer token to include in the headers
* @returns The headers to include in HTTP requests
*/
generateHeaders(token: string): Record<string, string>;
}
/**
* Basic authentication scheme
*/
export declare class BasicAuthScheme implements AuthScheme {
type: string;
/**
* Generate authentication headers for HTTP requests
* @param credentials The credentials to use for authentication
* @param credentials.username The username for basic authentication
* @param credentials.password The password for basic authentication
* @returns The headers to include in HTTP requests
*/
generateHeaders(credentials: {
username: string;
password: string;
}): Record<string, string>;
}