Skip to content

Commit 3f49393

Browse files
Support new command for managing tenant settings (#1203)
* Initial commit * Add logic for tenant-settings show and update, display and docs * Clean code * Update logic and add examples for managing tenant-settings. * Refactor tenant-settings logic * Fix tenant-settings logic * Add integration tests and refactored supported flags * Fix integration tests * Added auth0_log_stream to fetchers * added docs --------- Co-authored-by: Rajat Bajaj <rajat.bajaj@okta.com> Co-authored-by: Rajat Bajaj <duedares@gmail.com>
1 parent 143f714 commit 3f49393

17 files changed

Lines changed: 724 additions & 13 deletions

docs/auth0_tenant-settings.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
layout: default
3+
has_toc: false
4+
has_children: true
5+
---
6+
# auth0 tenant-settings
7+
8+
9+
10+
## Commands
11+
12+
- [auth0 tenant-settings show](auth0_tenant-settings_show.md) - Display the current tenant settings
13+
- [auth0 tenant-settings update](auth0_tenant-settings_update.md) - Update tenant settings by enabling or disabling flags
14+

docs/auth0_tenant-settings_show.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
layout: default
3+
parent: auth0 tenant-settings
4+
has_toc: false
5+
---
6+
# auth0 tenant-settings show
7+
8+
Display the current tenant settings
9+
10+
## Usage
11+
```
12+
auth0 tenant-settings show [flags]
13+
```
14+
15+
## Examples
16+
17+
```
18+
auth0 tenant-settings show
19+
```
20+
21+
22+
## Flags
23+
24+
```
25+
--json Output in JSON format.
26+
```
27+
28+
29+
## Inherited Flags
30+
31+
```
32+
--debug Enable debug mode.
33+
--no-color Disable colors.
34+
--no-input Disable interactivity.
35+
--tenant string Specific tenant to use.
36+
```
37+
38+
39+
## Related Commands
40+
41+
- [auth0 tenant-settings show](auth0_tenant-settings_show.md) - Display the current tenant settings
42+
- [auth0 tenant-settings update](auth0_tenant-settings_update.md) - Update tenant settings by enabling or disabling flags
43+
44+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
layout: default
3+
has_toc: false
4+
has_children: true
5+
---
6+
# auth0 tenant-settings update
7+
8+
9+
10+
## Commands
11+
12+
- [auth0 tenant-settings update set](auth0_tenant-settings_update_set.md) - Enable tenant setting flags
13+
- [auth0 tenant-settings update unset](auth0_tenant-settings_update_unset.md) - Disable tenant setting flags
14+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
layout: default
3+
parent: auth0 tenant-settings update
4+
has_toc: false
5+
---
6+
# auth0 tenant-settings update set
7+
8+
Enable selected tenant setting flags.
9+
10+
To enable interactively, use `auth0 tenant-settings update set` with no arguments.
11+
12+
To enable non-interactively, supply the flags.
13+
14+
## Usage
15+
```
16+
auth0 tenant-settings update set [flags]
17+
```
18+
19+
## Examples
20+
21+
```
22+
auth0 tenant-settings update set
23+
auth0 tenant-settings update set <setting1> <setting2> <setting3>
24+
auth0 tenant-settings update set flags.enable_client_connections mtls.enable_endpoint_aliases pushed_authorization_requests_supported
25+
```
26+
27+
28+
29+
30+
## Inherited Flags
31+
32+
```
33+
--debug Enable debug mode.
34+
--no-color Disable colors.
35+
--no-input Disable interactivity.
36+
--tenant string Specific tenant to use.
37+
```
38+
39+
40+
## Related Commands
41+
42+
- [auth0 tenant-settings update set](auth0_tenant-settings_update_set.md) - Enable tenant setting flags
43+
- [auth0 tenant-settings update unset](auth0_tenant-settings_update_unset.md) - Disable tenant setting flags
44+
45+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
layout: default
3+
parent: auth0 tenant-settings update
4+
has_toc: false
5+
---
6+
# auth0 tenant-settings update unset
7+
8+
Disable selected tenant setting flags.
9+
10+
To disable interactively, use `auth0 tenant-settings update unset` with no arguments.
11+
12+
To disable non-interactively, supply the flags.
13+
14+
## Usage
15+
```
16+
auth0 tenant-settings update unset [flags]
17+
```
18+
19+
## Examples
20+
21+
```
22+
auth0 tenant-settings update unset
23+
auth0 tenant-settings update unset <setting1> <setting2> <setting3>
24+
auth0 tenant-settings update unset customize_mfa_in_postlogin_action flags.enable_pipeline2
25+
```
26+
27+
28+
29+
30+
## Inherited Flags
31+
32+
```
33+
--debug Enable debug mode.
34+
--no-color Disable colors.
35+
--no-input Disable interactivity.
36+
--tenant string Specific tenant to use.
37+
```
38+
39+
40+
## Related Commands
41+
42+
- [auth0 tenant-settings update set](auth0_tenant-settings_update_set.md) - Enable tenant setting flags
43+
- [auth0 tenant-settings update unset](auth0_tenant-settings_update_unset.md) - Disable tenant setting flags
44+
45+

docs/auth0_terraform_generate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ auth0 terraform generate [flags]
3333
```
3434
--force Skip confirmation.
3535
-o, --output-dir string Output directory for the generated Terraform config files. If not provided, the files will be saved in the current working directory. (default "./")
36-
-r, --resources strings Resource types to generate Terraform config for. If not provided, config files for all available resources will be generated. (default [auth0_action,auth0_attack_protection,auth0_branding,auth0_phone_provider,auth0_client,auth0_client_grant,auth0_connection,auth0_custom_domain,auth0_flow,auth0_flow_vault_connection,auth0_form,auth0_email_provider,auth0_email_template,auth0_guardian,auth0_organization,auth0_network_acl,auth0_pages,auth0_prompt,auth0_prompt_custom_text,auth0_prompt_screen_renderer,auth0_resource_server,auth0_role,auth0_tenant,auth0_trigger_actions])
36+
-r, --resources strings Resource types to generate Terraform config for. If not provided, config files for all available resources will be generated. (default [auth0_action,auth0_attack_protection,auth0_branding,auth0_phone_provider,auth0_client,auth0_client_grant,auth0_connection,auth0_custom_domain,auth0_flow,auth0_flow_vault_connection,auth0_form,auth0_email_provider,auth0_email_template,auth0_guardian,auth0_log_stream,auth0_network_acl,auth0_organization,auth0_pages,auth0_prompt,auth0_prompt_custom_text,auth0_prompt_screen_renderer,auth0_resource_server,auth0_role,auth0_tenant,auth0_trigger_actions])
3737
-v, --tf-version string Terraform version that ought to be used while generating the terraform files for resources. If not provided, 1.5.0 is used by default (default "1.5.0")
3838
```
3939

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Authenticating as a user is not supported for **private cloud** tenants. Instead
9797
- [auth0 quickstarts](auth0_quickstarts.md) - Quickstart support for getting bootstrapped
9898
- [auth0 roles](auth0_roles.md) - Manage resources for roles
9999
- [auth0 rules](auth0_rules.md) - Manage resources for rules
100+
- [auth0 tenant-settings](auth0_tenant-settings.md) - Manage tenant settings
100101
- [auth0 tenants](auth0_tenants.md) - Manage configured tenants
101102
- [auth0 terraform](auth0_terraform.md) - Manage terraform configuration for your Auth0 Tenant
102103
- [auth0 test](auth0_test.md) - Try your Universal Login box or get a token

internal/auth/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ var RequiredScopes = []string{
133133
"create:email_provider", "read:email_provider", "update:email_provider", "delete:email_provider",
134134
"read:flows", "read:forms", "read:flows_vault_connections",
135135
"read:connections", "update:connections", "read:connections_options", "update:connections_options",
136-
"read:client_keys", "read:logs", "read:tenant_settings",
136+
"read:client_keys", "read:logs", "read:tenant_settings", "update:tenant_settings",
137137
"read:custom_domains", "create:custom_domains", "update:custom_domains", "delete:custom_domains",
138138
"read:anomaly_blocks", "delete:anomaly_blocks",
139139
"create:log_streams", "delete:log_streams", "read:log_streams", "update:log_streams",

internal/auth0/mock/tenant_mock.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/auth0/tenant.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ import (
1010

1111
type TenantAPI interface {
1212
Read(ctx context.Context, opts ...management.RequestOption) (t *management.Tenant, err error)
13+
Update(ctx context.Context, t *management.Tenant, opts ...management.RequestOption) (err error)
1314
}

0 commit comments

Comments
 (0)