()
| 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 | } |
no test coverage detected