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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: alexkappa/terraform-provider-auth0
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.24.2
Choose a base ref
...
head repository: alexkappa/terraform-provider-auth0
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jul 22, 2021

  1. Copy the full SHA
    ee9c5d7 View commit details
  2. add support for custom sms gateway

    grese committed Jul 22, 2021
    Copy the full SHA
    3ddb5b6 View commit details

Commits on Jul 29, 2021

  1. Copy the full SHA
    f0f0fd1 View commit details

Commits on Sep 10, 2021

  1. Copy the full SHA
    370a7fa View commit details

Commits on Sep 22, 2021

  1. Copy the full SHA
    f49bc44 View commit details
  2. Copy the full SHA
    9904884 View commit details
  3. Update connection.md

    jackton1 authored Sep 22, 2021
    Copy the full SHA
    58c11a0 View commit details

Commits on Oct 13, 2021

  1. Fix typo

    drillbits committed Oct 13, 2021
    Copy the full SHA
    85acb6a View commit details

Commits on Nov 10, 2021

  1. Copy the full SHA
    a6e0eba View commit details

Commits on Nov 19, 2021

  1. Copy the full SHA
    9bec8fb View commit details

Commits on Nov 23, 2021

  1. doc: update wording of documentation

    Co-authored-by: Alex Kalyvitis <alex.kalyvitis@gmail.com>
    KarimDarwish and alexkappa authored Nov 23, 2021
    Copy the full SHA
    abf6ca1 View commit details

