MCPcopy
hub / github.com/authts/oidc-client-ts / getSigningKeys

Method getSigningKeys

src/MetadataService.ts:127–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125 }
126
127 public async getSigningKeys(): Promise<SigningKey[] | null> {
128 const logger = this._logger.create("getSigningKeys");
129 if (this._signingKeys) {
130 logger.debug("returning signingKeys from cache");
131 return this._signingKeys;
132 }
133
134 const jwks_uri = await this.getKeysEndpoint(false);
135 logger.debug("got jwks_uri", jwks_uri);
136
137 const keySet = await this._jsonService.getJson(jwks_uri, { timeoutInSeconds: this._settings.requestTimeoutInSeconds });
138 logger.debug("got key set", keySet);
139
140 if (!Array.isArray(keySet.keys)) {
141 logger.throw(new Error("Missing keys on keyset"));
142 // eslint-disable-next-line @typescript-eslint/only-throw-error
143 throw null; // https://github.com/microsoft/TypeScript/issues/46972
144 }
145
146 this._signingKeys = keySet.keys;
147 return this._signingKeys;
148 }
149}

Callers 1

Calls 5

getKeysEndpointMethod · 0.95
getJsonMethod · 0.80
throwMethod · 0.80
debugMethod · 0.65
createMethod · 0.45

Tested by

no test coverage detected