Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(auth0_resource_server_scopes) Unable to upgrade from 0.x to 1.x. Additional prop: scopes #939

Open
6 tasks done
randomhash opened this issue Mar 29, 2024 · 2 comments
Open
6 tasks done
Labels
🪲 bug Something isn't working

Comments

@randomhash
Copy link

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of this provider and the issue still persists.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

After upgrading to version 1.2.0 following problem occurred:


│ Error: Resource Server with non empty scopes
│ 
│   with module.auth0.auth0_resource_server_scopes.xxxx,
│   on .terraform/modules/auth0/resource-servers.tf line 11, in resource "auth0_resource_server_scopes" "system_apis_scopes":
│   11: resource "auth0_resource_server_scopes" "system_apis_scopes" {
│ 
│   []management.ResourceServerScope{
│ - 	{Value: &"blacklist:tokens", Description: &"Blacklist Tokens"},
│ - 	{Value: &"create:custom_domains", Description: &"Configure new custom
│ domains"},
│ - 	{
│ - 		Value:       &"create:actions_log_sessions",
│ - 		Description: &"Create Actions Log Sessions",
│ - 	},
│ - 	{Value: &"create:actions", Description: &"Create Actions"},
│ + 	{Value: &"read:client_grants", Description: &"Read Client Grants"},
│   	{Value: &"create:client_grants", Description: &"Create Client Grants"},
│ + 	{Value: &"delete:client_grants", Description: &"Delete Client Grants"},
│ + 	{Value: &"update:client_grants", Description: &"Update Client Grants"},
│ + 	{Value: &"read:users", Description: &"Read Users"},
│ + 	{Value: &"update:users", Description: &"Update Users"},
│ + 	{Value: &"delete:users", Description: &"Delete Users"},
│ + 	{Value: &"create:users", Description: &"Create Users"},
│ + 	{Value: &"read:users_app_metadata", Description: &"Read Users App
│ Metadata"},
│ + 	{Value: &"update:users_app_metadata", Description: &"Update Users App
│ Metadata"},
│ - 	{Value: &"create:client_keys", Description: &"Create Client Keys"},
│ + 	{Value: &"delete:users_app_metadata", Description: &"Delete Users App
│ Metadata"},
│ - 	{Value: &"create:clients", Description: &"Create Clients"},
│ + 	{Value: &"create:users_app_metadata", Description: &"Create Users App
│ Metadata"},
│ - 	{Value: &"create:connections", Description: &"Create Connections"},
│ + 	{Value: &"read:user_custom_blocks", Description: &"Read Custom User
│ Blocks"},
│   	... // 4 identical, 120 removed, and 150 inserted elements
│   }
│ 
│ The resource server already has scopes attached to it. Import the resource
│ instead in order to proceed with the changes. Run: 'terraform import
│ auth0_resource_server_scopes.<given-name>
│ https://gsstaging.eu.auth0.com/api/v2/'.
╵

After import, next apply throwing error

400 Bad Request: Payload validation error: 'Additional properties not allowed: scopes'.

Sample configuration:

resource "auth0_resource_server" "xxxxx" {
  name        = "Auth0 Management API"
  identifier  = "https://${var.auth0_subdomain}.auth0.com/api/v2/"
  signing_alg = "RS256"

  allow_offline_access                            = false
  token_lifetime                                  = 86400
  skip_consent_for_verifiable_first_party_clients = false
}

resource "auth0_resource_server_scopes" "yyyyy" {
  resource_server_identifier = auth0_resource_server.xxxxx.identifier
  scopes {
    description = "Blacklist Tokens"
    name        = "blacklist:tokens"
  }
  scopes {
    description = "Create Actions Log Sessions"
    name        = "create:actions_log_sessions"
  }
  ....
 }

Expectation

Changes applied

Reproduction

  1. Have a configuration with auth0_resource_server and inline scopes, version pre 1.x
resource "auth0_resource_server" "xxxxx" {
  name        = "Auth0 Management API"
  identifier  = "https://${var.auth0_subdomain}.auth0.com/api/v2/"
  signing_alg = "RS256"

  scopes {
    description = "Blacklist Tokens"
    value       = "blacklist:tokens"
  }
  ....
  
 }
  1. Switch configuration to the current version setup
  2. Apply changes

Auth0 Terraform Provider version

1.2.0

Terraform version

OpenTofu v1.6.2

@randomhash randomhash added the 🪲 bug Something isn't working label Mar 29, 2024
@randomhash
Copy link
Author

bump

1 similar comment
@randomhash
Copy link
Author

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant