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 configuring phone provider #1137

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
12 changes: 12 additions & 0 deletions docs/auth0_phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
layout: default
has_toc: false
---
# auth0 phone

Configure the phone providers like twilio and custom

## Commands

- [auth0 phone provider](auth0_phone_provider.md) - Manage phone provider

17 changes: 17 additions & 0 deletions docs/auth0_phone_provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
layout: default
has_toc: false
has_children: true
---
# auth0 phone provider

Manage custom and twilio phone provider for the tenant.

## Commands

- [auth0 phone provider create](auth0_phone_provider_create.md) - Create the phone provider
- [auth0 phone provider delete](auth0_phone_provider_delete.md) - Delete the phone provider
- [auth0 phone provider list](auth0_phone_provider_list.md) - List your Phone providers
- [auth0 phone provider show](auth0_phone_provider_show.md) - Show the Phone provider
- [auth0 phone provider update](auth0_phone_provider_update.md) - Update the phone provider

59 changes: 59 additions & 0 deletions docs/auth0_phone_provider_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
layout: default
parent: auth0 phone provider
has_toc: false
---
# auth0 phone provider create

Create the phone provider.

To create interactively, use `auth0 phone provider create` with no arguments.

To create non-interactively, supply the provider name and other information through the flags.

## Usage
```
auth0 phone provider create [flags]
```

## Examples

```
auth0 phone provider create
auth0 phone provider create --json
auth0 phone provider create --provider twilio --disabled=false --credentials='{ "auth_token":"TheAuthToken" }' --configuration='{ "default_from": "admin@example.com", "sid": "+1234567890", "delivery_methods": ["text", "voice"] }'
auth0 phone provider create --provider custom --disabled=true --configuration='{ "delivery_methods": ["text", "voice"] }
auth0 phone provider create -p twilio -d "false" -c '{ "auth_token":"TheAuthToken" }' -s '{ "default_from": "admin@example.com", "sid": "+1234567890", "delivery_methods": ["text", "voice"] }'
```


## Flags

```
-s, --configuration string Configuration for the phone provider. formatted as JSON.
-c, --credentials string Credentials for the phone provider, formatted as JSON.
-d, --disabled Whether the provided is disabled (true) or enabled (false).
--json Output in json format.
-p, --provider string Provider name. Can be 'twilio', or 'custom'
```


## Inherited Flags

```
--debug Enable debug mode.
--no-color Disable colors.
--no-input Disable interactivity.
--tenant string Specific tenant to use.
```


## Related Commands

- [auth0 phone provider create](auth0_phone_provider_create.md) - Create the phone provider
- [auth0 phone provider delete](auth0_phone_provider_delete.md) - Delete the phone provider
- [auth0 phone provider list](auth0_phone_provider_list.md) - List your Phone providers
- [auth0 phone provider show](auth0_phone_provider_show.md) - Show the Phone provider
- [auth0 phone provider update](auth0_phone_provider_update.md) - Update the phone provider


55 changes: 55 additions & 0 deletions docs/auth0_phone_provider_delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
layout: default
parent: auth0 phone provider
has_toc: false
---
# auth0 phone provider delete

Delete the phone provider.

To delete interactively, use `auth0 phone provider delete` with no arguments.

To delete non-interactively, supply the phone provider id and the `--force` flag to skip confirmation.

## Usage
```
auth0 phone provider delete [flags]
```

## Examples

```
auth0 provider delete
auth0 phone provider rm
auth0 phone provider delete <phone-provider-id> --force
auth0 phone provider delete <phone-provider-id>
auth0 phone provider rm --force
```


## Flags

```
--force Skip confirmation.
```


## Inherited Flags

```
--debug Enable debug mode.
--no-color Disable colors.
--no-input Disable interactivity.
--tenant string Specific tenant to use.
```


## Related Commands

- [auth0 phone provider create](auth0_phone_provider_create.md) - Create the phone provider
- [auth0 phone provider delete](auth0_phone_provider_delete.md) - Delete the phone provider
- [auth0 phone provider list](auth0_phone_provider_list.md) - List your Phone providers
- [auth0 phone provider show](auth0_phone_provider_show.md) - Show the Phone provider
- [auth0 phone provider update](auth0_phone_provider_update.md) - Update the phone provider


51 changes: 51 additions & 0 deletions docs/auth0_phone_provider_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
layout: default
parent: auth0 phone provider
has_toc: false
---
# auth0 phone provider list

List your existing Phone providers. Currently we can create a max of 1 phone Provider, If none are created, you can create one by running `auth0 phone provider create`.

## Usage
```
auth0 phone provider list [flags]
```

