Give the JsonWebKey alias the kid a JWKS selects a key by
This commit was merged in pull request #170.
This commit is contained in:
+3
-2
@@ -8,8 +8,9 @@ import { currentLog } from "../logger.ts";
|
|||||||
// (or re-reads a mounted file), caches for a TTL, and reloads once on a `kid` miss so a rotated-
|
// (or re-reads a mounted file), caches for a TTL, and reloads once on a `kid` miss so a rotated-
|
||||||
// in key is picked up without a restart (README: zero-downtime rotation). `createJwksProvider`
|
// in key is picked up without a restart (README: zero-downtime rotation). `createJwksProvider`
|
||||||
// picks the right one from the configured URL scheme and primes it at boot (fail loud).
|
// picks the right one from the configured URL scheme and primes it at boot (fail loud).
|
||||||
// node:crypto exports the JWK type only under webcrypto since @types/node 26.
|
// node:crypto exports the JWK type only under webcrypto since @types/node 26, and that type lacks
|
||||||
export type JsonWebKey = webcrypto.JsonWebKey;
|
// the `kid` a JWKS selects a key by.
|
||||||
|
export type JsonWebKey = webcrypto.JsonWebKey & { kid?: string };
|
||||||
|
|
||||||
export interface JwksProvider {
|
export interface JwksProvider {
|
||||||
getKey(kid: string | undefined): Promise<JsonWebKey | null>;
|
getKey(kid: string | undefined): Promise<JsonWebKey | null>;
|
||||||
|
|||||||
Reference in New Issue
Block a user