You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add project_id support to ory_json_web_key_set resource
The JWK resource previously required project_slug and project_api_key
on the provider, with no way to specify project_id at the resource
level. This made it impossible to use with project_id-based workflows.
Changes:
- Add optional project_id attribute to ory_json_web_key_set (falls back
to provider's project_id when not set)
- Add ResolveProjectSlug and ProjectClientForProject methods to the
client for resolving project_id to slug via the console API
- Cache resolved slugs to avoid redundant API calls within a run
- Validate that project_id is set before CRUD operations
- Support composite import format: project_id/set_id
- Update acceptance tests, examples, and documentation
Copy file name to clipboardExpand all lines: docs/resources/json_web_key_set.md
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ JSON Web Keys are used for signing and encrypting tokens. This resource generate
13
13
14
14
-> **Plan:** Available on all Ory Network plans.
15
15
16
-
~> **Note:** This resource is **immutable**. Any change to `set_id`, `key_id`, `algorithm`, or `use` will destroy the existing key set and create a new one. Private keys in the old set will be permanently lost.
16
+
~> **Note:** This resource is **immutable**. Any change to `project_id`, `set_id`, `key_id`, `algorithm`, or `use` will destroy the existing key set and create a new one. Private keys in the old set will be permanently lost.
17
17
18
18
## Algorithms
19
19
@@ -46,20 +46,21 @@ Most configurations only need `use = "sig"`.
46
46
## Example Usage
47
47
48
48
```terraform
49
-
# RSA signing key set
49
+
# RSA signing key set (project_id from provider config)
50
50
resource "ory_json_web_key_set" "signing" {
51
51
set_id = "token-signing-keys"
52
52
key_id = "rsa-sig-1"
53
53
algorithm = "RS256"
54
54
use = "sig"
55
55
}
56
56
57
-
# ECDSA signing key set (smaller, faster)
57
+
# ECDSA signing key set with explicit project_id
58
58
resource "ory_json_web_key_set" "ecdsa_signing" {
59
-
set_id = "ecdsa-signing-keys"
60
-
key_id = "ec-sig-1"
61
-
algorithm = "ES256"
62
-
use = "sig"
59
+
project_id = var.ory_project_id
60
+
set_id = "ecdsa-signing-keys"
61
+
key_id = "ec-sig-1"
62
+
algorithm = "ES256"
63
+
use = "sig"
63
64
}
64
65
65
66
# Encryption key set
@@ -98,9 +99,10 @@ On read, the provider extracts `algorithm`, `use`, and `key_id` from the **first
98
99
99
100
## Import
100
101
101
-
Import using the set ID:
102
+
Import using the format `project_id/set_id` or just `set_id` (uses provider's project_id):
0 commit comments