## Examples

```
auth0 phone provider list
auth0 phone provider ls
auth0 phone provider ls --json
auth0 phone provider ls --csv
```


## Flags

```
--csv Output in csv format.
--json Output in json format.
```


## Inherited Flags

```
--debug Enable debug mode.
--no-color Disable colors.
--no-input Disable interactivity.
--tenant string Specific tenant to use.
```


## Related Commands

- [auth0 phone provider create](auth0_phone_provider_create.md) - Create the phone provider
- [auth0 phone provider delete](auth0_phone_provider_delete.md) - Delete the phone provider
- [auth0 phone provider list](auth0_phone_provider_list.md) - List your Phone providers
- [auth0 phone provider show](auth0_phone_provider_show.md) - Show the Phone provider
- [auth0 phone provider update](auth0_phone_provider_update.md) - Update the phone provider


48 changes: 48 additions & 0 deletions docs/auth0_phone_provider_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
layout: default
parent: auth0 phone provider
has_toc: false
---
# auth0 phone provider show

Display information about the phone provider.

## Usage
```
auth0 phone provider show [flags]
```

## Examples

```
auth0 phone provider show
auth0 phone provider show --json
```


## Flags

```
--json Output in json format.
```


## Inherited Flags

```
--debug Enable debug mode.
--no-color Disable colors.
--no-input Disable interactivity.
--tenant string Specific tenant to use.
```


## Related Commands

- [auth0 phone provider create](auth0_phone_provider_create.md) - Create the phone provider
- [auth0 phone provider delete](auth0_phone_provider_delete.md) - Delete the phone provider
- [auth0 phone provider list](auth0_phone_provider_list.md) - List your Phone providers
- [auth0 phone provider show](auth0_phone_provider_show.md) - Show the Phone provider
- [auth0 phone provider update](auth0_phone_provider_update.md) - Update the phone provider


62 changes: 62 additions & 0 deletions docs/auth0_phone_provider_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
layout: default
parent: auth0 phone provider
has_toc: false
---
# auth0 phone provider update

Update the phone provider.

To update interactively, use `auth0 phone provider update` with no arguments.

To update non-interactively, supply the provider name and other information through the flags.

## Usage
```
auth0 phone provider update [flags]
```

## Examples

```
auth0 phone provider update
auth0 phone provider update --json
auth0 phone provider update --disabled
auth0 phone provider update --credentials='{ "auth_token":"NewAuthToken" }'
auth0 phone provider update --configuration='{ "delivery_methods": ["voice"] }'
auth0 phone provider update --configuration='{ "default_from": admin@example.com }'
auth0 phone provider update --provider twilio --disabled=false --credentials='{ "auth_token":"NewAuthToken" }' --configuration='{ "default_from": "admin@example.com", "delivery_methods": ["voice", "text"] }'
auth0 phone provider update --provider custom --disabled=false --configuration='{ "delivery_methods": ["voice", "text"] }'
```


## Flags

```
-s, --configuration string Configuration for the phone provider. formatted as JSON.
-c, --credentials string Credentials for the phone provider, formatted as JSON.
-d, --disabled Whether the provided is disabled (true) or enabled (false).
--json Output in json format.
-p, --provider string Provider name. Can be 'twilio', or 'custom'
```


## Inherited Flags

```
--debug Enable debug mode.
--no-color Disable colors.
--no-input Disable interactivity.
--tenant string Specific tenant to use.
```


## Related Commands

- [auth0 phone provider create](auth0_phone_provider_create.md) - Create the phone provider
- [auth0 phone provider delete](auth0_phone_provider_delete.md) - Delete the phone provider
- [auth0 phone provider list](auth0_phone_provider_list.md) - List your Phone providers
- [auth0 phone provider show](auth0_phone_provider_show.md) - Show the Phone provider
- [auth0 phone provider update](auth0_phone_provider_update.md) - Update the phone provider


