-
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add JWKS Cache management for use in non-persistent runtimes
- Loading branch information
Showing
8 changed files
with
250 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Function: getJwksCache() | ||
|
||
[💗 Help the project](https://github.com/sponsors/panva) | ||
|
||
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). | ||
|
||
*** | ||
|
||
▸ **getJwksCache**(`config`): [`ExportedJWKSCache`](../interfaces/ExportedJWKSCache.md) \| `undefined` | ||
|
||
This function can be used to export the JSON Web Key Set and the timestamp at | ||
which it was last fetched if the client used the | ||
[authorization server's JWK Set](../interfaces/ServerMetadata.md#jwks_uri) to validate | ||
digital signatures. | ||
|
||
This function is intended for cloud computing runtimes that cannot keep an in | ||
memory cache between their code's invocations. Use in runtimes where an in | ||
memory cache between requests is available is not desirable. | ||
|
||
Note: the client only uses the authorization server's JWK Set when | ||
[enableNonRepudiationChecks](enableNonRepudiationChecks.md), [useJwtResponseMode](useJwtResponseMode.md), or | ||
[useCodeIdTokenResponseType](useCodeIdTokenResponseType.md) is used. | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | | ||
| ------ | ------ | | ||
| `config` | [`Configuration`](../classes/Configuration.md) | | ||
|
||
## Returns | ||
|
||
[`ExportedJWKSCache`](../interfaces/ExportedJWKSCache.md) \| `undefined` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Function: setJwksCache() | ||
|
||
[💗 Help the project](https://github.com/sponsors/panva) | ||
|
||
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). | ||
|
||
*** | ||
|
||
▸ **setJwksCache**(`config`, `jwksCache`): `void` | ||
|
||
DANGER ZONE - Use of this function has security implications that must be | ||
understood, assessed for applicability, and accepted before use. It is | ||
critical that the JSON Web Key Set cache only be writable by your own code. | ||
|
||
This option is intended for cloud computing runtimes that cannot keep an in | ||
memory cache between their code's invocations. Use in runtimes where an in | ||
memory cache between requests is available is not desirable. | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| ------ | ------ | ------ | | ||
| `config` | [`Configuration`](../classes/Configuration.md) | - | | ||
| `jwksCache` | [`ExportedJWKSCache`](../interfaces/ExportedJWKSCache.md) | JWKS Cache previously obtained from [getJwksCache](getJwksCache.md) | | ||
|
||
## Returns | ||
|
||
`void` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Interface: ExportedJWKSCache | ||
|
||
[💗 Help the project](https://github.com/sponsors/panva) | ||
|
||
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). | ||
|
||
*** | ||
|
||
## Properties | ||
|
||
### jwks | ||
|
||
• **jwks**: [`JWKS`](JWKS.md) | ||
|
||
*** | ||
|
||
### uat | ||
|
||
• **uat**: `number` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Interface: JWK | ||
|
||
[💗 Help the project](https://github.com/sponsors/panva) | ||
|
||
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). | ||
|
||
*** | ||
|
||
## Indexable | ||
|
||
\[`parameter`: `string`\]: [`JsonValue`](../type-aliases/JsonValue.md) \| `undefined` | ||
|
||
## Properties | ||
|
||
### alg? | ||
|
||
• `readonly` `optional` **alg**: `string` | ||
|
||
*** | ||
|
||
### crv? | ||
|
||
• `readonly` `optional` **crv**: `string` | ||
|
||
*** | ||
|
||
### e? | ||
|
||
• `readonly` `optional` **e**: `string` | ||
|
||
*** | ||
|
||
### key\_ops? | ||
|
||
• `readonly` `optional` **key\_ops**: `string`[] | ||
|
||
*** | ||
|
||
### kid? | ||
|
||
• `readonly` `optional` **kid**: `string` | ||
|
||
*** | ||
|
||
### kty? | ||
|
||
• `readonly` `optional` **kty**: `string` | ||
|
||
*** | ||
|
||
### n? | ||
|
||
• `readonly` `optional` **n**: `string` | ||
|
||
*** | ||
|
||
### use? | ||
|
||
• `readonly` `optional` **use**: `string` | ||
|
||
*** | ||
|
||
### x? | ||
|
||
• `readonly` `optional` **x**: `string` | ||
|
||
*** | ||
|
||
### y? | ||
|
||
• `readonly` `optional` **y**: `string` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Interface: JWKS | ||
|
||
[💗 Help the project](https://github.com/sponsors/panva) | ||
|
||
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). | ||
|
||
*** | ||
|
||
## Properties | ||
|
||
### keys | ||
|
||
• `readonly` **keys**: [`JWK`](JWK.md)[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters