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

Add support for Form, Flow and Flow Vault Connection #1039

Merged
merged 23 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a90c9dc
form resource
kushalshit27 Sep 27, 2024
4907b80
flow resource
kushalshit27 Sep 27, 2024
aab8ac4
flow resource, data source added
kushalshit27 Sep 27, 2024
026a532
update forms
kushalshit27 Sep 27, 2024
05c634a
update flow
kushalshit27 Sep 27, 2024
085de7f
update go-auth0 v1.11.0
kushalshit27 Sep 28, 2024
ac587ac
added flow vault connection
kushalshit27 Sep 28, 2024
a531cc7
Added flow expand/flatten + tests + recordings
duedares-rvj Sep 28, 2024
7f84a45
resolved merge conflicts
duedares-rvj Sep 28, 2024
a347d3c
update flow vault connection
kushalshit27 Sep 28, 2024
e0769c7
form, flow vault connection added unit test, recordings
kushalshit27 Sep 30, 2024
0e89b10
form, flow vault connection doc update
kushalshit27 Sep 30, 2024
76f5261
form, flow vault connection examples added
kushalshit27 Sep 30, 2024
1ec8fe9
form, flow vault connection examples added example, data source
kushalshit27 Oct 3, 2024
63c0bb3
form, flow vault connection examples docs updated
kushalshit27 Oct 3, 2024
7d5d1a8
lint fix
kushalshit27 Oct 3, 2024
57ae97d
form, flow unit test added
kushalshit27 Oct 3, 2024
2cd75ef
Merge branch 'main' into DXCDT-673-terraform-support-for-forms
kushalshit27 Oct 3, 2024
8d7132d
Merge branch 'main' into DXCDT-673-terraform-support-for-forms
kushalshit27 Oct 4, 2024
f1b585b
form flatten unit test added
kushalshit27 Oct 4, 2024
5fdbcca
lint
kushalshit27 Oct 4, 2024
79a5ce3
Updated recordings
duedares-rvj Oct 8, 2024
06c4fe1
Merge branch 'main' into DXCDT-673-terraform-support-for-forms
duedares-rvj Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/data-sources/flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
page_title: "Data Source: auth0_flow"
description: |-
Data source to retrieve a specific Auth0 Flow by id
---

# Data Source: auth0_flow

Data source to retrieve a specific Auth0 Flow by `id`

## Example Usage

```terraform
# An Auth0 flow loaded using its ID.
data "auth0_flow" "my_flow_data" {
id = "af_5CTYdsXHLoLXD7ZVwvFHew"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) The id of the Flow.

### Read-Only

- `actions` (String) Actions of the flow.
- `name` (String) Name of the flow.


37 changes: 37 additions & 0 deletions docs/data-sources/flow_vault_connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
page_title: "Data Source: auth0_flow_vault_connection"
description: |-
Data source to retrieve a specific Auth0 Flow Vault Connection by id
---

# Data Source: auth0_flow_vault_connection

Data source to retrieve a specific Auth0 Flow Vault Connection by `id`

## Example Usage

```terraform
# An Auth0 flow vault connection loaded using its ID.
data "auth0_flow_vault_connection" "data_connection" {
id = "ac_9m2uqjHsqs19riN9N6sZQ7"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) The id of the Flow Vault Connection.

### Read-Only

- `account_name` (String) Custom account name of the vault connection.
- `app_id` (String) App identifier of the vault connection.
- `environment` (String) Environment of the vault connection.
- `fingerprint` (String) Fingerprint of the vault connection.
- `name` (String) Name of the vault connection.
- `ready` (Boolean) Indicates if the vault connection is configured.
- `setup` (Map of String) Configuration of the vault connection. (Mapping information must be provided as key/value pairs)


55 changes: 55 additions & 0 deletions docs/data-sources/form.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
page_title: "Data Source: auth0_form"
description: |-
Data source to retrieve a specific Auth0 Form by id
---

# Data Source: auth0_form

Data source to retrieve a specific Auth0 Form by `id`

## Example Usage

