Skip to content

Commit

Permalink
[3/X] Refactor attack protection resource to allow for empty fields (#…
Browse files Browse the repository at this point in the history
…338)

* Refactor attack protection resource to allow for empty fields

* [4/X] Refactor branding resources to allow for empty fields (#339)

* Refactor branding resources to allow for empty fields

* [5/X] Refactor client resources to allow for empty fields (#340)

* Refactor client resources to allow for empty fields

* [6/X] Refactor connection resources to allow for empty fields (#341)

* Refactor client resources to allow for empty fields

* Refactor connection resources to allow for empty fields

* [7/X] Refactor guardian resources to allow for empty fields (#342)

* Refactor guardian resources to allow for empty fields

* Early return for erroneous guardian API requests

* Early return for erroneous guardian API requests

* [8/X] Refactor orgs to allow for empty fields and remove deprecated field (#343)

* Refactor ors to allow for empty fields and remove deprecated field

* [9/X] Refactor email resources to allow for empty fields (#344)

* Refactor email resources to allow for empty fields

* [10/X] Refactor resource server resources to allow for empty fields (#345)

* Refactor resource server resources to allow for empty fields

* [11/X] Refactor tenant resource to allow for empty fields (#346)

* Refactor tenant resource to allow for empty fields

* [12/X] Refactor custom domain resource to allow for empty fields (#347)

* Refactor custom domain resource to allow for empty fields

* [13/X] Refactor user resource to allow for empty fields (#348)

* Refactor user resource to allow for empty fields

* [14/X] Refactor role and rule resources to allow for empty fields (#349)

* Refactor role and rule resources to allow for empty fields

* [15/X] Refactor log stream resource to allow for empty fields (#350)

* Refactor log stream resource to allow for empty fields

* [16/X] Refactor prompts resource to allow for empty fields (#351)

* Refactor prompts resource to allow for empty fields

* [17/X] Refactor hooks resource to allow for empty fields (#352)

Refactor hooks resource to allow for empty fields

* Fix small issue with log stream filters

* Adding user_id back in to tests

Co-authored-by: Will Vedder <[email protected]>

Co-authored-by: Will Vedder <[email protected]>

* Removing default audience string replace

* Removing unncessary check

Co-authored-by: Will Vedder <[email protected]>

Co-authored-by: Will Vedder <[email protected]>

Co-authored-by: Will Vedder <[email protected]>

Co-authored-by: Will Vedder <[email protected]>

Co-authored-by: Will Vedder <[email protected]>

* Adding extra assertion

Co-authored-by: Will Vedder <[email protected]>

Co-authored-by: Will Vedder <[email protected]>

Co-authored-by: Will Vedder <[email protected]>

Co-authored-by: Will Vedder <[email protected]>
  • Loading branch information
sergiught and willvedd authored Oct 10, 2022
1 parent b56ec1d commit caee035
Show file tree
Hide file tree
Showing 87 changed files with 13,886 additions and 10,125 deletions.
13 changes: 0 additions & 13 deletions docs/resources/organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ resource "auth0_organization" "my_organization" {
### Optional

- `branding` (Block List, Max: 1) Defines how to style the login pages. (see [below for nested schema](#nestedblock--branding))
- `connections` (Block Set, Deprecated) (see [below for nested schema](#nestedblock--connections))
- `display_name` (String) Friendly name of this organization.
- `metadata` (Map of String) Metadata associated with the organization. Maximum of 10 metadata properties allowed.

Expand All @@ -60,18 +59,6 @@ Optional:
- `colors` (Map of String) Color scheme used to customize the login pages.
- `logo_url` (String) URL of logo to display on login page.


<a id="nestedblock--connections"></a>
### Nested Schema for `connections`

Required:

- `connection_id` (String) The connection ID of the connection to add to the organization.

Optional:

- `assign_membership_on_login` (Boolean) When `true`, all users that log in with this connection will be automatically granted membership in the organization. When `false`, users must be granted membership in the organization before logging in with this connection.

## Import

Import is supported using the following syntax:
Expand Down
5 changes: 4 additions & 1 deletion docs/resources/resource_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ resource "auth0_resource_server" "my_resource_server" {
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `identifier` (String) Unique identifier for the resource server. Used as the audience parameter for authorization calls. Cannot be changed once set.

### Optional

- `allow_offline_access` (Boolean) Indicates whether refresh tokens can be issued for this resource server.
- `enforce_policies` (Boolean) Indicates whether authorization polices are enforced.
- `identifier` (String) Unique identifier for the resource server. Used as the audience parameter for authorization calls. Cannot be changed once set.
- `name` (String) Friendly name for the resource server. Cannot include `<` or `>` characters.
- `options` (Map of String) Used to store additional metadata.
- `scopes` (Block Set) List of permissions (scopes) used by this resource server. (see [below for nested schema](#nestedblock--scopes))
Expand Down
41 changes: 18 additions & 23 deletions internal/provider/data_source_auth0_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,24 @@ import (
"github.com/auth0/terraform-provider-auth0/internal/template"
)

const testAccGivenAClient = `
resource "auth0_client" "my_client" {
name = "Acceptance Test - {{.testName}}"
app_type = "non_interactive"
}
`

const testAccDataClientConfigByName = `
%v
data auth0_client test {
name = "Acceptance Test - {{.testName}}"
data "auth0_client" "test" {
depends_on = [ auth0_client.my_client ]
name = "Acceptance Test - {{.testName}}"
}
`

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

Expand All @@ -32,18 +39,12 @@ func TestAccDataClientByName(t *testing.T) {
PreventPostDestroyRefresh: true,
Steps: []resource.TestStep{
{
Config: template.ParseTestName(testAccClientConfig, t.Name()),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("auth0_client.my_client", "name", fmt.Sprintf("Acceptance Test - %s", t.Name())),
), // check that the client got created correctly before using the data source
},
{
Config: template.ParseTestName(fmt.Sprintf(testAccDataClientConfigByName, testAccClientConfig), t.Name()),
Config: template.ParseTestName(testAccGivenAClient+testAccDataClientConfigByName, t.Name()),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.auth0_client.test", "client_id"),
resource.TestCheckResourceAttr("data.auth0_client.test", "signing_keys.#", "1"), // checks that signing_keys is set, and it includes 1 element
resource.TestCheckResourceAttr("data.auth0_client.test", "signing_keys.#", "1"),
resource.TestCheckResourceAttr("data.auth0_client.test", "name", fmt.Sprintf("Acceptance Test - %v", t.Name())),
resource.TestCheckResourceAttr("data.auth0_client.test", "app_type", "non_interactive"), // Arbitrary property selection
resource.TestCheckResourceAttr("data.auth0_client.test", "app_type", "non_interactive"),
resource.TestCheckNoResourceAttr("data.auth0_client.test", "client_secret_rotation_trigger"),
),
},
Expand All @@ -59,17 +60,11 @@ func TestAccDataClientById(t *testing.T) {
PreventPostDestroyRefresh: true,
Steps: []resource.TestStep{
{
Config: template.ParseTestName(testAccClientConfig, t.Name()),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("auth0_client.my_client", "name", fmt.Sprintf("Acceptance Test - %v", t.Name())),
), // check that the client got created correctly before using the data source
},
{
Config: template.ParseTestName(fmt.Sprintf(testAccDataClientConfigByID, testAccClientConfig), t.Name()),
Config: template.ParseTestName(testAccGivenAClient+testAccDataClientConfigByID, t.Name()),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.auth0_client.test", "id"),
resource.TestCheckResourceAttrSet("data.auth0_client.test", "name"),
resource.TestCheckResourceAttr("data.auth0_client.test", "signing_keys.#", "1"), // checks that signing_keys is set, and it includes 1 element
resource.TestCheckResourceAttr("data.auth0_client.test", "signing_keys.#", "1"),
resource.TestCheckNoResourceAttr("data.auth0_client.test", "client_secret_rotation_trigger"),
),
},
Expand Down
Loading

0 comments on commit caee035

Please sign in to comment.