diff --git a/CHANGELOG.md b/CHANGELOG.md index 9136be1d0..3a1d4f00e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,28 @@ +## 0.50.0 + +FEATURES: + +- `auth0_pages`: Add new resource to manage Auth0 pages (`change_password`, `error`, `guardian_mfa`, `login`) ([#691](https://github.com/auth0/terraform-provider-auth0/pull/691)) + +ENHANCEMENTS: + +- `resource/auth0_client`: Add `post_login_prompt` to available options for the `organization_require_behavior` attribute ([#680](https://github.com/auth0/terraform-provider-auth0/pull/680)) +- `resource/auth0_connection`: Relax `metadata` validation by not requiring key length to be between 0 and 10 characters ([#685](https://github.com/auth0/terraform-provider-auth0/pull/685)) + +BUG FIXES: + +- `resource/auth0_organization_connections`, `resource/auth0_organization_members`: Address a bug causing inconsistencies in the safeguarding process, ensuring reliable protection against erasing unintended modifications ([#645](https://github.com/auth0/terraform-provider-auth0/pull/645)) +- `resource/auth0_organization_members`: Address a bug that prevented the creation of organization members when the member list was empty ([#646](https://github.com/auth0/terraform-provider-auth0/pull/646)) +- `resource/auth0_connection`, `resource/auth0_organization_member`,`resource/auth0_user`: Update diffing algorithm to address a bug where the order of additions and removals was causing incorrect results ([#650](https://github.com/auth0/terraform-provider-auth0/pull/650)) +- `resource/auth0_connection`: Remove invalid connection strategies ([#694](https://github.com/auth0/terraform-provider-auth0/pull/694)) +- `resource/auth0_client`: Modify the behavior to only allow the update of the `is_token_endpoint_ip_header_trusted` setting after the client has been created successfully ([#696](https://github.com/auth0/terraform-provider-auth0/pull/696)) +- `resource/auth0_branding`: Addressed a bug that prevented the deletion of the template when the universal login block was removed ([#695](https://github.com/auth0/terraform-provider-auth0/pull/695)) + +NOTES: + +- :warning: Check our [migration guide](https://github.com/auth0/terraform-provider-auth0/blob/main/MIGRATION_GUIDE.md) to navigate the deprecations that were added in this release. + + ## 0.49.0 FEATURES: diff --git a/docs/resources/action.md b/docs/resources/action.md index f19d9f910..042377294 100644 --- a/docs/resources/action.md +++ b/docs/resources/action.md @@ -67,7 +67,7 @@ resource "auth0_action" "my_action" { - `dependencies` (Block Set) List of third party npm modules, and their versions, that this action depends on. (see [below for nested schema](#nestedblock--dependencies)) - `deploy` (Boolean) Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. -- `runtime` (String) The Node runtime. Defaults to `node12`. Possible values are: `node12`, `node16` or `node18`. +- `runtime` (String) The Node runtime. Defaults to `node12`. Possible values are: `node12`, `node16` or `node18-actions`. - `secrets` (Block List) List of secrets that are included in an action or a version of an action. (see [below for nested schema](#nestedblock--secrets)) ### Read-Only diff --git a/internal/auth0/action/resource.go b/internal/auth0/action/resource.go index 8049bf461..8fe925f47 100644 --- a/internal/auth0/action/resource.go +++ b/internal/auth0/action/resource.go @@ -89,10 +89,11 @@ func NewResource() *schema.Resource { ValidateFunc: validation.StringInSlice([]string{ "node12", "node16", - "node18", + "node18", // Node 18 beta. + "node18-actions", // Node 18 GA. }, false), Description: "The Node runtime. Defaults to `node12`. Possible values are: " + - "`node12`, `node16` or `node18`.", + "`node12`, `node16` or `node18-actions`.", }, "secrets": { Type: schema.TypeList, diff --git a/internal/auth0/action/resource_test.go b/internal/auth0/action/resource_test.go index 842ff2d82..0bec470e2 100644 --- a/internal/auth0/action/resource_test.go +++ b/internal/auth0/action/resource_test.go @@ -186,7 +186,7 @@ func TestAccAction(t *testing.T) { const testAccActionConfigCreateWithFailedBuild = ` resource auth0_action my_action { name = "Test Action {{.testName}}" - runtime = "node18" + runtime = "node18-actions" deploy = true code = <<-EOT exports.onContinuePostLogin = async (event, api) => { diff --git a/test/data/recordings/TestAccAction_FailedBuild.yaml b/test/data/recordings/TestAccAction_FailedBuild.yaml index 3ed4a8856..eb362fa2f 100644 --- a/test/data/recordings/TestAccAction_FailedBuild.yaml +++ b/test/data/recordings/TestAccAction_FailedBuild.yaml @@ -1,182 +1,254 @@ --- version: 2 interactions: - - id: 0 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 278 - transfer_encoding: [ ] - trailer: { } - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: | - {"name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"code":"exports.onContinuePostLogin = async (event, api) =\u003e {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18"} - form: { } - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [ ] - trailer: { } - content_length: -1 - uncompressed: false - body: '{"id":"a0d81042-7ed3-4e78-b647-438ffe45ecfe","name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"created_at":"2022-08-30T08:56:49.272839364Z","updated_at":"2022-08-30T08:56:49.286750680Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18","status":"pending","secrets":[],"all_changes_deployed":false}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 201 Created - code: 201 - duration: 1ms - - id: 1 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 5 - transfer_encoding: [ ] - trailer: { } - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: | - null - form: { } - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/a0d81042-7ed3-4e78-b647-438ffe45ecfe - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [ ] - trailer: { } - content_length: -1 - uncompressed: true - body: '{"id":"a0d81042-7ed3-4e78-b647-438ffe45ecfe","name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"created_at":"2022-08-30T08:56:49.272839364Z","updated_at":"2022-08-30T08:56:49.286750680Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18","status":"building","secrets":[],"all_changes_deployed":false}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 1ms - - id: 2 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 5 - transfer_encoding: [ ] - trailer: { } - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: | - null - form: { } - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/a0d81042-7ed3-4e78-b647-438ffe45ecfe - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [ ] - trailer: { } - content_length: -1 - uncompressed: true - body: '{"id":"a0d81042-7ed3-4e78-b647-438ffe45ecfe","name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"created_at":"2022-08-30T08:56:49.272839364Z","updated_at":"2022-08-30T08:56:49.286750680Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18","status":"building","secrets":[],"all_changes_deployed":false}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 1ms - - id: 3 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 5 - transfer_encoding: [ ] - trailer: { } - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: | - null - form: { } - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/a0d81042-7ed3-4e78-b647-438ffe45ecfe - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [ ] - trailer: { } - content_length: -1 - uncompressed: true - body: '{"id":"a0d81042-7ed3-4e78-b647-438ffe45ecfe","name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"created_at":"2022-08-30T08:56:49.272839364Z","updated_at":"2022-08-30T08:56:49.286750680Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18","status":"failed","secrets":[],"all_changes_deployed":false}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 1ms - - id: 4 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [ ] - trailer: { } - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: { } - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0-SDK/0.10.0 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/a0d81042-7ed3-4e78-b647-438ffe45ecfe - method: DELETE - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [ ] - trailer: { } - content_length: 0 - uncompressed: false - body: "" - headers: - Content-Type: - - application/json; charset=utf-8 - status: 204 No Content - code: 204 - duration: 1ms + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 299 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"code":"exports.onContinuePostLogin = async (event, api) =\u003e {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18-actions","secrets":[]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.17.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 477 + uncompressed: false + body: '{"id":"faa76f9f-4ee0-4411-8a92-43255e49a727","name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"created_at":"2023-07-12T16:37:14.793829402Z","updated_at":"2023-07-12T16:37:14.824637448Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18-actions","status":"pending","secrets":[],"all_changes_deployed":false}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 175.6235ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.17.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/faa76f9f-4ee0-4411-8a92-43255e49a727 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"faa76f9f-4ee0-4411-8a92-43255e49a727","name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"created_at":"2023-07-12T16:37:14.793829402Z","updated_at":"2023-07-12T16:37:14.824637448Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18-actions","status":"building","secrets":[],"all_changes_deployed":false}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 157.227292ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.17.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/faa76f9f-4ee0-4411-8a92-43255e49a727 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"faa76f9f-4ee0-4411-8a92-43255e49a727","name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"created_at":"2023-07-12T16:37:14.793829402Z","updated_at":"2023-07-12T16:37:14.824637448Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18-actions","status":"building","secrets":[],"all_changes_deployed":false}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 120.96425ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.17.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/faa76f9f-4ee0-4411-8a92-43255e49a727 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"faa76f9f-4ee0-4411-8a92-43255e49a727","name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"created_at":"2023-07-12T16:37:14.793829402Z","updated_at":"2023-07-12T16:37:14.824637448Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18-actions","status":"building","secrets":[],"all_changes_deployed":false}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 121.095625ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.17.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/faa76f9f-4ee0-4411-8a92-43255e49a727 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"faa76f9f-4ee0-4411-8a92-43255e49a727","name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"created_at":"2023-07-12T16:37:14.793829402Z","updated_at":"2023-07-12T16:37:14.824637448Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18-actions","status":"building","secrets":[],"all_changes_deployed":false}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 121.073459ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.17.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/faa76f9f-4ee0-4411-8a92-43255e49a727 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"faa76f9f-4ee0-4411-8a92-43255e49a727","name":"Test Action TestAccAction_FailedBuild","supported_triggers":[{"id":"post-login","version":"v3"}],"created_at":"2023-07-12T16:37:14.793829402Z","updated_at":"2023-07-12T16:37:14.824637448Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(event)\n};\"\n","dependencies":[{"name":"crypto","version":"17.7.1"}],"runtime":"node18-actions","status":"failed","secrets":[],"all_changes_deployed":false}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 123.17475ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/0.17.2 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/faa76f9f-4ee0-4411-8a92-43255e49a727 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 153.905833ms