2 changes: 1 addition & 1 deletion docs/auth0_terraform_generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ auth0 terraform generate [flags]
```
--force Skip confirmation.
-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 "./")
-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_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_pages,auth0_prompt,auth0_prompt_custom_text,auth0_prompt_screen_renderer,auth0_resource_server,auth0_role,auth0_tenant,auth0_trigger_actions])
-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_client,auth0_client_credentials,auth0_client_grant,auth0_connection,auth0_connection_clients,auth0_custom_domain,auth0_email_provider,auth0_email_template,auth0_flow,auth0_flow_vault_connection,auth0_form,auth0_guardian,auth0_log_stream,auth0_organization,auth0_organization_connections,auth0_pages,auth0_prompt,auth0_prompt_custom_text,auth0_prompt_screen_renderer,auth0_resource_server,auth0_resource_server_scopes,auth0_role,auth0_role_permissions,auth0_tenant,auth0_trigger_actions])
-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")
```

Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ Authenticating as a user is not supported for **private cloud** tenants. Instead
- [auth0 apps](auth0_apps.md) - Manage resources for applications
- [auth0 completion](auth0_completion.md) - Setup autocomplete features for this CLI on your terminal
- [auth0 domains](auth0_domains.md) - Manage custom domains
- [auth0 email](auth0_email.md) - Manage email settings
- [auth0 email](auth0_email.md) - Manage email settings and configure email providers
- [auth0 events](auth0_events.md) - Manage Event Stream
- [auth0 login](auth0_login.md) - Authenticate the Auth0 CLI
- [auth0 logout](auth0_logout.md) - Log out of a tenant's session
- [auth0 logs](auth0_logs.md) - View tenant logs
- [auth0 orgs](auth0_orgs.md) - Manage resources for organizations
- [auth0 phone](auth0_phone.md) - Manage phone providers
- [auth0 protection](auth0_protection.md) - Manage resources for attack protection
- [auth0 quickstarts](auth0_quickstarts.md) - Quickstart support for getting bootstrapped
- [auth0 roles](auth0_roles.md) - Manage resources for roles
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ replace github.com/mholt/archiver/v3 => github.com/anchore/archiver/v3 v3.5.2
require (
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/PuerkitoBio/rehttp v1.4.0
github.com/auth0/go-auth0 v1.16.0
github.com/auth0/go-auth0 v1.17.1-0.20250224070739-0a1e74dc9bc6
github.com/briandowns/spinner v1.23.1
github.com/charmbracelet/glamour v0.8.0
github.com/fsnotify/fsnotify v1.7.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
github.com/auth0/go-auth0 v1.16.0 h1:8n6WycyRE0soCEh0gnL15wknnI9srNVP8hk+4vY/OzY=
github.com/auth0/go-auth0 v1.16.0/go.mod h1:f6wP4Hov4Be5AKK55tVhAHlKNltqXQIIc3QGfBbnvdU=
github.com/auth0/go-auth0 v1.17.1-0.20250224070739-0a1e74dc9bc6 h1:dR0J2sszbtGAr0CEBFFqP9RuJyK1EfUwJH++r1mayt0=
github.com/auth0/go-auth0 v1.17.1-0.20250224070739-0a1e74dc9bc6/go.mod h1:f6wP4Hov4Be5AKK55tVhAHlKNltqXQIIc3QGfBbnvdU=
github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 h1:0NmehRCgyk5rljDQLKUO+cRJCnduDyn11+zGZIc9Z48=
github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0/go.mod h1:6L7zgvqo0idzI7IO8de6ZC051AfXb5ipkIJ7bIA2tGA=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
Expand Down
1 change: 1 addition & 0 deletions internal/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ var RequiredScopes = []string{
"create:rules", "delete:rules", "read:rules", "update:rules",
"create:users", "delete:users", "read:users", "update:users",
"read:branding", "update:branding",
"create:phone_providers", "read:phone_providers", "update:phone_providers", "delete:phone_providers",
"create:email_templates", "read:email_templates", "update:email_templates",
"create:email_provider", "read:email_provider", "update:email_provider", "delete:email_provider",
"read:flows", "read:forms", "read:flows_vault_connections",
Expand Down
5 changes: 5 additions & 0 deletions internal/auth0/branding.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ type BrandingAPI interface {
UniversalLogin(ctx context.Context, opts ...management.RequestOption) (ul *management.BrandingUniversalLogin, err error)
SetUniversalLogin(ctx context.Context, ul *management.BrandingUniversalLogin, opts ...management.RequestOption) (err error)
DeleteUniversalLogin(ctx context.Context, opts ...management.RequestOption) (err error)
ListPhoneProviders(ctx context.Context, opts ...management.RequestOption) (pps *management.BrandingPhoneProviderList, err error)
ReadPhoneProvider(ctx context.Context, id string, opts ...management.RequestOption) (pp *management.BrandingPhoneProvider, err error)
CreatePhoneProvider(ctx context.Context, pp *management.BrandingPhoneProvider, opts ...management.RequestOption) (err error)
DeletePhoneProvider(ctx context.Context, id string, opts ...management.RequestOption) (err error)
UpdatePhoneProvider(ctx context.Context, id string, pp *management.BrandingPhoneProvider, opts ...management.RequestOption) (err error)
}
Loading