@timesheet/sdk
Version:
Official TypeScript SDK for the Timesheet API
30 lines • 1.43 kB
TypeScript
import type { AuthorizationServerMetadata, OpenIdConfiguration, ProtectedResourceMetadata, OAuthDiscoveryResult } from './OAuthMetadata';
export interface OAuthDiscoveryOptions {
cacheTtl?: number;
timeout?: number;
fetchOpenIdConfig?: boolean;
fetchProtectedResource?: boolean;
}
export declare class OAuthDiscovery {
private static readonly DEFAULT_CACHE_TTL;
private static readonly DEFAULT_TIMEOUT;
private readonly cache;
private readonly options;
constructor(options?: OAuthDiscoveryOptions);
discover(issuerUrl: string): Promise<OAuthDiscoveryResult>;
fetchAuthorizationServerMetadata(issuerUrl: string): Promise<AuthorizationServerMetadata>;
fetchOpenIdConfiguration(issuerUrl: string): Promise<OpenIdConfiguration>;
fetchProtectedResourceMetadata(resourceUrl: string): Promise<ProtectedResourceMetadata>;
clearCache(): void;
clearCacheForIssuer(issuerUrl: string): void;
isCached(issuerUrl: string): boolean;
private normalizeIssuerUrl;
private getCached;
private setCache;
private validateAuthorizationServerMetadata;
private validateOpenIdConfiguration;
private validateProtectedResourceMetadata;
}
export declare function getDefaultDiscovery(): OAuthDiscovery;
export declare function discoverOAuth(issuerUrl: string, options?: OAuthDiscoveryOptions): Promise<OAuthDiscoveryResult>;
//# sourceMappingURL=OAuthDiscovery.d.ts.map