Skip to content

Commit b8e10c9

Browse files
committed
Initial framework scaffolding, and implement encryption_key_manager and resource_server using the framework
1 parent dd280c5 commit b8e10c9

File tree

69 files changed

+8228
-7062
lines changed

Some content is hidden

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

69 files changed

+8228
-7062
lines changed

docs/data-sources/clients.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ data "auth0_clients" "first_party_apps" {
3838

3939
### Read-Only
4040

41-
- `clients` (List of Object) List of clients matching the filter criteria. (see [below for nested schema](#nestedatt--clients))
41+
- `clients` (Set of Object) List of clients matching the filter criteria. (see [below for nested schema](#nestedatt--clients))
4242
- `id` (String) The ID of this resource.
4343

4444
<a id="nestedatt--clients"></a>

docs/data-sources/provider.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
page_title: "Data Source: auth0_provider"
3+
description: |-
4+
A data source for retrieving basic information about the provider.
5+
---
6+
7+
# Data Source: auth0_provider
8+
9+
A data source for retrieving basic information about the provider.
10+
11+
12+
13+
<!-- schema generated by tfplugindocs -->
14+
## Schema
15+
16+
### Read-Only
17+
18+
- `provider_version` (String) The version of the provider.
19+
20+

docs/data-sources/resource_server.md

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
page_title: "Data Source: auth0_resource_server"
33
description: |-
4-
Data source to retrieve a specific Auth0 resource server by resource_server_id or identifier.
4+
With this datasource, you can set up APIs that can be consumed from your authorized applications.
55
---
66

77
# Data Source: auth0_resource_server
88

9-
Data source to retrieve a specific Auth0 resource server by `resource_server_id` or `identifier`.
9+
With this datasource, you can set up APIs that can be consumed from your authorized applications.
1010

1111
## Example Usage
1212

@@ -29,71 +29,68 @@ data "auth0_resource_server" "some-resource-server-by-id" {
2929

3030
- `identifier` (String) Unique identifier for the resource server. Used as the audience parameter for authorization calls. If not provided, `resource_server_id` must be set.
3131
- `resource_server_id` (String) The ID of the resource server. If not provided, `identifier` must be set.
32+
- `token_encryption` (Attributes) Configuration for JSON Web Encryption(JWE) of tokens for this resource server. (see [below for nested schema](#nestedatt--token_encryption))
3233

3334
### Read-Only
3435

3536
- `allow_offline_access` (Boolean) Indicates whether refresh tokens can be issued for this resource server.
36-
- `authorization_details` (List of Object) Authorization details for this resource server. (see [below for nested schema](#nestedatt--authorization_details))
37+
- `authorization_details` (Attributes List) Authorization details for this resource server. (see [below for nested schema](#nestedatt--authorization_details))
3738
- `consent_policy` (String) Consent policy for this resource server. Options include `transactional-authorization-with-mfa`, or `null` to disable.
3839
- `enforce_policies` (Boolean) If this setting is enabled, RBAC authorization policies will be enforced for this API. Role and permission assignments will be evaluated during the login transaction.
39-
- `id` (String) The ID of this resource.
40-
- `name` (String) Friendly name for the resource server. Cannot include `<` or `>` characters.
41-
- `proof_of_possession` (List of Object) Configuration settings for proof-of-possession for this resource server. (see [below for nested schema](#nestedatt--proof_of_possession))
42-
- `scopes` (Set of Object) List of permissions (scopes) used by this resource server. (see [below for nested schema](#nestedatt--scopes))
40+
- `name` (String) Friendly name for the resource server.
41+
- `proof_of_possession` (Attributes) Configuration settings for proof-of-possession for this resource server. (see [below for nested schema](#nestedatt--proof_of_possession))
42+
- `scopes` (Attributes Set) List of permissions (scopes) used by this resource server. (see [below for nested schema](#nestedatt--scopes))
4343
- `signing_alg` (String) Algorithm used to sign JWTs. Options include `HS256`, `RS256`, and `PS256`.
4444
- `signing_secret` (String) Secret used to sign tokens when using symmetric algorithms (HS256).
4545
- `skip_consent_for_verifiable_first_party_clients` (Boolean) Indicates whether to skip user consent for applications flagged as first party.
4646
- `token_dialect` (String) Dialect of access tokens that should be issued for this resource server. Options include `access_token`, `rfc9068_profile`, `access_token_authz`, and `rfc9068_profile_authz`. `access_token` is a JWT containing standard Auth0 claims. `rfc9068_profile` is a JWT conforming to the IETF JWT Access Token Profile. `access_token_authz` is a JWT containing standard Auth0 claims, including RBAC permissions claims. `rfc9068_profile_authz` is a JWT conforming to the IETF JWT Access Token Profile, including RBAC permissions claims. RBAC permissions claims are available if RBAC (`enforce_policies`) is enabled for this API. For more details, refer to [Access Token Profiles](https://auth0.com/docs/secure/tokens/access-tokens/access-token-profiles).
47-
- `token_encryption` (List of Object) Configuration for JSON Web Encryption(JWE) of tokens for this resource server. (see [below for nested schema](#nestedatt--token_encryption))
4847
- `token_lifetime` (Number) Number of seconds during which access tokens issued for this resource server from the token endpoint remain valid.
4948
- `token_lifetime_for_web` (Number) Number of seconds during which access tokens issued for this resource server via implicit or hybrid flows remain valid. Cannot be greater than the `token_lifetime` value.
5049
- `verification_location` (String) URL from which to retrieve JWKs for this resource server. Used for verifying the JWT sent to Auth0 for token introspection.
5150

52-
<a id="nestedatt--authorization_details"></a>
53-
### Nested Schema for `authorization_details`
51+
<a id="nestedatt--token_encryption"></a>
52+
### Nested Schema for `token_encryption`
5453

5554
Read-Only:
5655

57-
- `disable` (Boolean)
58-
- `type` (String)
59-
56+
- `encryption_key` (Attributes) Authorization details for this resource server. (see [below for nested schema](#nestedatt--token_encryption--encryption_key))
57+
- `format` (String) Format of the token encryption. Only `compact-nested-jwe` is supported.
6058

61-
<a id="nestedatt--proof_of_possession"></a>
62-
### Nested Schema for `proof_of_possession`
59+
<a id="nestedatt--token_encryption--encryption_key"></a>
60+
### Nested Schema for `token_encryption.encryption_key`
6361

6462
Read-Only:
6563

66-
- `disable` (Boolean)
67-
- `mechanism` (String)
68-
- `required` (Boolean)
64+
- `algorithm` (String) Algorithm used to encrypt the token.
65+
- `kid` (String) Key ID.
66+
- `name` (String) Name of the encryption key.
67+
- `pem` (String) PEM-formatted public key. Must be JSON escaped.
6968

7069

71-
<a id="nestedatt--scopes"></a>
72-
### Nested Schema for `scopes`
70+
71+
<a id="nestedatt--authorization_details"></a>
72+
### Nested Schema for `authorization_details`
7373

7474
Read-Only:
7575

76-
- `description` (String)
77-
- `name` (String)
76+
- `type` (String) Type of authorization details.
7877

7978

80-
<a id="nestedatt--token_encryption"></a>
81-
### Nested Schema for `token_encryption`
79+
<a id="nestedatt--proof_of_possession"></a>
80+
### Nested Schema for `proof_of_possession`
8281

8382
Read-Only:
8483

85-
- `disable` (Boolean)
86-
- `encryption_key` (List of Object) (see [below for nested schema](#nestedobjatt--token_encryption--encryption_key))
87-
- `format` (String)
84+
- `mechanism` (String) Mechanism used for proof-of-possession. Only `mtls` is supported.
85+
- `required` (Boolean) Indicates whether proof-of-possession is required with this resource server.
8886

89-
<a id="nestedobjatt--token_encryption--encryption_key"></a>
90-
### Nested Schema for `token_encryption.encryption_key`
87+
88+
<a id="nestedatt--scopes"></a>
89+
### Nested Schema for `scopes`
9190

9291
Read-Only:
9392

94-
- `algorithm` (String)
95-
- `kid` (String)
96-
- `name` (String)
97-
- `pem` (String)
93+
- `description` (String) Description of the permission (scope).
94+
- `name` (String) Name of the permission (scope). Examples include `read:appointments` or `delete:appointments`.
9895

9996

docs/resources/encryption_key_manager.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
page_title: "Resource: auth0_encryption_key_manager"
33
description: |-
4-
Resource to allow the rekeying of your tenant master key.
4+
A resource for managing the tenant root key.
55
---
66

77
# Resource: auth0_encryption_key_manager
88

9-
Resource to allow the rekeying of your tenant master key.
9+
A resource for managing the tenant root key.
1010

1111
## Example Usage
1212

@@ -50,13 +50,12 @@ resource "auth0_encryption_key_manager" "my_key_manager" {
5050

5151
### Optional
5252

53-
- `customer_provided_root_key` (Block List, Max: 1) This attribute is used for provisioning the customer provided root key. To initiate the provisioning process, create a new empty `customer_provided_root_key` block. After applying this, the `public_wrapping_key` can be retreived from the resource, and the new root key should be generated by the customer and wrapped with the wrapping key, then base64-encoded and added as the `wrapped_key` attribute. (see [below for nested schema](#nestedblock--customer_provided_root_key))
53+
- `customer_provided_root_key` (Block, Optional) This attribute is used for provisioning the customer provided root key. To initiate the provisioning process, create a new empty `customer_provided_root_key` block. After applying this, the `public_wrapping_key` can be retreived from the resource, and the new root key should be generated by the customer and wrapped with the wrapping key, then base64-encoded and added as the `wrapped_key` attribute. (see [below for nested schema](#nestedblock--customer_provided_root_key))
5454
- `key_rotation_id` (String) If this value is changed, the encryption keys will be rotated. A UUID is recommended for the `key_rotation_id`.
5555

5656
### Read-Only
5757

58-
- `encryption_keys` (List of Object) All encryption keys. (see [below for nested schema](#nestedatt--encryption_keys))
59-
- `id` (String) The ID of this resource.
58+
- `encryption_keys` (Attributes List) All encryption keys. (see [below for nested schema](#nestedatt--encryption_keys))
6059

6160
<a id="nestedblock--customer_provided_root_key"></a>
6261
### Nested Schema for `customer_provided_root_key`
@@ -82,11 +81,11 @@ Read-Only:
8281

8382
Read-Only:
8483

85-
- `created_at` (String)
86-
- `key_id` (String)
87-
- `parent_key_id` (String)
88-
- `state` (String)
89-
- `type` (String)
90-
- `updated_at` (String)
84+
- `created_at` (String) The ISO 8601 formatted date the customer provided root key was created.
85+
- `key_id` (String) The key ID of the customer provided root key.
86+
- `parent_key_id` (String) The key ID of the parent wrapping key.
87+
- `state` (String) The state of the encryption key. One of `pre-activation`, `active`, `deactivated`, or `destroyed`.
88+
- `type` (String) The type of the encryption key. One of `customer-provided-root-key`, `environment-root-key`, or `tenant-master-key`.
89+
- `updated_at` (String) The ISO 8601 formatted date the customer provided root key was updated.
9190

9291

docs/resources/resource_server.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,64 +55,58 @@ EOF
5555
### Optional
5656

5757
- `allow_offline_access` (Boolean) Indicates whether refresh tokens can be issued for this resource server.
58-
- `authorization_details` (Block List) Authorization details for this resource server. (see [below for nested schema](#nestedblock--authorization_details))
58+
- `authorization_details` (Attributes List) Authorization details for this resource server. (see [below for nested schema](#nestedatt--authorization_details))
5959
- `consent_policy` (String) Consent policy for this resource server. Options include `transactional-authorization-with-mfa`, or `null` to disable.
6060
- `enforce_policies` (Boolean) If this setting is enabled, RBAC authorization policies will be enforced for this API. Role and permission assignments will be evaluated during the login transaction.
6161
- `name` (String) Friendly name for the resource server. Cannot include `<` or `>` characters.
62-
- `proof_of_possession` (Block List, Max: 1) Configuration settings for proof-of-possession for this resource server. (see [below for nested schema](#nestedblock--proof_of_possession))
62+
- `proof_of_possession` (Attributes) Configuration settings for proof-of-possession for this resource server. (see [below for nested schema](#nestedatt--proof_of_possession))
6363
- `signing_alg` (String) Algorithm used to sign JWTs. Options include `HS256`, `RS256`, and `PS256`.
6464
- `signing_secret` (String) Secret used to sign tokens when using symmetric algorithms (HS256).
6565
- `skip_consent_for_verifiable_first_party_clients` (Boolean) Indicates whether to skip user consent for applications flagged as first party.
6666
- `token_dialect` (String) Dialect of access tokens that should be issued for this resource server. Options include `access_token`, `rfc9068_profile`, `access_token_authz`, and `rfc9068_profile_authz`. `access_token` is a JWT containing standard Auth0 claims. `rfc9068_profile` is a JWT conforming to the IETF JWT Access Token Profile. `access_token_authz` is a JWT containing standard Auth0 claims, including RBAC permissions claims. `rfc9068_profile_authz` is a JWT conforming to the IETF JWT Access Token Profile, including RBAC permissions claims. RBAC permissions claims are available if RBAC (`enforce_policies`) is enabled for this API. For more details, refer to [Access Token Profiles](https://auth0.com/docs/secure/tokens/access-tokens/access-token-profiles).
67-
- `token_encryption` (Block List, Max: 1) Configuration for JSON Web Encryption(JWE) of tokens for this resource server. (see [below for nested schema](#nestedblock--token_encryption))
67+
- `token_encryption` (Attributes) Configuration for JSON Web Encryption(JWE) of tokens for this resource server. (see [below for nested schema](#nestedatt--token_encryption))
6868
- `token_lifetime` (Number) Number of seconds during which access tokens issued for this resource server from the token endpoint remain valid.
6969
- `token_lifetime_for_web` (Number) Number of seconds during which access tokens issued for this resource server via implicit or hybrid flows remain valid. Cannot be greater than the `token_lifetime` value.
7070
- `verification_location` (String) URL from which to retrieve JWKs for this resource server. Used for verifying the JWT sent to Auth0 for token introspection.
7171

7272
### Read-Only
7373

74-
- `id` (String) The ID of this resource.
74+
- `resource_server_id` (String) A generated string identifying the resource server.
7575

76-
<a id="nestedblock--authorization_details"></a>
76+
<a id="nestedatt--authorization_details"></a>
7777
### Nested Schema for `authorization_details`
7878

79-
Optional:
79+
Required:
8080

81-
- `disable` (Boolean) Disable authorization details.
8281
- `type` (String) Type of authorization details.
8382

8483

85-
<a id="nestedblock--proof_of_possession"></a>
84+
<a id="nestedatt--proof_of_possession"></a>
8685
### Nested Schema for `proof_of_possession`
8786

8887
Optional:
8988

90-
- `disable` (Boolean) Disable proof-of-possession.
9189
- `mechanism` (String) Mechanism used for proof-of-possession. Only `mtls` is supported.
9290
- `required` (Boolean) Indicates whether proof-of-possession is required with this resource server.
9391

9492

95-
<a id="nestedblock--token_encryption"></a>
93+
<a id="nestedatt--token_encryption"></a>
9694
### Nested Schema for `token_encryption`
9795

9896
Optional:
9997

100-
- `disable` (Boolean) Disable token encryption.
101-
- `encryption_key` (Block List, Max: 1) Authorization details for this resource server. (see [below for nested schema](#nestedblock--token_encryption--encryption_key))
98+
- `encryption_key` (Attributes) Authorization details for this resource server. (see [below for nested schema](#nestedatt--token_encryption--encryption_key))
10299
- `format` (String) Format of the token encryption. Only `compact-nested-jwe` is supported.
103100

104-
<a id="nestedblock--token_encryption--encryption_key"></a>
101+
<a id="nestedatt--token_encryption--encryption_key"></a>
105102
### Nested Schema for `token_encryption.encryption_key`
106103

107-
Required:
108-
109-
- `algorithm` (String) Algorithm used to encrypt the token.
110-
- `pem` (String) PEM-formatted public key. Must be JSON escaped.
111-
112104
Optional:
113105

106+
- `algorithm` (String) Algorithm used to encrypt the token.
114107
- `kid` (String) Key ID.
115108
- `name` (String) Name of the encryption key.
109+
- `pem` (String) PEM-formatted public key. Must be JSON escaped.
116110

117111
## Import
118112

docs/resources/resource_server_scope.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ resource "auth0_resource_server_scope" "write_posts" {
5050

5151
- `description` (String) Description of the scope (permission).
5252

53-
### Read-Only
54-
55-
- `id` (String) The ID of this resource.
56-
5753
## Import
5854

5955
Import is supported using the following syntax:

docs/resources/resource_server_scopes.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ resource "auth0_resource_server_scopes" "my_api_scopes" {
4949
### Required
5050

5151
- `resource_server_identifier` (String) Identifier of the resource server that the scopes (permission) are associated with.
52-
- `scopes` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--scopes))
5352

54-
### Read-Only
53+
### Optional
5554

56-
- `id` (String) The ID of this resource.
55+
- `scopes` (Block Set) List of the scopes associated with a resource server. (see [below for nested schema](#nestedblock--scopes))
5756

5857
<a id="nestedblock--scopes"></a>
5958
### Nested Schema for `scopes`

go.mod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ require (
1111
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
1212
github.com/hashicorp/go-multierror v1.1.1
1313
github.com/hashicorp/terraform-plugin-docs v0.19.4
14+
github.com/hashicorp/terraform-plugin-framework v1.13.0
15+
github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0
16+
github.com/hashicorp/terraform-plugin-framework-validators v0.15.0
17+
github.com/hashicorp/terraform-plugin-go v0.25.0
18+
github.com/hashicorp/terraform-plugin-mux v0.16.0
1419
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0
1520
github.com/hashicorp/terraform-plugin-testing v1.11.0
1621
github.com/stretchr/testify v1.10.0
@@ -48,7 +53,6 @@ require (
4853
github.com/hashicorp/logutils v1.0.0 // indirect
4954
github.com/hashicorp/terraform-exec v0.21.0 // indirect
5055
github.com/hashicorp/terraform-json v0.23.0 // indirect
51-
github.com/hashicorp/terraform-plugin-go v0.25.0 // indirect
5256
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
5357
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
5458
github.com/hashicorp/terraform-svchost v0.1.1 // indirect

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,18 @@ github.com/hashicorp/terraform-json v0.23.0 h1:sniCkExU4iKtTADReHzACkk8fnpQXrdD2
111111
github.com/hashicorp/terraform-json v0.23.0/go.mod h1:MHdXbBAbSg0GvzuWazEGKAn/cyNfIB7mN6y7KJN6y2c=
112112
github.com/hashicorp/terraform-plugin-docs v0.19.4 h1:G3Bgo7J22OMtegIgn8Cd/CaSeyEljqjH3G39w28JK4c=
113113
github.com/hashicorp/terraform-plugin-docs v0.19.4/go.mod h1:4pLASsatTmRynVzsjEhbXZ6s7xBlUw/2Kt0zfrq8HxA=
114+
github.com/hashicorp/terraform-plugin-framework v1.13.0 h1:8OTG4+oZUfKgnfTdPTJwZ532Bh2BobF4H+yBiYJ/scw=
115+
github.com/hashicorp/terraform-plugin-framework v1.13.0/go.mod h1:j64rwMGpgM3NYXTKuxrCnyubQb/4VKldEKlcG8cvmjU=
116+
github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0 h1:v3DapR8gsp3EM8fKMh6up9cJUFQ2iRaFsYLP8UJnCco=
117+
github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0/go.mod h1:c3PnGE9pHBDfdEVG9t1S1C9ia5LW+gkFR0CygXlM8ak=
118+
github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 h1:RXMmu7JgpFjnI1a5QjMCBb11usrW2OtAG+iOTIj5c9Y=
119+
github.com/hashicorp/terraform-plugin-framework-validators v0.15.0/go.mod h1:Bh89/hNmqsEWug4/XWKYBwtnw3tbz5BAy1L1OgvbIaY=
114120
github.com/hashicorp/terraform-plugin-go v0.25.0 h1:oi13cx7xXA6QciMcpcFi/rwA974rdTxjqEhXJjbAyks=
115121
github.com/hashicorp/terraform-plugin-go v0.25.0/go.mod h1:+SYagMYadJP86Kvn+TGeV+ofr/R3g4/If0O5sO96MVw=
116122
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
117123
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
124+
github.com/hashicorp/terraform-plugin-mux v0.16.0 h1:RCzXHGDYwUwwqfYYWJKBFaS3fQsWn/ZECEiW7p2023I=
125+
github.com/hashicorp/terraform-plugin-mux v0.16.0/go.mod h1:PF79mAsPc8CpusXPfEVa4X8PtkB+ngWoiUClMrNZlYo=
118126
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 h1:wyKCCtn6pBBL46c1uIIBNUOWlNfYXfXpVo16iDyLp8Y=
119127
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0/go.mod h1:B0Al8NyYVr8Mp/KLwssKXG1RqnTk7FySqSn4fRuLNgw=
120128
github.com/hashicorp/terraform-plugin-testing v1.11.0 h1:MeDT5W3YHbONJt2aPQyaBsgQeAIckwPX41EUHXEn29A=

0 commit comments

Comments
 (0)