```terraform
# An Auth0 form loaded using its ID.
data "auth0_flow" "my_form_data" {
id = "ap_31LxRJphZF1Kqzf2zBgmgA"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) The id of the Form.

### Read-Only

- `ending` (String) Submission configuration of the form. (JSON encoded)
- `languages` (List of Object) Language specific configuration for the form. (see [below for nested schema](#nestedatt--languages))
- `messages` (List of Object) Message specific configuration for the form. (see [below for nested schema](#nestedatt--messages))
- `name` (String) Name of the form.
- `nodes` (String) Nodes of the form. (JSON encoded)
- `start` (String) Input setup of the form. (JSON encoded)
- `style` (String) Style specific configuration for the form. (JSON encoded)
- `translations` (String) Translations of the form. (JSON encoded)

<a id="nestedatt--languages"></a>
### Nested Schema for `languages`

Read-Only:

- `default` (String)
- `primary` (String)


<a id="nestedatt--messages"></a>
### Nested Schema for `messages`

Read-Only:

- `custom` (String)
- `errors` (String)


61 changes: 61 additions & 0 deletions docs/resources/flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
page_title: "Resource: auth0_flow"
description: |-
With this resource, you can create and manage Flows for a tenant.
---

# Resource: auth0_flow

With this resource, you can create and manage Flows for a tenant.

## Example Usage

```terraform
# Example:
resource "auth0_flow" "my_flow" {
actions = jsonencode([{
action = "UPDATE_USER"
alias = "user meta data"
allow_failure = false
id = "update_user_PmSa"
mask_output = false
params = {
changes = {
user_metadata = {
full_name = "{{fields.full_name}}"
}
}
connection_id = "<vault_connection_id>" # Altenative ways: (connection_id = auth0_flow_vault_connection.my_connection.id) or using terraform variables
user_id = "{{context.user.user_id}}"
}
type = "AUTH0"
}])
name = "Flow KYC update data"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Name of the flow.

### Optional

- `actions` (String) Actions of the flow.

### Read-Only

- `id` (String) The ID of this resource.

## Import

Import is supported using the following syntax:

```shell
# This resource can be imported using the flow ID.
#
# Example:
terraform import auth0_form.my_flow "af_4JwsAjokf6DpK8xJCkTRjK"
```
56 changes: 56 additions & 0 deletions docs/resources/flow_vault_connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
page_title: "Resource: auth0_flow_vault_connection"
description: |-
With this resource, you can create and manage flow vault connections for a tenant.
---

# Resource: auth0_flow_vault_connection

With this resource, you can create and manage flow vault connections for a tenant.

## Example Usage

```terraform
# Example:
resource "auth0_flow_vault_connection" "my_connection" {
app_id = "AUTH0"
name = "Auth0 M2M Connection"
setup = {
client_id = "******************"
client_secret = "*********************************"
domain = "*****************************"
type = "OAUTH_APP"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `app_id` (String) App identifier of the vault connection.
- `name` (String) Name of the vault connection.

### Optional

- `account_name` (String) Custom account name of the vault connection.
- `environment` (String) Environment of the vault connection.
- `fingerprint` (String) Fingerprint of the vault connection.
- `ready` (Boolean) Indicates if the vault connection is configured.
- `setup` (Map of String, Sensitive) Configuration of the vault connection. (Mapping information must be provided as key/value pairs)

### Read-Only

- `id` (String) The ID of this resource.

## Import

Import is supported using the following syntax:

```shell
# This resource can be imported using the flow vault connection ID.
#
# Example:
terraform import auth0_flow_vault_connection.my_connection "ac_42HT5oiobDyUs8ASwEEWK0"
```
144 changes: 144 additions & 0 deletions docs/resources/form.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
page_title: "Resource: auth0_form"
description: |-
With this resource, you can create and manage Forms for a tenant.
---

# Resource: auth0_form

With this resource, you can create and manage Forms for a tenant.

## Example Usage

```terraform
# Example:
resource "auth0_form" "my_form" {
name = "My KYC Form"

start = jsonencode({
coordinates = {
x = 0
y = 0
}
next_node = "step_ggeX"
})
nodes = jsonencode([{
alias = "New step"
config = {
components = [{
category = "FIELD"
config = {
max_length = 50
min_length = 1
multiline = false
}
id = "full_name"
label = "Your Name"
required = true
sensitive = false
type = "TEXT"
}, {
category = "BLOCK"
config = {
text = "Continue"
}
id = "next_button_3FbA"
type = "NEXT_BUTTON"
}]
next_node = "$ending"
}
coordinates = {
x = 500
y = 0
}
id = "step_ggeX"
type = "STEP"
}])
ending = jsonencode({
after_submit = {
flow_id = "<my_flow_id>" # Altenative ways: (flow_id = auth0_flow.my_flow.id) or using terraform variables
}
coordinates = {
x = 1250
y = 0
}
resume_flow = true
})

style = jsonencode({
css = "h1 {\n color: white;\n text-align: center;\n}"
})

translations = jsonencode({
es = {
components = {
rich_text_uctu = {
config = {
content = "<h2>Help us verify your personal information</h2><p>We want to learn more about you so that we can validate and protect your account...</p>"
}
}
}
messages = {
custom = {}
errors = {
ERR_ACCEPTANCE_REQUIRED = "Por favor, marca este campo para continuar."
}
}
}
})

languages {
default = "en"
primary = "en"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Name of the form.

### Optional

- `ending` (String) Submission configuration of the form. (JSON encoded)
- `languages` (Block List) Language specific configuration for the form. (see [below for nested schema](#nestedblock--languages))
- `messages` (Block List) Message specific configuration for the form. (see [below for nested schema](#nestedblock--messages))
- `nodes` (String) Nodes of the form. (JSON encoded)
- `start` (String) Input setup of the form. (JSON encoded)
- `style` (String) Style specific configuration for the form. (JSON encoded)
- `translations` (String) Translations of the form. (JSON encoded)

### Read-Only

- `id` (String) The ID of this resource.

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

Optional:

- `default` (String) Default language for the form.
- `primary` (String) Primary language for the form.


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

Optional:

- `custom` (String) Custom message for the form. (JSON encoded)
- `errors` (String) Error message for the form. (JSON encoded)

## Import

Import is supported using the following syntax:

```shell
# This resource can be imported using the form ID.
#
# Example:
terraform import auth0_form.my_form "ap_ojkKbiPMG6J5E5VCKdeCzK"
```
4 changes: 4 additions & 0 deletions examples/data-sources/auth0_flow/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# An Auth0 flow loaded using its ID.
data "auth0_flow" "my_flow_data" {
id = "af_5CTYdsXHLoLXD7ZVwvFHew"
}
Loading
Loading