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

Some Auth0 Forms Components not supported i.e IMAGE #1057

Closed
6 tasks done
msinstil opened this issue Oct 28, 2024 · 6 comments
Closed
6 tasks done

Some Auth0 Forms Components not supported i.e IMAGE #1057

msinstil opened this issue Oct 28, 2024 · 6 comments
Assignees
Labels
🪲 bug Something isn't working

Comments

@msinstil
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

When adding an IMAGE Component to Auth0 Form, it seems to be not yet supported as according to the error:

{
              id= "image_YTvB"
              type= "IMAGE"
              config= {
                src      = "someURL"
                width    = 200
                height   = 76
                position ="CENTER"
              }
              category = "BLOCK"
            },

Heres the error when adding an Image component to Form:
Error: 400 Bad Request: Payload validation error: 'None of the valid schemas were met' on property nodes[0] ({description}). Inner errors: [ Payload validation error: 'Additional properties not allowed: components' on property nodes[0].config ({description}). (also) Payload validation error: 'Invalid value "STEP"' on property nodes[0].type. (also) Payload validation error: 'Additional properties not allowed: next_node,components' on property nodes[0].config ({description}). (also) Payload validation error: 'None of the valid schemas were met' on property nodes[0].config.components[0] ({description}). Inner errors: [ Payload validation error: 'None of the valid schemas were met' on property config.components[0] ({description}). Inner errors: [ Payload validation error: 'Additional properties not allowed: width,src,position,height' on property config ({description}). (also) Payload validation error: 'Invalid value "IMAGE"' on property type. (also) Payload validation error: 'Additional properties not allowed: width' on property config ({description}). ]. (also) Payload validation error: 'None of the valid schemas were met' on property config.components[0] ({description}). Inner errors: [ Payload validation error: 'Additional properties not allowed: width,src,position,height' on property config ({description}). (also) Payload validation error: 'Invalid value "IMAGE"' on property type. ]. ]. ].

The issue may be present for other Components not yet tested.

Expectation

I should be able to deploy valid Forms components with Terraform Auth0 Provider

Reproduction

  1. Create a form with an Image Component
{
              id= "image_YTvB"
              type= "IMAGE"
              config= {
                src      = "someURL"
                width    = 200
                height   = 76
                position ="CENTER"
              }
              category = "BLOCK"
            },
  1. Deploy it and observe the error

Error: 400 Bad Request: Payload validation error: 'None of the valid schemas were met' on property nodes[0] ({description}). Inner errors: [ Payload validation error: 'Additional properties not allowed: components' on property nodes[0].config ({description}). (also) Payload validation error: 'Invalid value "STEP"' on property nodes[0].type. (also) Payload validation error: 'Additional properties not allowed: next_node,components' on property nodes[0].config ({description}). (also) Payload validation error: 'None of the valid schemas were met' on property nodes[0].config.components[0] ({description}). Inner errors: [ Payload validation error: 'None of the valid schemas were met' on property config.components[0] ({description}). Inner errors: [ Payload validation error: 'Additional properties not allowed: width,src,position,height' on property config ({description}). (also) Payload validation error: 'Invalid value "IMAGE"' on property type. (also) Payload validation error: 'Additional properties not allowed: width' on property config ({description}). ]. (also) Payload validation error: 'None of the valid schemas were met' on property config.components[0] ({description}). Inner errors: [ Payload validation error: 'Additional properties not allowed: width,src,position,height' on property config ({description}). (also) Payload validation error: 'Invalid value "IMAGE"' on property type. ]. ]. ].`

Auth0 Terraform Provider version

1.7.1

Terraform version

1.9.5

@msinstil msinstil added the 🪲 bug Something isn't working label Oct 28, 2024
@GDownes
Copy link

GDownes commented Oct 28, 2024

+1

@msinstil msinstil changed the title Auth0 Forms Components not supported Some Auth0 Forms Components not supported i.e IMAGE Oct 28, 2024
@kushalshit27
Copy link
Contributor

Hi, @msinstil ,
Auth0 Forms supports IMAGE , Issue is released #1054

@msinstil
Copy link
Author

msinstil commented Oct 29, 2024

Hi, @msinstil ,
Auth0 Forms supports IMAGE , Issue is released #1054

Thanks so much @kushalshit27. You guys are doing a super job 💪!!

Just one question for my understanding, does this mean that IMAGE will be supported in 1058

Or do you mean it should already be working and I am doing something wrong? I am currently getting the error when deploying a new form with IMAGE component:

(also) Payload validation error: 'Invalid value "IMAGE"' on property type.

@kushalshit27
Copy link
Contributor

kushalshit27 commented Oct 30, 2024

IMAGE component is supported now,
example:

{
        category = "BLOCK"
        config = {
          height   = 200
          width   = 200
          position = "CENTER"
          src      = "https://placehold.co/600x400"
        }
        id   = "image_u8cK"
        type = "IMAGE"
 }

The issue looks like it is due to the validation of the schema node.

Recommendation

Foms resources are complex due to their nested JSON nature. its recommended to using UI first to create a form. Then, if it looks good, export it as a Terraform file; the generated Terraform is ready to be used on any tenant without using UI.

Export existing form to terraform file

Please use Terraform version 1.9.x for better support of jsonencode

[This resource can be imported using the form ID.]

main.tf

terraform {
  required_providers {
    auth0 = {
      source  = "auth0/auth0"
      version = ">= 1.7.1"
    }
  }
}
import {
  id = "ap_ojkKbiPMG6J5E5VCKdeCzK"
  to = auth0_form.my_form
}

run command:

terraform plan -generate-config-out=terraform_generated.tf

terraform_generated.tf will contain Exported auth0_form.my_form resource.

@msinstil
Copy link
Author

msinstil commented Nov 5, 2024

@kushalshit27 Can confirm after using the config from generated plan after importing the terraform config from auth0 works, Thankyou

@kushalshit27
Copy link
Contributor

I hope this is resolved. Thanks for opening this ticket!

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

3 participants