Skip to content

Commit 2c1e779

Browse files
authored
Merge pull request #48 from ory/feat/new-resources-datasources
feat: add new resources, data sources, docs, and CI improvements
2 parents 3c4fe9c + 7c2a092 commit 2c1e779

File tree

104 files changed

+4587
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+4587
-177
lines changed

.github/workflows/acceptance-test.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Acceptance Tests
22

33
on:
4-
push:
5-
branches: [main]
64
pull_request:
75
branches: [main]
86
workflow_dispatch:
@@ -37,11 +35,16 @@ on:
3735
required: false
3836
default: false
3937
type: boolean
38+
enable_event_stream_tests:
39+
description: 'Event stream tests (requires Enterprise plan)'
40+
required: false
41+
default: false
42+
type: boolean
4043

4144
concurrency:
4245
group: acceptance-tests
4346
cancel-in-progress: false
44-
47+
4548
permissions:
4649
contents: read
4750
pull-requests: read
@@ -94,9 +97,10 @@ jobs:
9497

9598
- name: Run Acceptance Tests
9699
env:
97-
ORY_KETO_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_keto_tests == 'true' }}
98-
ORY_B2B_ENABLED: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_b2b_tests == 'true' }}
99-
ORY_SOCIAL_PROVIDER_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_social_provider_tests == 'true' }}
100-
ORY_SCHEMA_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_schema_tests == 'true' }}
101-
ORY_PROJECT_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_project_tests == 'true' }}
100+
ORY_KETO_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_keto_tests == 'true' }}
101+
ORY_B2B_ENABLED: ${{ github.event_name == 'pull_request' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_b2b_tests == 'true' }}
102+
ORY_SOCIAL_PROVIDER_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_social_provider_tests == 'true' }}
103+
ORY_SCHEMA_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_schema_tests == 'true' }}
104+
ORY_PROJECT_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_project_tests == 'true' }}
105+
ORY_EVENT_STREAM_TESTS_ENABLED: ${{ github.event.inputs.enable_event_stream_tests == 'true' }}
102106
run: ./scripts/run-acceptance-tests.sh -v -timeout 20m ./...

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
ORY_SOCIAL_PROVIDER_TESTS_ENABLED: true
3838
ORY_SCHEMA_TESTS_ENABLED: true
3939
ORY_PROJECT_TESTS_ENABLED: true
40+
ORY_EVENT_STREAM_TESTS_ENABLED: true
4041
run: ./scripts/run-acceptance-tests.sh -v -timeout 20m ./...
4142

4243
goreleaser:

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ test-acc-all: env-check ## Run all acceptance tests including optional ones
152152
ORY_B2B_ENABLED=true \
153153
ORY_SOCIAL_PROVIDER_TESTS_ENABLED=true \
154154
ORY_SCHEMA_TESTS_ENABLED=true \
155+
ORY_EVENT_STREAM_TESTS_ENABLED=true \
155156
./scripts/run-acceptance-tests.sh -p 1 -v -timeout 30m ./...
156157

157158
# ==============================================================================
@@ -224,3 +225,4 @@ env-check: ## Check required environment variables
224225
@if [ "$$ORY_SOCIAL_PROVIDER_TESTS_ENABLED" = "true" ]; then echo " ORY_SOCIAL_PROVIDER_TESTS_ENABLED: true"; else echo " ORY_SOCIAL_PROVIDER_TESTS_ENABLED: (not set)"; fi
225226
@if [ "$$ORY_SCHEMA_TESTS_ENABLED" = "true" ]; then echo " ORY_SCHEMA_TESTS_ENABLED: true"; else echo " ORY_SCHEMA_TESTS_ENABLED: (not set - schema tests will be skipped)"; fi
226227
@if [ "$$ORY_PROJECT_TESTS_ENABLED" = "true" ]; then echo " ORY_PROJECT_TESTS_ENABLED: true"; else echo " ORY_PROJECT_TESTS_ENABLED: (not set - project resource tests will be skipped)"; fi
228+
@if [ "$$ORY_EVENT_STREAM_TESTS_ENABLED" = "true" ]; then echo " ORY_EVENT_STREAM_TESTS_ENABLED: true"; else echo " ORY_EVENT_STREAM_TESTS_ENABLED: (not set - event stream tests will be skipped, requires Enterprise plan)"; fi

README.md

Lines changed: 69 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ A Terraform provider for managing [Ory Network](https://www.ory.sh/) resources u
2121
- **Project Configuration**: CORS, session settings, password policies, MFA
2222
- **Webhooks/Actions**: Trigger webhooks on identity flow events
2323
- **Email Templates**: Customize verification, recovery, and login code emails
24-
- **OAuth2 Clients**: Manage OAuth2/OIDC client applications
24+
- **OAuth2 Clients**: Manage OAuth2/OIDC client applications and dynamic client registration (RFC 7591)
25+
- **JWT Grant Trust**: Trust external identity providers for RFC 7523 JWT Bearer grants
26+
- **Event Streams**: Publish Ory events to external systems like AWS SNS (Enterprise)
2527
- **Organizations**: Multi-tenancy support for B2B applications
2628
- **Permissions (Keto)**: Manage relationship tuples for fine-grained authorization
29+
- **API Key Management**: Manage project API keys
2730

2831
## Requirements
2932

@@ -135,27 +138,35 @@ resource "ory_action" "welcome_email" {
135138

136139
## Resources
137140

138-
| Resource | Description |
139-
| ------------------------------------------------------------ | ------------------------------------ |
140-
| [`ory_project`](docs/resources/project.md) | Ory Network projects |
141-
| [`ory_workspace`](docs/resources/workspace.md) | Ory workspaces |
142-
| [`ory_organization`](docs/resources/organization.md) | Organizations for multi-tenancy |
143-
| [`ory_identity`](docs/resources/identity.md) | User identities |
144-
| [`ory_identity_schema`](docs/resources/identity_schema.md) | Custom identity schemas |
145-
| [`ory_oauth2_client`](docs/resources/oauth2_client.md) | OAuth2/OIDC client applications |
146-
| [`ory_project_config`](docs/resources/project_config.md) | Project configuration settings |
147-
| [`ory_action`](docs/resources/action.md) | Webhooks for identity flows |
148-
| [`ory_social_provider`](docs/resources/social_provider.md) | Social sign-in providers |
149-
| [`ory_email_template`](docs/resources/email_template.md) | Email template customization |
150-
| [`ory_project_api_key`](docs/resources/project_api_key.md) | Project API keys |
151-
| [`ory_json_web_key_set`](docs/resources/json_web_key_set.md) | JSON Web Key Sets for signing |
152-
| [`ory_relationship`](docs/resources/relationship.md) | Ory Permissions (Keto) relationships |
141+
| Resource | Description | Plan Requirement |
142+
| ----------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------- |
143+
| [`ory_project`](docs/resources/project.md) | Ory Network projects | All plans |
144+
| [`ory_workspace`](docs/resources/workspace.md) | Ory workspaces (import-only) | All plans |
145+
| [`ory_organization`](docs/resources/organization.md) | Organizations for multi-tenancy | Growth+ (B2B) |
146+
| [`ory_identity`](docs/resources/identity.md) | User identities | All plans |
147+
| [`ory_identity_schema`](docs/resources/identity_schema.md) | Custom identity schemas | All plans |
148+
| [`ory_oauth2_client`](docs/resources/oauth2_client.md) | OAuth2/OIDC client applications | All plans |
149+
| [`ory_oidc_dynamic_client`](docs/resources/oidc_dynamic_client.md) | RFC 7591 dynamic OIDC client registration | All plans |
150+
| [`ory_project_config`](docs/resources/project_config.md) | Project configuration settings | All plans |
151+
| [`ory_action`](docs/resources/action.md) | Webhooks for identity flows | All plans |
152+
| [`ory_social_provider`](docs/resources/social_provider.md) | Social sign-in providers | All plans |
153+
| [`ory_email_template`](docs/resources/email_template.md) | Email template customization | All plans |
154+
| [`ory_project_api_key`](docs/resources/project_api_key.md) | Project API keys | All plans |
155+
| [`ory_json_web_key_set`](docs/resources/json_web_key_set.md) | JSON Web Key Sets for signing | All plans |
156+
| [`ory_relationship`](docs/resources/relationship.md) | Ory Permissions (Keto) relationships | All plans |
157+
| [`ory_event_stream`](docs/resources/event_stream.md) | Event streams (e.g., AWS SNS) | Enterprise |
158+
| [`ory_trusted_oauth2_jwt_grant_issuer`](docs/resources/trusted_oauth2_jwt_grant_issuer.md) | RFC 7523 JWT grant trust relationships | All plans |
153159

154160
## Data Sources
155161

156-
| Data Source | Description |
157-
| --------------------------------------------- | ------------------------ |
158-
| [`ory_project`](docs/data-sources/project.md) | Read project information |
162+
| Data Source | Description | Plan Requirement |
163+
| ------------------------------------------------------------------ | ------------------------------ | -------------------- |
164+
| [`ory_project`](docs/data-sources/project.md) | Read project information | All plans |
165+
| [`ory_workspace`](docs/data-sources/workspace.md) | Read workspace information | All plans |
166+
| [`ory_identity`](docs/data-sources/identity.md) | Read identity details | All plans |
167+
| [`ory_oauth2_client`](docs/data-sources/oauth2_client.md) | Read OAuth2 client details | All plans |
168+
| [`ory_organization`](docs/data-sources/organization.md) | Read organization details | Growth+ (B2B) |
169+
| [`ory_identity_schemas`](docs/data-sources/identity_schemas.md) | List project identity schemas | All plans |
159170

160171
## Examples
161172

@@ -272,15 +283,18 @@ resource "ory_email_template" "recovery" {
272283

273284
## Known Limitations
274285

275-
| Resource | Limitation |
276-
| --------------------- | ----------------------------------------------------------------------------------- |
277-
| `ory_organization` | Requires B2B features AND project environment must be `prod` or `stage` (not `dev`) |
278-
| `ory_identity_schema` | Immutable - content cannot be updated after creation |
279-
| `ory_identity_schema` | Delete not supported by Ory API (resource removed from state only) |
280-
| `ory_workspace` | Delete not supported by Ory API |
281-
| `ory_oauth2_client` | `client_secret` only returned on create |
282-
| `ory_email_template` | Delete resets to Ory defaults |
283-
| `ory_relationship` | Requires Ory Permissions (Keto) to be enabled |
286+
| Resource | Limitation |
287+
| --------------------------------------- | ----------------------------------------------------------------------------------- |
288+
| `ory_organization` | Requires B2B features AND project environment must be `prod` or `stage` (not `dev`) |
289+
| `ory_identity_schema` | Immutable - content cannot be updated after creation |
290+
| `ory_identity_schema` | Delete not supported by Ory API (resource removed from state only) |
291+
| `ory_workspace` | Import-only; create/delete not supported by Ory API |
292+
| `ory_oauth2_client` | `client_secret` only returned on create |
293+
| `ory_oidc_dynamic_client` | `client_secret`, `registration_access_token`, `registration_client_uri` only returned on create |
294+
| `ory_email_template` | Delete resets to Ory defaults |
295+
| `ory_relationship` | Requires Ory Permissions (Keto) to be enabled |
296+
| `ory_event_stream` | Requires Enterprise plan; authenticates with workspace API key |
297+
| `ory_trusted_oauth2_jwt_grant_issuer` | Create and delete only; any changes require resource recreation |
284298

285299
## Development
286300

@@ -347,20 +361,24 @@ Some tests require additional feature flags or specific Ory plan features:
347361
| `ORY_SOCIAL_PROVIDER_TESTS_ENABLED=true` | Run social provider tests | Skipped |
348362
| `ORY_SCHEMA_TESTS_ENABLED=true` | Run IdentitySchema tests (schemas can't be deleted) | Skipped |
349363
| `ORY_PROJECT_TESTS_ENABLED=true` | Run Project create/delete tests | Skipped |
364+
| `ORY_EVENT_STREAM_TESTS_ENABLED=true` | Run Event Stream tests (requires Enterprise plan) | Skipped |
350365

351366
#### Test Coverage by Plan
352367

353-
| Test Suite | Free Plan | Growth Plan | Enterprise |
354-
| ------------------- | --------- | ----------- | ---------- |
355-
| Identity ||||
356-
| OAuth2 Client ||||
357-
| Project Config ||||
358-
| Action (webhooks) ||||
359-
| Email Template ||||
360-
| Social Provider ||||
361-
| JWK ||||
362-
| Organization ||\* ||
363-
| Relationship (Keto) ||||
368+
| Test Suite | Free Plan | Growth Plan | Enterprise |
369+
| ------------------------------- | --------- | ----------- | ---------- |
370+
| Identity ||||
371+
| OAuth2 Client ||||
372+
| OIDC Dynamic Client ||||
373+
| Project Config ||||
374+
| Action (webhooks) ||||
375+
| Email Template ||||
376+
| Social Provider ||||
377+
| JWK ||||
378+
| Trusted JWT Grant Issuer ||||
379+
| Organization ||\* ||
380+
| Relationship (Keto) ||||
381+
| Event Stream ||||
364382

365383
\*Organizations require B2B features to be enabled on your plan.
366384

@@ -381,12 +399,21 @@ Templates use Go template syntax with these variables:
381399

382400
```
383401
templates/
384-
├── index.md.tmpl # Provider-level docs
402+
├── index.md.tmpl # Provider-level docs
385403
├── resources/
386-
│ ├── oauth2_client.md.tmpl # Each resource has a template
404+
│ ├── oauth2_client.md.tmpl # Each resource has a template
405+
│ ├── oidc_dynamic_client.md.tmpl
406+
│ ├── event_stream.md.tmpl
407+
│ ├── trusted_oauth2_jwt_grant_issuer.md.tmpl
387408
│ └── ...
388409
└── data-sources/
389-
└── project.md.tmpl # Data source template
410+
├── project.md.tmpl # Data source templates
411+
├── workspace.md.tmpl
412+
├── identity.md.tmpl
413+
├── oauth2_client.md.tmpl
414+
├── organization.md.tmpl
415+
├── identity_schemas.md.tmpl
416+
└── ...
390417
```
391418

392419
## Contributing

docs/data-sources/identity.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
page_title: "ory_identity Data Source - ory"
3+
subcategory: ""
4+
description: |-
5+
Fetches information about an Ory identity.
6+
---
7+
8+
# ory_identity (Data Source)
9+
10+
Fetches information about an Ory identity.
11+
12+
This data source retrieves details about a specific identity including its traits, metadata, schema, and state.
13+
14+
The `traits` and `metadata_public` attributes are returned as JSON strings.
15+
16+
-> **Plan:** Available on all Ory Network plans.
17+
18+
## Example Usage
19+
20+
```terraform
21+
# Look up an identity by ID
22+
data "ory_identity" "user" {
23+
id = "identity-uuid"
24+
}
25+
26+
output "identity_state" {
27+
value = data.ory_identity.user.state
28+
}
29+
30+
output "identity_traits" {
31+
value = data.ory_identity.user.traits
32+
}
33+
```
34+
35+
<!-- schema generated by tfplugindocs -->
36+
## Schema
37+
38+
### Required
39+
40+
- `id` (String) The identity ID to look up.
41+
42+
### Read-Only
43+
44+
- `created_at` (String) Timestamp when the identity was created.
45+
- `metadata_public` (String) Public metadata as a JSON string.
46+
- `schema_id` (String) The identity schema ID.
47+
- `schema_url` (String) The URL of the identity schema.
48+
- `state` (String) The identity state (active or inactive).
49+
- `traits` (String) Identity traits as a JSON string.
50+
- `updated_at` (String) Timestamp when the identity was last updated.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
page_title: "ory_identity_schemas Data Source - ory"
3+
subcategory: ""
4+
description: |-
5+
Fetches the list of identity schemas for the project.
6+
---
7+
8+
# ory_identity_schemas (Data Source)
9+
10+
Fetches the list of identity schemas for the project.
11+
12+
This data source retrieves all identity schemas configured for the current project. Each schema includes its ID and the full JSON schema content.
13+
14+
-> **Plan:** Available on all Ory Network plans.
15+
16+
## Example Usage
17+
18+
```terraform
19+
# List all identity schemas
20+
data "ory_identity_schemas" "all" {}
21+
22+
output "schemas" {
23+
value = data.ory_identity_schemas.all.schemas
24+
}
25+
```
26+
27+
<!-- schema generated by tfplugindocs -->
28+
## Schema
29+
30+
### Read-Only
31+
32+
- `schemas` (List of Object) List of identity schemas. Each schema has an `id` and a `schema` (JSON string of the schema content). (see [below for nested schema](#nestedatt--schemas))
33+
34+
<a id="nestedatt--schemas"></a>
35+
### Nested Schema for `schemas`
36+
37+
Read-Only:
38+
39+
- `id` (String)
40+
- `schema` (String)

0 commit comments

Comments
 (0)