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

Fix crash with domain_aliases for ADFS #172

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

jscannell
Copy link
Contributor

Description

When setting domain_aliases on an ADFS connection the following crash occurs:

Stack trace from the terraform-provider-auth0_v0.30.3.exe plugin:

panic: interface conversion: interface {} is *schema.Set, not []interface {}

goroutine 16 [running]:
github.com/auth0/terraform-provider-auth0/auth0.Slice({0xcb4b10, 0xc000582560}, {0xb89507, 0xe}, {0x0, 0x0, 0x0})
github.com/auth0/terraform-provider-auth0/auth0/resource_data.go:286 +0xe5
github.com/auth0/terraform-provider-auth0/auth0.expandConnectionOptionsADFS({0xcb4b10, 0xc000582560})
github.com/auth0/terraform-provider-auth0/auth0/structure_auth0_connection.go:796 +0x85
github.com/auth0/terraform-provider-auth0/auth0.expandConnection.func1({0xcb4b10, 0xc000582560})
github.com/auth0/terraform-provider-auth0/auth0/structure_auth0_connection.go:435 +0x19f
github.com/auth0/terraform-provider-auth0/auth0.(*list).Elem(0xc00058b530, 0xc000582540)
github.com/auth0/terraform-provider-auth0/auth0/resource_data.go:345 +0x43
github.com/auth0/terraform-provider-auth0/auth0.expandConnection({0xcb4bb0, 0xc0002bb480})
github.com/auth0/terraform-provider-auth0/auth0/structure_auth0_connection.go:398 +0x53b
github.com/auth0/terraform-provider-auth0/auth0.updateConnection({0xcb2ab8, 0xc00007eae0}, 0xc0002bb480, {0xac8fc0?, 0xc00057a640?})
github.com/auth0/terraform-provider-auth0/auth0/resource_auth0_connection.go:825 +0x50
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc0004b08c0, {0xcb2af0, 0xc000298840}, 0xd?, {0xac8fc0, 0xc00057a640})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:741 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0004b08c0, {0xcb2af0, 0xc000298840}, 0xc0000451e0, 0xc0002ba280, {0xac8fc0, 0xc00057a640})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:847 +0x82c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0004865e8, {0xcb2a48?, 0xc00025f280?}, 0xc000324320)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe3c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00045ab40, {0xcb2af0?, 0xc000298030?}, 0xc000106000)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:812 +0x515
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xb50b00?, 0xc00045ab40}, {0xcb2af0, 0xc000298030}, 0xc00019aa20, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002b8a80, {0xcb5608, 0xc00051c1a0}, 0xc0000da480, 0xc0004e2ed0, 0x1191c60, 0x0)
google.golang.org/[email protected]/server.go:1283 +0xcfd
google.golang.org/grpc.(*Server).handleStream(0xc0002b8a80, {0xcb5608, 0xc00051c1a0}, 0xc0000da480, 0x0)
google.golang.org/[email protected]/server.go:1620 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:920 +0x28a

Error: The terraform-provider-auth0_v0.30.3.exe plugin crashed!

This change fixes the crash by updating expandConnectionOptionsADFS to behave consistently with the other connection strategies.

Checklist

Note: Checklist required to be completed before a PR is considered to be reviewable.

Auth0 Code of Conduct

Auth0 General Contribution Guidelines

Changes include test coverage?

  • Yes
  • Not needed

Does the description provide the correct amount of context?

  • Yes, the description provides enough context for the reviewer to understand what these changes accomplish

Have you updated the documentation?

  • Yes, I've updated the appropriate docs
  • Not needed

Is this code ready for production?

  • Yes, all code changes are intentional and no debugging calls are left over

@jscannell jscannell requested a review from a team as a code owner June 3, 2022 18:54
Copy link
Contributor

@sergiught sergiught left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @jscannell !

@sergiught sergiught merged commit b8b5fb1 into auth0:main Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants