Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

auth0/structure_auth0_connection.go: Properly expand all SAML options #261

Merged
merged 1 commit into from
Aug 23, 2020

Conversation

198d
Copy link
Contributor

@198d 198d commented Aug 20, 2020

Proposed Changes

Properly expands all SAML options from Terraform config into the correct Auth0 data structures for sending to the Auth0 API.

Currently the debug flag isn't sent at all (causing it to turn off if enabled by hand in the management console) and the wrong type conversion was made on the idp_initiated option causing it to not be sent when configured (and also destroying hand edited configuration on Auth0's side).

Acceptance Test Output

$ AUTH0_DOMAIN=foo.auth0.com AUTH0_CLIENT_ID=client_id AUTH0_CLIENT_SECRET=client_secret make testacc TESTS=TestAccConnectionSAML
==> Checking that code complies with gofmt requirements...
?       github.com/terraform-providers/terraform-provider-auth0 [no test files]
=== RUN   TestAccConnectionSAML
    TestAccConnectionSAML: testing.go:683: Step 0 error: errors during plan:

        Error: oauth2: cannot fetch token: 401 Unauthorized
        Response: {"error":"access_denied","error_description":"Unauthorized"}

          on <empty> line 0:
          (source code not available)


    TestAccConnectionSAML: testing.go:744: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: errors during apply: oauth2: cannot fetch token: 401 Unauthorized
        Response: {"error":"access_denied","error_description":"Unauthorized"}

        State: <no state>
--- FAIL: TestAccConnectionSAML (0.40s)
FAIL
coverage: 4.2% of statements
FAIL    github.com/terraform-providers/terraform-provider-auth0/auth0   0.414s
?       github.com/terraform-providers/terraform-provider-auth0/auth0/internal/debug    [no test files]
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok      github.com/terraform-providers/terraform-provider-auth0/auth0/internal/random   0.014s  coverage: 0.0% of statements [no tests to run]
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok      github.com/terraform-providers/terraform-provider-auth0/auth0/internal/validation       0.002s  coverage: 0.0% of statements [no tests to run]
?       github.com/terraform-providers/terraform-provider-auth0/version [no test files]
FAIL
make: *** [GNUmakefile:26: testacc] Error 1

Unfortunately I don't have a test Auth0 account to run the tests against :(.

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

@alexkappa alexkappa added this to the 0.14.0 milestone Aug 23, 2020
@alexkappa alexkappa merged commit 84a5f21 into alexkappa:master Aug 23, 2020
@alexkappa
Copy link
Owner

Thanks for submitting this fix @198d!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants