Skip to content

Commit 9056c61

Browse files
George Ciltarugciltaru
authored andcommitted
Add jwt secret documentation
1 parent 98076c0 commit 9056c61

File tree

8 files changed

+2996
-2728
lines changed

8 files changed

+2996
-2728
lines changed

_plugins/docs.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ def form(form_name)
9999
def scenario(scenario_name, endpoint)
100100
method = endpoint&.fetch('methods')&.first
101101

102-
scenario_select_by_endpoint_method(endpoint, method) ||
103-
scenario_select_by_name(scenario_name)
102+
scenario_select_by_name(scenario_name) ||
103+
scenario_select_by_endpoint_method(endpoint, method)
104+
104105
end
105106

106107
def scenario_select_by_endpoint_method(endpoint, method)

api/guides/secrets.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Secrets
44

55
# Exchanging Secret credentials
66

7-
There are 4 types of secrets, `oauth2-client_credentials`, `oauth2-google`, `simple-http`, and `token`. The `credentials` object for each type has different required attributes.
7+
There are 5 types of secrets, `oauth2-client_credentials`, `oauth2-jwt`, `oauth2-google`, `simple-http`, and `token`. The `credentials` object for each type has different required attributes.
88

99
## `oauth2-client_credentials` credentials
1010

@@ -32,6 +32,33 @@ If the exchange is successful, the `Secret` status attribute is set to `succeeed
3232

3333
In case of failure, the information is available in the `status_details` attribute from the `meta` object.
3434

35+
## `oauth2-jwt` credentials
36+
37+
### Credential attributes
38+
- `iss` - Text - Required - The JWT issuer.
39+
- `aud` - Text - Required - The JWT audience.
40+
- `sub` - Text - Optional - The JWT subject.
41+
- `ttl` - Integer - Required - The JWT ttl. The `exp` claim is computed using this value.
42+
- `alg` - Text - Required - The algorithm used to sign the JWT. Currently, only `RS256` is supported.
43+
- `custom_claims` - Object - Optional - Key/Value pairs of JWT custom claims.
44+
- `token_url` - Text - Optional - The token url of the oauth2 integration. If this value is not included, the JWT will ve used as `access_token`.
45+
- `private_key_id` - Text - Optional - The private key id. This value will be added to the `kid` JWT header.
46+
- `private_key` - Text - Required - The private key used to sign to JWT.
47+
- `refresh_offset` - Integer - Optional - The value, in seconds, used to offset the refresh operation. If not set, an implicit `1800` (30 minutes) will be used.
48+
- `options` - Object - Optional - Key/Value pairs of options for the oauth2 integration.
49+
50+
When an `oauth2-jwt` Secret is created or updated, a JWT is created and signed using the private_key. If `token_url` is present, a `POST` is made to the `token_url` with the assertion parameter and JWT value (and possibly options), according to the `rfc7523` standard.
51+
If the authorization service responds with `200 OK` and a JSON response body, the body is parsed and `access_token` and `expires_in` are used.
52+
It is expected that the authorization service response body is compatible with the `oauth2` protocol.
53+
54+
If `token_url` is not present, the generated JWT is used as `access_token` and the `ttl` as `expires_in`.
55+
56+
If the exchange is successful, the `Secret` status attribute is set to `succeeeded` and `expires_at` and `refresh_at` are set.
57+
- `expires_at` is the current UTC time + `expires_in`.
58+
- `refresh_at` is the current UTC time + `expires_in` - `refresh_offset`
59+
60+
In case of failure, the information is available in the `status_details` attribute from the `meta` object.
61+
3562
## `oauth2-google` credentials
3663

3764
### Credential attributes

api/reference/1.0/extension_packages/discontinue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Discontinue an ExtensionPackage.
1212

1313
{% form extension_package.patch %}
1414

15-
{% scenario extension_packages.update extension_packages.discontinue_an_extension_package 1 %}
15+
{% scenario extension_packages.update extension_packages.discontinue_an_extension_package %}

api/reference/1.0/secrets/_oauth2-client_credentials.html

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)