diff --git a/docs/data-sources/token_exchange_profile.md b/docs/data-sources/token_exchange_profile.md new file mode 100644 index 00000000..a5a1d5d9 --- /dev/null +++ b/docs/data-sources/token_exchange_profile.md @@ -0,0 +1,29 @@ +--- +page_title: "Data Source: auth0_token_exchange_profile" +description: |- + Data source to retrieve a specific Auth0 Token Exchange Profile by id +--- + +# Data Source: auth0_token_exchange_profile + +Data source to retrieve a specific Auth0 Token Exchange Profile by `id` + + + + +## Schema + +### Required + +- `id` (String) The id of the Token Exchange Profile + +### Read-Only + +- `action_id` (String) Unique identifier of the Action +- `created_at` (String) The ISO 8601 formatted date the credential was created. +- `name` (String) Name of the token exchange profile. +- `subject_token_type` (String) Type of the subject token +- `type` (String) Type of the token exchange profile +- `updated_at` (String) The ISO 8601 formatted date the credential was updated. + + diff --git a/docs/resources/token_exchange_profile.md b/docs/resources/token_exchange_profile.md new file mode 100644 index 00000000..b270e831 --- /dev/null +++ b/docs/resources/token_exchange_profile.md @@ -0,0 +1,32 @@ +--- +page_title: "Resource: auth0_token_exchange_profile" +description: |- + With this resource, you can manage Auth0 Custom Token Exchange Profiles +--- + +# Resource: auth0_token_exchange_profile + +With this resource, you can manage Auth0 Custom Token Exchange Profiles + + + + +## Schema + +### Required + +- `name` (String) Name of the token exchange profile. + +### Optional + +- `action_id` (String) Unique identifier of the Action +- `subject_token_type` (String) Type of the subject token +- `type` (String) Type of the token exchange profile + +### Read-Only + +- `created_at` (String) The ISO 8601 formatted date the credential was created. +- `id` (String) The ID of this resource. +- `updated_at` (String) The ISO 8601 formatted date the credential was updated. + + diff --git a/go.mod b/go.mod index 6d25d3c9..2193917a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.5 require ( github.com/PuerkitoBio/rehttp v1.4.0 - github.com/auth0/go-auth0 v1.14.0 + github.com/auth0/go-auth0 v1.14.1-0.20250117054610-a1e5b43bb00f github.com/google/go-cmp v0.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-multierror v1.1.1 diff --git a/go.sum b/go.sum index aa13d892..f688b08a 100644 --- a/go.sum +++ b/go.sum @@ -26,6 +26,12 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/auth0/go-auth0 v1.14.0 h1:T/wQGIwXylf1DnrDtDEuo/92YBnRizRcw15zXb+e3k4= github.com/auth0/go-auth0 v1.14.0/go.mod h1:PjkjJXvHIbGPJgig9lNjlYrK2lsP5pdh3tM+VV4Dmpc= +github.com/auth0/go-auth0 v1.14.1-0.20250113064852-20ae1831ccae h1:fwojeLnkOGp2ty90zp7EAWLpraUjoyUNHMyvUeqYVvU= +github.com/auth0/go-auth0 v1.14.1-0.20250113064852-20ae1831ccae/go.mod h1:PjkjJXvHIbGPJgig9lNjlYrK2lsP5pdh3tM+VV4Dmpc= +github.com/auth0/go-auth0 v1.14.1-0.20250113124145-16b8925bd444 h1:f7TS75W5/UzJ+8Z1bgqW5Rid8NbHiodPoWXXE8jLdVs= +github.com/auth0/go-auth0 v1.14.1-0.20250113124145-16b8925bd444/go.mod h1:PjkjJXvHIbGPJgig9lNjlYrK2lsP5pdh3tM+VV4Dmpc= +github.com/auth0/go-auth0 v1.14.1-0.20250117054610-a1e5b43bb00f h1:b0E/GFcjVsdAStpZaqVlRHJzeWjSINRXVzr8dmTFfl0= +github.com/auth0/go-auth0 v1.14.1-0.20250117054610-a1e5b43bb00f/go.mod h1:PjkjJXvHIbGPJgig9lNjlYrK2lsP5pdh3tM+VV4Dmpc= github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 h1:0NmehRCgyk5rljDQLKUO+cRJCnduDyn11+zGZIc9Z48= github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0/go.mod h1:6L7zgvqo0idzI7IO8de6ZC051AfXb5ipkIJ7bIA2tGA= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= diff --git a/internal/auth0/tokenexchangeprofile/data_source.go b/internal/auth0/tokenexchangeprofile/data_source.go new file mode 100644 index 00000000..7b40b935 --- /dev/null +++ b/internal/auth0/tokenexchangeprofile/data_source.go @@ -0,0 +1,43 @@ +package tokenexchangeprofile + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/auth0/terraform-provider-auth0/internal/config" + internalSchema "github.com/auth0/terraform-provider-auth0/internal/schema" +) + +// NewDataSource will return a new auth0_token_exchange_profile data source. +func NewDataSource() *schema.Resource { + return &schema.Resource{ + ReadContext: readTokenExchangeProfileForDataSource, + Description: "Data source to retrieve a specific Auth0 Token Exchange Profile by `id`", + Schema: dataSourceSchema(), + } +} + +func dataSourceSchema() map[string]*schema.Schema { + dataSourceSchema := internalSchema.TransformResourceToDataSource(NewResource().Schema) + dataSourceSchema["id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The ID of the Self Service Profile.", + } + dataSourceSchema["id"].Description = "The id of the Token Exchange Profile " + return dataSourceSchema +} + +func readTokenExchangeProfileForDataSource(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + id := data.Get("id").(string) + data.SetId(id) + ssp, err := api.TokenExchangeProfile.Read(ctx, data.Id()) + if err != nil { + return diag.FromErr(err) + } + err = flattenTokenExchangeProfile(data, ssp) + return diag.FromErr(err) +} diff --git a/internal/auth0/tokenexchangeprofile/data_source_test.go b/internal/auth0/tokenexchangeprofile/data_source_test.go new file mode 100644 index 00000000..d12e0750 --- /dev/null +++ b/internal/auth0/tokenexchangeprofile/data_source_test.go @@ -0,0 +1 @@ +package tokenexchangeprofile diff --git a/internal/auth0/tokenexchangeprofile/expand.go b/internal/auth0/tokenexchangeprofile/expand.go new file mode 100644 index 00000000..ea9be6f5 --- /dev/null +++ b/internal/auth0/tokenexchangeprofile/expand.go @@ -0,0 +1,19 @@ +package tokenexchangeprofile + +import ( + "github.com/auth0/go-auth0/management" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/auth0/terraform-provider-auth0/internal/value" +) + +func expandTokenExchangeProfiles(data *schema.ResourceData) *management.TokenExchangeProfile { + cfg := data.GetRawConfig() + + return &management.TokenExchangeProfile{ + Name: value.String(cfg.GetAttr("name")), + SubjectTokenType: value.String(cfg.GetAttr("subject_token_type")), + ActionID: value.String(cfg.GetAttr("action_id")), + Type: value.String(cfg.GetAttr("type")), + } +} diff --git a/internal/auth0/tokenexchangeprofile/flatten.go b/internal/auth0/tokenexchangeprofile/flatten.go new file mode 100644 index 00000000..b823267d --- /dev/null +++ b/internal/auth0/tokenexchangeprofile/flatten.go @@ -0,0 +1,19 @@ +package tokenexchangeprofile + +import ( + "github.com/auth0/go-auth0/management" + "github.com/hashicorp/go-multierror" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func flattenTokenExchangeProfile(data *schema.ResourceData, tokenExchangeProfile *management.TokenExchangeProfile) error { + result := multierror.Append( + data.Set("name", tokenExchangeProfile.GetName()), + data.Set("subject_token_type", tokenExchangeProfile.GetSubjectTokenType()), + data.Set("action_id", tokenExchangeProfile.GetActionID()), + data.Set("type", tokenExchangeProfile.GetType()), + data.Set("created_at", tokenExchangeProfile.GetCreatedAt().String()), + data.Set("updated_at", tokenExchangeProfile.GetUpdatedAt().String()), + ) + return result.ErrorOrNil() +} diff --git a/internal/auth0/tokenexchangeprofile/resource.go b/internal/auth0/tokenexchangeprofile/resource.go new file mode 100644 index 00000000..4170f555 --- /dev/null +++ b/internal/auth0/tokenexchangeprofile/resource.go @@ -0,0 +1,105 @@ +package tokenexchangeprofile + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/auth0/terraform-provider-auth0/internal/config" + internalError "github.com/auth0/terraform-provider-auth0/internal/error" +) + +// NewResource will return a new auth0_token_exchange_profile resource. +func NewResource() *schema.Resource { + return &schema.Resource{ + CreateContext: createTokenExchangeProfile, + ReadContext: readTokenExchangeProfile, + UpdateContext: updateTokenExchangeProfile, + DeleteContext: deleteTokenExchangeProfile, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + Description: "With this resource, you can manage Auth0 Custom Token Exchange Profiles", + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of the token exchange profile.", + }, + "subject_token_type": { + Type: schema.TypeString, + Optional: true, + Description: "Type of the subject token", + }, + "action_id": { + Type: schema.TypeString, + Optional: true, + Description: "Unique identifier of the Action", + }, + "type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Type of the token exchange profile", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The ISO 8601 formatted date the credential was created.", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "The ISO 8601 formatted date the credential was updated.", + }, + }, + } +} + +func createTokenExchangeProfile(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + + tep := expandTokenExchangeProfiles(data) + + if err := api.TokenExchangeProfile.Create(ctx, tep); err != nil { + return diag.FromErr(err) + } + + data.SetId(tep.GetID()) + + return readTokenExchangeProfile(ctx, data, meta) +} + +func readTokenExchangeProfile(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + + ssp, err := api.TokenExchangeProfile.Read(ctx, data.Id()) + if err != nil { + return diag.FromErr(internalError.HandleAPIError(data, err)) + } + + return diag.FromErr(flattenTokenExchangeProfile(data, ssp)) +} + +func updateTokenExchangeProfile(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + + tep := expandTokenExchangeProfiles(data) + + if err := api.TokenExchangeProfile.Update(ctx, data.Id(), tep); err != nil { + return diag.FromErr(internalError.HandleAPIError(data, err)) + } + + return readTokenExchangeProfile(ctx, data, meta) +} + +func deleteTokenExchangeProfile(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + api := meta.(*config.Config).GetAPI() + + if err := api.TokenExchangeProfile.Delete(ctx, data.Id()); err != nil { + return diag.FromErr(internalError.HandleAPIError(data, err)) + } + + return nil +} diff --git a/internal/auth0/tokenexchangeprofile/resource_test.go b/internal/auth0/tokenexchangeprofile/resource_test.go new file mode 100644 index 00000000..23c123e3 --- /dev/null +++ b/internal/auth0/tokenexchangeprofile/resource_test.go @@ -0,0 +1,71 @@ +package tokenexchangeprofile_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/auth0/terraform-provider-auth0/internal/acctest" +) + +const givenACustomTokenAction = ` +resource "auth0_action" "my_action" { + name = "{{.testName}}-Action" + code = <<-EOT + exports.onContinuePostLogin = async (event, api) => { + console.log("foo") + };" + EOT + deploy = true + supported_triggers { + id = "custom-token-exchange" + version = "v1" + } +} +` + +const testTokenExchangeProfileCreate = givenACustomTokenAction + ` +resource "auth0_token_exchange_profile" "my_token_exchange_profile" { + name = "token-prof-{{.testName}}" + subject_token_type = "https://acme.com/cis-token" + action_id = auth0_action.my_action.id + type = "custom_authentication" +} +` + +const testTokenExchangeProfileUpdate = givenACustomTokenAction + ` +resource "auth0_token_exchange_profile" "my_token_exchange_profile" { + name = "token-prof-updated-{{.testName}}" + subject_token_type = "https://acme.com/cis-token-updated" + action_id = auth0_action.my_action.id + type = "custom_authentication" +} +` + +func TestTokenExchangeProfile(t *testing.T) { + acctest.Test(t, resource.TestCase{ + Steps: []resource.TestStep{ + { + Config: acctest.ParseTestName(testTokenExchangeProfileCreate, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_token_exchange_profile.my_token_exchange_profile", "name", fmt.Sprintf("token-prof-%s", t.Name())), + resource.TestCheckResourceAttr("auth0_token_exchange_profile.my_token_exchange_profile", "subject_token_type", "https://acme.com/cis-token"), + resource.TestCheckResourceAttr("auth0_token_exchange_profile.my_token_exchange_profile", "type", "custom_authentication"), + resource.TestCheckResourceAttrSet("auth0_token_exchange_profile.my_token_exchange_profile", "action_id"), + ), + }, + { + Config: acctest.ParseTestName(testTokenExchangeProfileUpdate, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_token_exchange_profile.my_token_exchange_profile", "name", fmt.Sprintf("token-prof-updated-%s", t.Name())), + resource.TestCheckResourceAttr("auth0_token_exchange_profile.my_token_exchange_profile", "subject_token_type", "https://acme.com/cis-token-updated"), + ), + }, + { + Config: acctest.ParseTestName(givenACustomTokenAction, t.Name()), + Check: resource.ComposeTestCheckFunc(), + }, + }, + }) +} diff --git a/internal/provider/provider.go b/internal/provider/provider.go index bdf77e03..c2c2ad41 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -3,6 +3,8 @@ package provider import ( "os" + "github.com/auth0/terraform-provider-auth0/internal/auth0/tokenexchangeprofile" + "github.com/auth0/terraform-provider-auth0/internal/auth0/flow" "github.com/auth0/terraform-provider-auth0/internal/auth0/form" @@ -145,6 +147,7 @@ func New() *schema.Provider { "auth0_self_service_profile": selfserviceprofile.NewResource(), "auth0_self_service_profile_custom_text": selfserviceprofile.NewCustomTextResource(), "auth0_tenant": tenant.NewResource(), + "auth0_token_exchange_profile": tokenexchangeprofile.NewResource(), "auth0_user": user.NewResource(), "auth0_user_permission": user.NewPermissionResource(), "auth0_user_permissions": user.NewPermissionsResource(), @@ -172,6 +175,7 @@ func New() *schema.Provider { "auth0_self_service_profile": selfserviceprofile.NewDataSource(), "auth0_signing_keys": signingkey.NewDataSource(), "auth0_tenant": tenant.NewDataSource(), + "auth0_token_exchange_profile": tokenexchangeprofile.NewDataSource(), "auth0_user": user.NewDataSource(), }, } diff --git a/test/data/recordings/TestTokenExchangeProfile.yaml b/test/data/recordings/TestTokenExchangeProfile.yaml new file mode 100644 index 00000000..3eb9a220 --- /dev/null +++ b/test/data/recordings/TestTokenExchangeProfile.yaml @@ -0,0 +1,669 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 212 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"TestTokenExchangeProfile-Action","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"code":"exports.onContinuePostLogin = async (event, api) =\u003e {\n\tconsole.log(\"foo\")\n};\"\n"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.14.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: 440 + uncompressed: false + body: '{"id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","name":"TestTokenExchangeProfile-Action","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"created_at":"2025-01-17T05:58:40.834222847Z","updated_at":"2025-01-17T05:58:40.852381951Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"runtime":"node18","status":"pending","secrets":[],"all_changes_deployed":false}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 422.972542ms + - id: 1 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/0d3e5e29-1b33-4a06-8229-18b340a9117a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","name":"TestTokenExchangeProfile-Action","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"created_at":"2025-01-17T05:58:40.834222847Z","updated_at":"2025-01-17T05:58:40.852381951Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"runtime":"node18","status":"built","secrets":[],"all_changes_deployed":false}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 389.946458ms + - id: 2 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/0d3e5e29-1b33-4a06-8229-18b340a9117a/deploy + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","deployed":false,"number":1,"secrets":[],"status":"built","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.620126381Z","runtime":"node18","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"action":{"id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","name":"TestTokenExchangeProfile-Action","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"created_at":"2025-01-17T05:58:40.834222847Z","updated_at":"2025-01-17T05:58:40.834222847Z","all_changes_deployed":false}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 367.785375ms + - id: 3 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/0d3e5e29-1b33-4a06-8229-18b340a9117a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","name":"TestTokenExchangeProfile-Action","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"created_at":"2025-01-17T05:58:40.834222847Z","updated_at":"2025-01-17T05:58:40.852381951Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"runtime":"node18","status":"built","secrets":[],"current_version":{"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","runtime":"node18","status":"BUILT","number":1,"build_time":"2025-01-17T05:58:41.684775435Z","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z"},"deployed_version":{"code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","deployed":true,"number":1,"built_at":"2025-01-17T05:58:41.684775435Z","secrets":[],"status":"built","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z","runtime":"node18","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}]},"all_changes_deployed":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 432.299459ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 179 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"token-prof-TestTokenExchangeProfile","subject_token_type":"https://acme.com/cis-token","action_id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","type":"custom_authentication"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/token-exchange-profiles + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 286 + uncompressed: false + body: '{"id":"tep_bdN9eWKnMqg1RecL","name":"token-prof-TestTokenExchangeProfile","type":"custom_authentication","subject_token_type":"https://acme.com/cis-token","action_id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","created_at":"2025-01-17T05:58:42.538Z","updated_at":"2025-01-17T05:58:42.538Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 513.814583ms + - id: 5 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/token-exchange-profiles/tep_bdN9eWKnMqg1RecL + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"tep_bdN9eWKnMqg1RecL","name":"token-prof-TestTokenExchangeProfile","type":"custom_authentication","subject_token_type":"https://acme.com/cis-token","action_id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","created_at":"2025-01-17T05:58:42.538Z","updated_at":"2025-01-17T05:58:42.538Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 940.887959ms + - 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/0d3e5e29-1b33-4a06-8229-18b340a9117a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","name":"TestTokenExchangeProfile-Action","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"created_at":"2025-01-17T05:58:40.834222847Z","updated_at":"2025-01-17T05:58:40.852381951Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"runtime":"node18","status":"built","secrets":[],"current_version":{"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","runtime":"node18","status":"BUILT","number":1,"build_time":"2025-01-17T05:58:41.684775435Z","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z"},"deployed_version":{"code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","deployed":true,"number":1,"built_at":"2025-01-17T05:58:41.684775435Z","secrets":[],"status":"built","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z","runtime":"node18","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}]},"all_changes_deployed":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 366.128875ms + - id: 7 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/token-exchange-profiles/tep_bdN9eWKnMqg1RecL + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"tep_bdN9eWKnMqg1RecL","name":"token-prof-TestTokenExchangeProfile","type":"custom_authentication","subject_token_type":"https://acme.com/cis-token","action_id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","created_at":"2025-01-17T05:58:42.538Z","updated_at":"2025-01-17T05:58:42.538Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 391.121167ms + - id: 8 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/0d3e5e29-1b33-4a06-8229-18b340a9117a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","name":"TestTokenExchangeProfile-Action","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"created_at":"2025-01-17T05:58:40.834222847Z","updated_at":"2025-01-17T05:58:40.852381951Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"runtime":"node18","status":"built","secrets":[],"current_version":{"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","runtime":"node18","status":"BUILT","number":1,"build_time":"2025-01-17T05:58:41.684775435Z","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z"},"deployed_version":{"code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","deployed":true,"number":1,"built_at":"2025-01-17T05:58:41.684775435Z","secrets":[],"status":"built","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z","runtime":"node18","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}]},"all_changes_deployed":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 373.245166ms + - id: 9 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/token-exchange-profiles/tep_bdN9eWKnMqg1RecL + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"tep_bdN9eWKnMqg1RecL","name":"token-prof-TestTokenExchangeProfile","type":"custom_authentication","subject_token_type":"https://acme.com/cis-token","action_id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","created_at":"2025-01-17T05:58:42.538Z","updated_at":"2025-01-17T05:58:42.538Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 373.132458ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 113 + transfer_encoding: [] + trailer: {} + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"token-prof-updated-TestTokenExchangeProfile","subject_token_type":"https://acme.com/cis-token-updated"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/token-exchange-profiles/tep_bdN9eWKnMqg1RecL + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"tep_bdN9eWKnMqg1RecL","name":"token-prof-updated-TestTokenExchangeProfile","type":"custom_authentication","subject_token_type":"https://acme.com/cis-token-updated","action_id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","created_at":"2025-01-17T05:58:42.538Z","updated_at":"2025-01-17T05:58:47.327Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 444.777791ms + - id: 11 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/token-exchange-profiles/tep_bdN9eWKnMqg1RecL + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"tep_bdN9eWKnMqg1RecL","name":"token-prof-updated-TestTokenExchangeProfile","type":"custom_authentication","subject_token_type":"https://acme.com/cis-token-updated","action_id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","created_at":"2025-01-17T05:58:42.538Z","updated_at":"2025-01-17T05:58:47.327Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 402.488958ms + - id: 12 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/0d3e5e29-1b33-4a06-8229-18b340a9117a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","name":"TestTokenExchangeProfile-Action","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"created_at":"2025-01-17T05:58:40.834222847Z","updated_at":"2025-01-17T05:58:40.852381951Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"runtime":"node18","status":"built","secrets":[],"current_version":{"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","runtime":"node18","status":"BUILT","number":1,"build_time":"2025-01-17T05:58:41.684775435Z","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z"},"deployed_version":{"code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","deployed":true,"number":1,"built_at":"2025-01-17T05:58:41.684775435Z","secrets":[],"status":"built","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z","runtime":"node18","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}]},"all_changes_deployed":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 436.75275ms + - id: 13 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/token-exchange-profiles/tep_bdN9eWKnMqg1RecL + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"tep_bdN9eWKnMqg1RecL","name":"token-prof-updated-TestTokenExchangeProfile","type":"custom_authentication","subject_token_type":"https://acme.com/cis-token-updated","action_id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","created_at":"2025-01-17T05:58:42.538Z","updated_at":"2025-01-17T05:58:47.327Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 373.985166ms + - id: 14 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/token-exchange-profiles/tep_bdN9eWKnMqg1RecL + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"tep_bdN9eWKnMqg1RecL","name":"token-prof-updated-TestTokenExchangeProfile","type":"custom_authentication","subject_token_type":"https://acme.com/cis-token-updated","action_id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","created_at":"2025-01-17T05:58:42.538Z","updated_at":"2025-01-17T05:58:47.327Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 408.98375ms + - id: 15 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/0d3e5e29-1b33-4a06-8229-18b340a9117a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","name":"TestTokenExchangeProfile-Action","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"created_at":"2025-01-17T05:58:40.834222847Z","updated_at":"2025-01-17T05:58:40.852381951Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"runtime":"node18","status":"built","secrets":[],"current_version":{"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","runtime":"node18","status":"BUILT","number":1,"build_time":"2025-01-17T05:58:41.684775435Z","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z"},"deployed_version":{"code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","deployed":true,"number":1,"built_at":"2025-01-17T05:58:41.684775435Z","secrets":[],"status":"built","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z","runtime":"node18","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}]},"all_changes_deployed":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 466.799333ms + - id: 16 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/token-exchange-profiles/tep_bdN9eWKnMqg1RecL + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: {} + status: 204 No Content + code: 204 + duration: 508.932083ms + - id: 17 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/0d3e5e29-1b33-4a06-8229-18b340a9117a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"id":"0d3e5e29-1b33-4a06-8229-18b340a9117a","name":"TestTokenExchangeProfile-Action","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}],"created_at":"2025-01-17T05:58:40.834222847Z","updated_at":"2025-01-17T05:58:40.852381951Z","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"runtime":"node18","status":"built","secrets":[],"current_version":{"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","runtime":"node18","status":"BUILT","number":1,"build_time":"2025-01-17T05:58:41.684775435Z","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z"},"deployed_version":{"code":"exports.onContinuePostLogin = async (event, api) => {\n\tconsole.log(\"foo\")\n};\"\n","dependencies":[],"id":"b96bb2d9-e67d-4d99-a0dd-d7a93a4c3e77","deployed":true,"number":1,"built_at":"2025-01-17T05:58:41.684775435Z","secrets":[],"status":"built","created_at":"2025-01-17T05:58:41.620126381Z","updated_at":"2025-01-17T05:58:41.686007224Z","runtime":"node18","supported_triggers":[{"id":"custom-token-exchange","version":"v1"}]},"all_changes_deployed":true}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 385.639333ms + - id: 18 + 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/1.14.0 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/actions/actions/0d3e5e29-1b33-4a06-8229-18b340a9117a + 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: 452.389208ms