firebase-auth-cloudflare-workers
Version:
Zero-dependencies firebase auth library for Cloudflare Workers.
36 lines (35 loc) • 1.19 kB
TypeScript
import type { KeyStorer } from './key-store';
export interface KeyFetcher {
fetchPublicKeys(): Promise<Array<JsonWebKeyWithKid>>;
}
interface JWKMetadata {
keys: Array<JsonWebKeyWithKid>;
}
export declare const isJWKMetadata: (value: any) => value is JWKMetadata;
export declare const isX509Certificates: (value: any) => value is Record<string, string>;
/**
* Class to fetch public keys from a client certificates URL.
*/
export declare class UrlKeyFetcher implements KeyFetcher {
private readonly fetcher;
private readonly keyStorer;
constructor(fetcher: Fetcher, keyStorer: KeyStorer);
/**
* Fetches the public keys for the Google certs.
*
* @returns A promise fulfilled with public keys for the Google certs.
*/
fetchPublicKeys(): Promise<Array<JsonWebKeyWithKid>>;
private refresh;
private retrievePublicKeys;
}
export declare const parseMaxAge: (cacheControlHeader: string | null) => number;
export interface Fetcher {
fetch(): Promise<Response>;
}
export declare class HTTPFetcher implements Fetcher {
private readonly clientCertUrl;
constructor(clientCertUrl: string);
fetch(): Promise<Response>;
}
export {};