Commits on Dec 1, 2021

  1. Action secrets are a list not a set

    Alex Kalyvitis committed Dec 1, 2021
    Copy the full SHA
    947de9f View commit details
  2. Add action example

    Alex Kalyvitis committed Dec 1, 2021
    Copy the full SHA
    d34e31b View commit details
  3. Merge pull request #478 from alexkappa/fix-action-secrets-v2

    Fix action secrets (attempt #2 🙈)
    alexkappa authored Dec 1, 2021
    Copy the full SHA
    2b6417b View commit details
  4. update changelog

    Alex Kalyvitis committed Dec 1, 2021
    Copy the full SHA
    3a1d9d5 View commit details

Commits on Dec 13, 2021

  1. Introduce auth0_trigger_binding

    Alex Kalyvitis committed Dec 13, 2021
    Copy the full SHA
    a855b38 View commit details
  2. Add trigger binding to labels

    Alex Kalyvitis committed Dec 13, 2021
    Copy the full SHA
    f9b3ac3 View commit details
  3. Validate trigger value

    Alex Kalyvitis committed Dec 13, 2021
    Copy the full SHA
    ce1302b View commit details
  4. Merge pull request #468 from hoppalotta/support-custom-entityid

    Support entity_id in samlp connection
    alexkappa authored Dec 13, 2021
    Copy the full SHA
    86bb85a View commit details
  5. Declare secret for DO access token

    Alex Kalyvitis committed Dec 13, 2021
    Copy the full SHA
    0f6dbbe View commit details
  6. Tee output of release notes

    Alex Kalyvitis committed Dec 13, 2021
    Copy the full SHA
    3eb6ad8 View commit details
  7. Update changelog - 0.25.0

    Alex Kalyvitis committed Dec 13, 2021
    Copy the full SHA
    107db08 View commit details
  8. Copy the full SHA
    ee821dd View commit details
  9. Merge pull request #471 from KarimDarwish/patch-1

    Add Import Documentation for client_grants
    alexkappa authored Dec 13, 2021
    Copy the full SHA
    5fbae06 View commit details

Commits on Dec 14, 2021

  1. Update CHANGELOG

    Alex Kalyvitis committed Dec 14, 2021
    Copy the full SHA
    79daf00 View commit details
  2. Copy the full SHA
    0a93020 View commit details
  3. Merge branch 'master' into add-auth0_trigger_binding

    Alex Kalyvitis committed Dec 14, 2021
    Copy the full SHA
    61f12d7 View commit details
  4. Copy the full SHA
    ae373de View commit details
  5. Copy the full SHA
    187e6a7 View commit details

Commits on Dec 23, 2021

  1. Merge pull request #481 from alexkappa/add-auth0_trigger_binding

    Add `auth0_trigger_binding`
    alexkappa authored Dec 23, 2021
    Copy the full SHA
    0bbadc8 View commit details

Commits on Dec 29, 2021

  1. Merge pull request #482 from RishikeshDarandale/fix/log-stream-import…

    …-doc
    
    docs: update auth0 log stream resource documentation
    alexkappa authored Dec 29, 2021
    Copy the full SHA
    389e337 View commit details

Commits on Jan 14, 2022

  1. Fix role docs

    sergiught committed Jan 14, 2022
    Copy the full SHA
    89230ff View commit details

Commits on Jan 17, 2022

  1. Merge pull request #494 from alexkappa/patch/issue-423

    #423 Fix role docs
    sergiught authored Jan 17, 2022
    Copy the full SHA
    4ba15d3 View commit details
  2. Implements the native_social_login stanza on the Client API.

    This setting is used to toggle "Enable native Apple/Facebook" login on
    / off.
    cthos authored and sergiught committed Jan 17, 2022
    Copy the full SHA
    619894e View commit details
  3. Docs and test to reflect API weirdness.

    cthos authored and sergiught committed Jan 17, 2022
    Copy the full SHA
    7c3c8cc View commit details
  4. Fix small issues in pr

    sergiught committed Jan 17, 2022
    Copy the full SHA
    a965541 View commit details
  5. Add CHANGELOG

    sergiught committed Jan 17, 2022
    Copy the full SHA
    553bba1 View commit details
  6. Merge pull request #453 from cthos/add-native-social

    Implements the native_social_login stanza on the Client API.
    sergiught authored Jan 17, 2022
    Copy the full SHA
    8ca0c0b View commit details

Commits on Jan 20, 2022

  1. added auth0_prompt_custom_text

    jluiz20 authored and sergiught committed Jan 20, 2022
    Copy the full SHA
    86a6dfd View commit details
  2. rollback formatting

    jluiz20 authored and sergiught committed Jan 20, 2022
    Copy the full SHA
    2e78a5c View commit details
  3. fixing test

    jluiz20 authored and sergiught committed Jan 20, 2022
    Copy the full SHA
    216f720 View commit details
  4. Copy the full SHA
    f27d4e5 View commit details
  5. Refactor prompt custom text

    sergiught committed Jan 20, 2022
    Copy the full SHA
    5f6d324 View commit details
  6. added delete to clear body

    jluiz20 authored and sergiught committed Jan 20, 2022
    Copy the full SHA
    327afa8 View commit details
  7. added update on delete

    jluiz20 authored and sergiught committed Jan 20, 2022
    Copy the full SHA
    4ecebb5 View commit details
  8. Update auth0/resource_auth0_prompt_custom_text.go

    edded error
    
    Co-authored-by: Sergiu Ghitea <28300158+sergiughf@users.noreply.github.com>
    jluiz20 and sergiught committed Jan 20, 2022
    Copy the full SHA
    e256040 View commit details
  9. Copy the full SHA
    f017f3e View commit details
  10. Copy the full SHA
    d550a43 View commit details
  11. Merge pull request #497 from jluiz20/added_auth0_prompt_custom_text

    Add auth0 prompt custom text
    sergiught authored Jan 20, 2022
    Copy the full SHA
    b0b1c5f View commit details
  12. Fix read branding

    resolves #380
    nekootoko3 authored and sergiught committed Jan 20, 2022
    Copy the full SHA
    8e39fec View commit details
Showing with 2,169 additions and 544 deletions.
  1. +8 −0 .github/labeler.yml
  2. +7 −0 .github/workflows/build.yml
  3. +2 −1 .github/workflows/release.yml
  4. +52 −0 CHANGELOG.md
  5. +13 −8 CONTRIBUTING.md
  6. +5 −2 GNUmakefile
  7. +6 −0 README.md
  8. +53 −0 auth0/data_source_auth0_client.go
  9. +75 −0 auth0/data_source_auth0_client_test.go
  10. +19 −0 auth0/data_source_auth0_global_client.go
  11. +39 −0 auth0/data_source_auth0_global_client_test.go
  12. +73 −0 auth0/data_source_helpers.go
  13. +77 −0 auth0/data_source_helpers_test.go
  14. +0 −30 auth0/internal/digitalocean/provider.go
  15. +0 −323 auth0/internal/digitalocean/resource_digitalocean_record.go
  16. +60 −44 auth0/provider.go
  17. +95 −0 auth0/provider_test.go
  18. +1 −1 auth0/resource_auth0_action.go
  19. +42 −32 auth0/resource_auth0_branding.go
  20. +81 −0 auth0/resource_auth0_client.go
  21. +58 −22 auth0/resource_auth0_client_test.go
  22. +60 −0 auth0/resource_auth0_connection.go
  23. +113 −2 auth0/resource_auth0_connection_test.go
  24. +4 −22 auth0/resource_auth0_custom_domain_verification_test.go
  25. +69 −22 auth0/resource_auth0_guardian.go
  26. +64 −0 auth0/resource_auth0_guardian_test.go
  27. +2 −1 auth0/resource_auth0_log_stream.go
  28. +37 −10 auth0/resource_auth0_log_stream_test.go
  29. +167 −0 auth0/resource_auth0_prompt_custom_text.go
  30. +74 −0 auth0/resource_auth0_prompt_custom_text_test.go
  31. +142 −0 auth0/resource_auth0_trigger_binding.go
  32. +103 −0 auth0/resource_auth0_trigger_binding_test.go
  33. +63 −0 auth0/structure_auth0_connection.go
  34. +12 −0 docker-compose.yml
  35. +5 −0 dockerfiles/wiremock/Dockerfile
  36. +16 −0 dockerfiles/wiremock/__files/custom_domain_verified.json
  37. +16 −0 dockerfiles/wiremock/__files/custom_domain_with_pending_verification.json
  38. +9 −0 dockerfiles/wiremock/mappings/delete_custom_domain_204.json
  39. +16 −0 dockerfiles/wiremock/mappings/get_custom_domain_pending_200.json
  40. +15 −0 dockerfiles/wiremock/mappings/get_custom_domain_ready_200.json
  41. +21 −0 dockerfiles/wiremock/mappings/post_custom_domain_201.json
  42. +13 −0 dockerfiles/wiremock/mappings/post_custom_domain_verify_200.json
  43. +32 −0 docs/datasources/client.md
  44. +33 −0 docs/datasources/global_client.md
  45. +7 −2 docs/index.md
  46. +26 −0 docs/resources/client.md
  47. +8 −0 docs/resources/client_grant.md
  48. +37 −2 docs/resources/connection.md
  49. +8 −4 docs/resources/guardian.md
  50. +13 −2 docs/resources/log_stream.md
  51. +62 −0 docs/resources/prompt_custom_text.md
  52. +2 −3 docs/resources/role.md
  53. +82 −0 docs/resources/trigger_binding.md
  54. +1 −1 docs/resources/user.md
  55. +33 −10 example/action/main.tf
  56. +1 −0 example/client/main.tf
  57. +14 −0 example/guardian/main.tf
  58. +22 −0 example/log_stream/main.tf
  59. +1 −0 scripts/gendocs.go
8 changes: 8 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -54,6 +54,10 @@ resource/auth0_prompt:
- '**/*prompt.go'
- '**/*prompt_test.go'

resource/auth0_prompt_custom_text:
- '**/*prompt_custom_text.go'
- '**/*prompt_custom_text_test.go'

resource/auth0_resource_server:
- '**/*resource_server.go'
- '**/*resource_server_test.go'
@@ -74,6 +78,10 @@ resource/auth0_tenant:
- '**/*tenant.go'
- '**/*tenant_test.go'

resource/auth0_trigger_binding:
- '**/*trigger_binding.go'
- '**/*trigger_binding_test.go'

resource/auth0_user:
- '**/*user.go'
- '**/*user_test.go'
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -28,6 +28,9 @@ jobs:
- name: Build
run: make build

- name: Start containers
run: docker-compose up -d --build

- name: Test
run: make testacc OPTS=-coverprofile=c.out
env:
@@ -40,3 +43,7 @@ jobs:
with:
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
command: after-build --prefix github.com/alexkappa/terraform-provider-auth0

- name: Stop containers
if: always()
run: docker-compose down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -28,7 +28,8 @@ jobs:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Create release notes
run: scripts/release-notes.sh ${{ env.VERSION }} > release-notes.md
run: |
scripts/release-notes.sh ${{ env.VERSION }} | tee release-notes.md
- name: Go release
uses: goreleaser/goreleaser-action@v1
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
## 0.26.2

ENHANCEMENTS:

* resource/auth0_log_stream: Add support for JSONOBJECT format ([#445](https://github.com/alexkappa/terraform-provider-auth0/pull/445))
* resource/auth0_guardian: Add email mfa factor ([#499](https://github.com/alexkappa/terraform-provider-auth0/pull/499))
* resource/auth0_client: Add `signing_cert` option to SAMLP addon ([#426](https://github.com/alexkappa/terraform-provider-auth0/pull/426))
* resource/auth0_connection: Add support for custom SMS gateways ([#417](https://github.com/alexkappa/terraform-provider-auth0/pull/417))
* Add HTTP mocks to acceptance tests for external dependencies, specifically for domain name verification ([#501](https://github.com/alexkappa/terraform-provider-auth0/pull/501))
* resource/auth0_connection: Add `google-apps` connection strategy ([#422](https://github.com/alexkappa/terraform-provider-auth0/pull/422))

NOTES:

* Fixed typos in SAMLP connection docs ([#448](https://github.com/alexkappa/terraform-provider-auth0/pull/448), [#449](https://github.com/alexkappa/terraform-provider-auth0/pull/449))
* Removed `role_id` from auth0_role documentation ([#415](https://github.com/alexkappa/terraform-provider-auth0/pull/415))

## 0.26.1

BUG FIXES:

* resource/auth0_branding: Fix reading auth0_branding when enable_custom_domain_in_emails flag is true ([#438](https://github.com/alexkappa/terraform-provider-auth0/pull/438))

## 0.26.0

ENHANCEMENTS:

* **New Resource:** `auth0_prompt_custom_text` ([#497](https://github.com/alexkappa/terraform-provider-auth0/pull/497))

## 0.25.1

ENHANCEMENTS:

* resource/client: Add the `native_social_login` field for native `app_types` ([#453](https://github.com/alexkappa/terraform-provider-auth0/pull/453))

NOTES:

* Fix role docs [#398](https://github.com/alexkappa/terraform-provider-auth0/pull/398)

## 0.25.0

ENHANCEMENTS:

* **New Resource:** `auth0_trigger_binding` a.k.a Action Flow ([#481](https://github.com/alexkappa/terraform-provider-auth0/pull/481))
* resource/auth0_connection: Add `entity_id` field for SAMLP connections ([#468](https://github.com/alexkappa/terraform-provider-auth0/pull/468))
* resource/auth0_client_grant: Update import documentation ([#471](https://github.com/alexkappa/terraform-provider-auth0/pull/471))

## 0.24.3

BUG FIXES:

* resource/auth0_action: Secrets would not be sent to the management API and the `0.24.1` version didn't address the issue ([#478](https://github.com/alexkappa/terraform-provider-auth0/pull/478))

## 0.24.2

BUG FIXES:
21 changes: 13 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# Contributing

Before you begin, read through some of the Terraform documentation on [Extending
Before you begin, read through the Terraform documentation on [Extending
Terraform](https://www.terraform.io/docs/extend/index.html) and [Writing Custom
Providers](https://learn.hashicorp.com/collections/terraform/providers).

Finally the [HashiCorp Provider Design
Finally, the [HashiCorp Provider Design
Principles](https://www.terraform.io/docs/extend/hashicorp-provider-design-principles.html)
explore the underlying principles for the design choices of this provider.

## Prerequisites

- [Go 1.13+](https://go.dev/)
- [Docker](https://docs.docker.com/get-docker/) - used for running acceptance tests.
- [Docker-Compose](https://docs.docker.com/compose/install/) - used for running acceptance tests.

## Getting started

To work on the provider, you'll need [Go](http://www.golang.org) installed on
your machine (version 1.10+ is *required*). You'll also need to correctly setup
your machine (version 1.13+ is *required*). You'll also need to correctly set up
a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding
`$GOPATH/bin` to your `$PATH`.

@@ -43,9 +49,8 @@ AUTH0_CLIENT_SECRET=<your-auth0-client-secret>
Then, run `make testacc`.

**Note:** The acceptance tests make calls to a real Auth0 tenant, and create
real resources. Certain tests, for example for custom domains
(`TestAccCustomDomain`), also require a paid Auth0 subscription to be able to
run successfully.
real resources. Certain tests also require a paid Auth0 subscription to be able to
run successfully, e.g. `TestAccCustomDomain` and the ones starting with `TestAccLogStream*`.

**Note:** At the time of writing, the following configuration steps are also
required for the test tenant:
@@ -56,7 +61,7 @@ required for the test tenant:
## Documentation

To make it easier to document new resources a handy script is available. The
script can output documentation of a resource in markdown format, using the
script can output documentation of a resource in Markdown format, using the
schema of the resource itself.

```sh
@@ -80,4 +85,4 @@ git push origin vX.Y.Z

This will trigger the
[Release](https://github.com/alexkappa/terraform-provider-auth0/actions/workflows/release.yml)
GitHub Action which creates a new release.
GitHub Action which creates a new release.
7 changes: 5 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ test: fmtcheck
@echo $(PKGS) | \
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 -run ^$(TESTS)$

testacc: fmtcheck
testacc: fmtcheck dev-up
@TF_ACC=1 go test $(PKGS) -v $(TESTARGS) -timeout 120m -coverprofile=$(COVERS) -run ^$(TESTS)$

vet:
@@ -46,4 +46,7 @@ errcheck:
docgen:
go run scripts/gendocs.go -resource auth0_<resource>

.PHONY: build test testacc vet fmt fmtcheck errcheck docgen
dev-up:
@docker-compose up -d

.PHONY: build test testacc vet fmt fmtcheck errcheck docgen dev-up
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# THIS REPOSITORY HAS MOVED

This repository has moved into the [Auth0](https://github.com/auth0) organization where it will be maintained at
[github.com/auth0/terraform-provider-auth0](https://github.com/auth0/terraform-provider-auth0).


Auth0 Terraform Provider
========================

53 changes: 53 additions & 0 deletions auth0/data_source_auth0_client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package auth0

import (
"errors"
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"gopkg.in/auth0.v5"
"gopkg.in/auth0.v5/management"
)

func newDataClient() *schema.Resource {
return &schema.Resource{
Read: readDataClient,
Schema: newClientSchema(),
}
}

func newClientSchema() map[string]*schema.Schema {
clientSchema := datasourceSchemaFromResourceSchema(newClient().Schema)
delete(clientSchema, "client_secret_rotation_trigger")
delete(clientSchema, "client_secret")
addOptionalFieldsToSchema(clientSchema, "name", "client_id")
return clientSchema
}

func readDataClient(d *schema.ResourceData, m interface{}) error {
clientId := auth0.StringValue(String(d, "client_id"))
if clientId != "" {
d.SetId(clientId)
return readClient(d, m)
}

//If not provided ID, perform looking of client by name
name := auth0.StringValue(String(d, "name"))
if name == "" {
return errors.New("no 'client_id' or 'name' was specified")
}

api := m.(*management.Management)
clients, err := api.Client.List(management.IncludeFields("client_id", "name"))
if err != nil {
return err
}
for _, client := range clients.Clients {
if auth0.StringValue(client.Name) == name {
clientId = auth0.StringValue(client.ClientID)
d.SetId(clientId)
return readClient(d, m)
}
}
return fmt.Errorf("no client found with 'name' = '%s'", name)
}
75 changes: 75 additions & 0 deletions auth0/data_source_auth0_client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package auth0

import (
"fmt"
"testing"

"github.com/alexkappa/terraform-provider-auth0/auth0/internal/random"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

const testAccDataClientConfigByName = `
%v
data auth0_client test {
name = "Acceptance Test - {{.random}}"
}
`

const testAccDataClientConfigById = `
%v
data auth0_client test {
client_id = auth0_client.my_client.client_id
}
`

func TestAccDataClientByName(t *testing.T) {
rand := random.String(6)

resource.Test(t, resource.TestCase{
Providers: map[string]terraform.ResourceProvider{
"auth0": Provider(),
},
PreventPostDestroyRefresh: true,
Steps: []resource.TestStep{
{
Config: random.Template(testAccClientConfig, rand), // must initialize resource before reading with data source
},
{
Config: random.Template(fmt.Sprintf(testAccDataClientConfigByName, testAccClientConfig), rand),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.auth0_client.test", "client_id"),
resource.TestCheckResourceAttr("data.auth0_client.test", "name", fmt.Sprintf("Acceptance Test - %v", rand)),
resource.TestCheckResourceAttr("data.auth0_client.test", "app_type", "non_interactive"), // Arbitrary property selection
resource.TestCheckNoResourceAttr("data.auth0_client.test", "client_secret_rotation_trigger"),
resource.TestCheckNoResourceAttr("data.auth0_client.test", "client_secret"),
),
},
},
})
}

func TestAccDataClientById(t *testing.T) {
rand := random.String(6)

resource.Test(t, resource.TestCase{
Providers: map[string]terraform.ResourceProvider{
"auth0": Provider(),
},
PreventPostDestroyRefresh: true,
Steps: []resource.TestStep{
{
Config: random.Template(testAccClientConfig, rand),
},
{
Config: random.Template(fmt.Sprintf(testAccDataClientConfigById, testAccClientConfig), rand),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.auth0_client.test", "id"),
resource.TestCheckResourceAttrSet("data.auth0_client.test", "name"),
resource.TestCheckNoResourceAttr("data.auth0_client.test", "client_secret_rotation_trigger"),
resource.TestCheckNoResourceAttr("data.auth0_client.test", "client_secret"),
),
},
},
})
}
19 changes: 19 additions & 0 deletions auth0/data_source_auth0_global_client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package auth0

import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

func newDataGlobalClient() *schema.Resource {
return &schema.Resource{
Read: readDataGlobalClient,
Schema: newClientSchema(),
}
}

func readDataGlobalClient(d *schema.ResourceData, m interface{}) error {
if err := readGlobalClientId(d, m); err != nil {
return err
}
return readClient(d, m)
}
39 changes: 39 additions & 0 deletions auth0/data_source_auth0_global_client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package auth0

import (
"fmt"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

const testAccDataGlobalClientConfig = `
%v
data auth0_global_client global {
}
`

func TestAccDataGlobalClient(t *testing.T) {
resource.Test(t, resource.TestCase{
Providers: map[string]terraform.ResourceProvider{
"auth0": Provider(),
},
Steps: []resource.TestStep{
{
Config: testAccGlobalClientConfigWithCustomLogin,
},
{
Config: fmt.Sprintf(testAccDataGlobalClientConfig, testAccGlobalClientConfigWithCustomLogin),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.auth0_global_client.global", "custom_login_page", "<html>TEST123</html>"),
resource.TestCheckResourceAttr("data.auth0_global_client.global", "custom_login_page_on", "true"),
resource.TestCheckResourceAttrSet("data.auth0_global_client.global", "client_id"),
resource.TestCheckResourceAttr("data.auth0_global_client.global", "app_type", ""),
resource.TestCheckResourceAttr("data.auth0_global_client.global", "name", "All Applications"),
resource.TestCheckNoResourceAttr("data.auth0_global_client.global", "client_secret"),
),
},
},
})
}
Loading