Skip to content

Commit

Permalink
Merge branch 'v1' of https://github.com/auth0/auth0-cli into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
willvedd committed Jan 18, 2023
2 parents 2ce5e67 + 7184197 commit 8d756cc
Show file tree
Hide file tree
Showing 43 changed files with 720 additions and 56 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
From the top-level directory:
```
$ make build
$ ./auth0 --help
$ ./out/auth0 --help
```

## Adding a new command
Expand Down Expand Up @@ -41,7 +41,7 @@ We use vendoring, so the last step is required.

> This is only possible if you're a repository maintainer.
The release is driven by a Github **workflow** triggered when a new **tag** is **created**. The workflow will run the checks and trigger _Goreleaser_ to:
The release is driven by a GitHub **workflow** triggered when a new **tag** is **created**. The workflow will run the checks and trigger _Goreleaser_ to:
- create the Release with the proper description (changelog)
- upload the binaries for the different architectures
- update https://github.com/auth0/homebrew-auth0-cli with the latest binary reference
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,7 @@ test-unit: ## Run unit tests
test-integration: $(GO_BIN)/commander ## Run integration tests. To run a specific test pass the FILTER var. Usage: `make test-integration FILTER="attack protection"`
${call print, "Running integration tests"}
@$(MAKE) install # ensure fresh install prior to running test
auth0 login --domain ${AUTH0_CLI_CLIENT_DOMAIN} --client-id ${AUTH0_CLI_CLIENT_ID} --client-secret ${AUTH0_CLI_CLIENT_SECRET} && commander test ./test/integration/test-cases.yaml --filter "$(FILTER)"; \
exit_code=$$?; \
bash ./test/integration/scripts/test-cleanup.sh; \
exit $$exit_code
@bash ./test/integration/scripts/run-test-suites.sh

test-mocks: $(GO_BIN)/mockgen ## Generate testing mocks using mockgen
${call print, "Generating test mocks"}
Expand Down
1 change: 1 addition & 0 deletions docs/auth0_actions_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ auth0 actions update [flags]
```
-c, --code string Code content for the action.
-d, --dependency stringToString Third party npm module, and its version, that the action depends on. (default [])
--force Skip confirmation.
--json Output in json format.
-n, --name string Name of the action.
-s, --secret stringToString Secrets to be used in the action. (default [])
Expand Down
2 changes: 1 addition & 1 deletion docs/auth0_apis_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ auth0 apis list [flags]

```
--json Output in json format.
-n, --number int Number of apps to retrieve (default 50)
-n, --number int Number of APIs to retrieve. Minimum 1, maximum 1000. (default 50)
```


Expand Down
2 changes: 1 addition & 1 deletion docs/auth0_apps_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ auth0 apps list [flags]

```
--json Output in json format.
-n, --number int Number of apps to retrieve (default 50)
-n, --number int Number of apps to retrieve. Minimum 1, maximum 1000. (default 50)
-r, --reveal-secrets Display the application secrets ('signing_keys', 'client_secret') as part of the command output.
```

Expand Down
1 change: 1 addition & 0 deletions docs/auth0_email_templates_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ auth0 email templates update [flags]
```
-b, --body string Body of the email template.
-e, --enabled Whether the template is enabled (true) or disabled (false). (default true)
--force Skip confirmation.
-f, --from string Sender's 'from' email address.
--json Output in json format.
-l, --lifetime int Lifetime in seconds that the link within the email will be valid for.
Expand Down
2 changes: 1 addition & 1 deletion docs/auth0_orgs_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ auth0 orgs list [flags]

```
--json Output in json format.
-n, --number int Number of apps to retrieve (default 50)
-n, --number int Number of organizations to retrieve. Minimum 1, maximum 1000. (default 50)
```


Expand Down
2 changes: 1 addition & 1 deletion docs/auth0_orgs_members_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ auth0 orgs members list [flags]

```
--json Output in json format.
-n, --number int Number of apps to retrieve (default 50)
-n, --number int Number of organization members to retrieve. Minimum 1, maximum 1000. (default 50)
```


Expand Down
2 changes: 1 addition & 1 deletion docs/auth0_orgs_roles_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ auth0 orgs roles list [flags]

```
--json Output in json format.
-n, --number int Number of apps to retrieve (default 50)
-n, --number int Number of organization roles to retrieve. Minimum 1, maximum 1000. (default 50)
```


Expand Down
2 changes: 1 addition & 1 deletion docs/auth0_orgs_roles_members_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ auth0 orgs roles members list [flags]

```
--json Output in json format.
-n, --number int Number of apps to retrieve (default 50)
-n, --number int Number of members to retrieve. Minimum 1, maximum 1000. (default 50)
-r, --role-id string Role Identifier.
```

Expand Down
2 changes: 1 addition & 1 deletion docs/auth0_roles_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ auth0 roles list [flags]

```
--json Output in json format.
-n, --number int Number of apps to retrieve (default 50)
-n, --number int Number of roles to retrieve. Minimum 1, maximum 1000. (default 50)
```


Expand Down
6 changes: 4 additions & 2 deletions docs/auth0_roles_permissions_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ auth0 roles permissions list [flags]
```
auth0 roles permissions list
auth0 roles permissions ls <role-id>
auth0 roles permissions ls <role-id> --json
auth0 roles permissions ls <role-id> --number 100
auth0 roles permissions ls <role-id> -n 100 --json
```


## Flags

```
--json Output in json format.
--json Output in json format.
-n, --number int Number of permissions to retrieve. Minimum 1, maximum 1000. (default 50)
```


Expand Down
1 change: 1 addition & 0 deletions docs/auth0_rules_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ auth0 rules update [flags]

```
-e, --enabled Enable (or disable) a rule. (default true)
--force Skip confirmation.
--json Output in json format.
-n, --name string Name of the rule.
-s, --script string Script contents for the rule.
Expand Down
1 change: 1 addition & 0 deletions docs/auth0_users.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Manage resources for users.
- [auth0 users delete](auth0_users_delete.md) - Delete a user
- [auth0 users import](auth0_users_import.md) - Import users from schema
- [auth0 users open](auth0_users_open.md) - Open the user's settings page
- [auth0 users roles](auth0_users_roles.md) - Manage a user's roles
- [auth0 users search](auth0_users_search.md) - Search for users
- [auth0 users show](auth0_users_show.md) - Show an existing user
- [auth0 users unblock](auth0_users_unblock.md) - Remove brute-force protection blocks for a given user
Expand Down
1 change: 1 addition & 0 deletions docs/auth0_users_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ auth0 users create [flags]
- [auth0 users delete](auth0_users_delete.md) - Delete a user
- [auth0 users import](auth0_users_import.md) - Import users from schema
- [auth0 users open](auth0_users_open.md) - Open the user's settings page
- [auth0 users roles](auth0_users_roles.md) - Manage a user's roles
- [auth0 users search](auth0_users_search.md) - Search for users
- [auth0 users show](auth0_users_show.md) - Show an existing user
- [auth0 users unblock](auth0_users_unblock.md) - Remove brute-force protection blocks for a given user
Expand Down
1 change: 1 addition & 0 deletions docs/auth0_users_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ auth0 users delete [flags]
- [auth0 users delete](auth0_users_delete.md) - Delete a user
- [auth0 users import](auth0_users_import.md) - Import users from schema
- [auth0 users open](auth0_users_open.md) - Open the user's settings page
- [auth0 users roles](auth0_users_roles.md) - Manage a user's roles
- [auth0 users search](auth0_users_search.md) - Search for users
- [auth0 users show](auth0_users_show.md) - Show an existing user
- [auth0 users unblock](auth0_users_unblock.md) - Remove brute-force protection blocks for a given user
Expand Down
1 change: 1 addition & 0 deletions docs/auth0_users_import.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ auth0 users import [flags]
- [auth0 users delete](auth0_users_delete.md) - Delete a user
- [auth0 users import](auth0_users_import.md) - Import users from schema
- [auth0 users open](auth0_users_open.md) - Open the user's settings page
- [auth0 users roles](auth0_users_roles.md) - Manage a user's roles
- [auth0 users search](auth0_users_search.md) - Search for users
- [auth0 users show](auth0_users_show.md) - Show an existing user
- [auth0 users unblock](auth0_users_unblock.md) - Remove brute-force protection blocks for a given user
Expand Down
1 change: 1 addition & 0 deletions docs/auth0_users_open.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ auth0 users open [flags]
- [auth0 users delete](auth0_users_delete.md) - Delete a user
- [auth0 users import](auth0_users_import.md) - Import users from schema
- [auth0 users open](auth0_users_open.md) - Open the user's settings page
- [auth0 users roles](auth0_users_roles.md) - Manage a user's roles
- [auth0 users search](auth0_users_search.md) - Search for users
- [auth0 users show](auth0_users_show.md) - Show an existing user
- [auth0 users unblock](auth0_users_unblock.md) - Remove brute-force protection blocks for a given user
Expand Down
13 changes: 13 additions & 0 deletions docs/auth0_users_roles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: default
---
# auth0 users roles

Manage a user's assigned roles. To learn more about roles and their behavior, read [Role-based Access Control](https://auth0.com/docs/manage-users/access-control/rbac).

## Commands

- [auth0 users roles assign](auth0_users_roles_assign.md) - Assign roles to a user
- [auth0 users roles remove](auth0_users_roles_remove.md) - Remove roles from a user
- [auth0 users roles show](auth0_users_roles_show.md) - Show a user's roles

46 changes: 46 additions & 0 deletions docs/auth0_users_roles_assign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: default
---
# auth0 users roles assign

Assign existing roles to a user.

## Usage
```
auth0 users roles assign [flags]
```

## Examples

```
auth0 users roles assign <user-id>
auth0 users roles add <user-id> --roles <role-id1,role-id2>
auth0 users roles add <user-id> -r "rol_1eKJp3jV04SiU04h,rol_2eKJp3jV04SiU04h" --json
```


## Flags

```
--json Output in json format.
-r, --roles strings Roles to assign to a user.
```


## InheritedFlags

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


## Related Commands

- [auth0 users roles assign](auth0_users_roles_assign.md) - Assign roles to a user
- [auth0 users roles remove](auth0_users_roles_remove.md) - Remove roles from a user
- [auth0 users roles show](auth0_users_roles_show.md) - Show a user's roles


46 changes: 46 additions & 0 deletions docs/auth0_users_roles_remove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: default
---
# auth0 users roles remove

Remove existing roles from a user.

## Usage
```
auth0 users roles remove [flags]
```

## Examples

```
auth0 users roles remove <user-id>
auth0 users roles remove <user-id> --roles <role-id1,role-id2>
auth0 users roles rm <user-id> -r "rol_1eKJp3jV04SiU04h,rol_2eKJp3jV04SiU04h" --json
```


## Flags

```
--json Output in json format.
-r, --roles strings Roles to assign to a user.
```


## InheritedFlags

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


## Related Commands

- [auth0 users roles assign](auth0_users_roles_assign.md) - Assign roles to a user
- [auth0 users roles remove](auth0_users_roles_remove.md) - Remove roles from a user
- [auth0 users roles show](auth0_users_roles_show.md) - Show a user's roles


47 changes: 47 additions & 0 deletions docs/auth0_users_roles_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
layout: default
---
# auth0 users roles show

Display information about an existing user's assigned roles.

## Usage
```
auth0 users roles show [flags]
```

## Examples

```
auth0 users roles show
auth0 users roles show <user-id>
auth0 users roles show <user-id> --number 100
auth0 users roles show <user-id> -n 100 --json
```


## Flags

```
--json Output in json format.
-n, --number int Number of user roles to retrieve. Minimum 1, maximum 1000. (default 50)
```


## InheritedFlags

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


## Related Commands

- [auth0 users roles assign](auth0_users_roles_assign.md) - Assign roles to a user
- [auth0 users roles remove](auth0_users_roles_remove.md) - Remove roles from a user
- [auth0 users roles show](auth0_users_roles_show.md) - Show a user's roles


3 changes: 2 additions & 1 deletion docs/auth0_users_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ auth0 users search [flags]

```
--json Output in json format.
-n, --number int Number of users, that match the search criteria, to retrieve. Maximum result number is 1000. If limit is hit, please refine the search query. (default 50)
-n, --number int Number of users, that match the search criteria, to retrieve. Minimum 1, maximum 1000. If limit is hit, refine the search query. (default 50)
-q, --query string Query in Lucene query syntax. See https://auth0.com/docs/users/user-search/user-search-query-syntax for more details.
-s, --sort string Field to sort by. Use 'field:order' where 'order' is '1' for ascending and '-1' for descending. e.g. 'created_at:1'.
```
Expand All @@ -48,6 +48,7 @@ auth0 users search [flags]
- [auth0 users delete](auth0_users_delete.md) - Delete a user
- [auth0 users import](auth0_users_import.md) - Import users from schema
- [auth0 users open](auth0_users_open.md) - Open the user's settings page
- [auth0 users roles](auth0_users_roles.md) - Manage a user's roles
- [auth0 users search](auth0_users_search.md) - Search for users
- [auth0 users show](auth0_users_show.md) - Show an existing user
- [auth0 users unblock](auth0_users_unblock.md) - Remove brute-force protection blocks for a given user
Expand Down
1 change: 1 addition & 0 deletions docs/auth0_users_show.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ auth0 users show [flags]
- [auth0 users delete](auth0_users_delete.md) - Delete a user
- [auth0 users import](auth0_users_import.md) - Import users from schema
- [auth0 users open](auth0_users_open.md) - Open the user's settings page
- [auth0 users roles](auth0_users_roles.md) - Manage a user's roles
- [auth0 users search](auth0_users_search.md) - Search for users
- [auth0 users show](auth0_users_show.md) - Show an existing user
- [auth0 users unblock](auth0_users_unblock.md) - Remove brute-force protection blocks for a given user
Expand Down
1 change: 1 addition & 0 deletions docs/auth0_users_unblock.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ auth0 users unblock [flags]
- [auth0 users delete](auth0_users_delete.md) - Delete a user
- [auth0 users import](auth0_users_import.md) - Import users from schema
- [auth0 users open](auth0_users_open.md) - Open the user's settings page
- [auth0 users roles](auth0_users_roles.md) - Manage a user's roles
- [auth0 users search](auth0_users_search.md) - Search for users
- [auth0 users show](auth0_users_show.md) - Show an existing user
- [auth0 users unblock](auth0_users_unblock.md) - Remove brute-force protection blocks for a given user
Expand Down
1 change: 1 addition & 0 deletions docs/auth0_users_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ auth0 users update [flags]
- [auth0 users delete](auth0_users_delete.md) - Delete a user
- [auth0 users import](auth0_users_import.md) - Import users from schema
- [auth0 users open](auth0_users_open.md) - Open the user's settings page
- [auth0 users roles](auth0_users_roles.md) - Manage a user's roles
- [auth0 users search](auth0_users_search.md) - Search for users
- [auth0 users show](auth0_users_show.md) - Show an existing user
- [auth0 users unblock](auth0_users_unblock.md) - Remove brute-force protection blocks for a given user
Expand Down
2 changes: 1 addition & 1 deletion internal/ansi/ansi.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func Color() aurora.Aurora {

// Initialize re-instantiates the Aurora instance
// This initialization step is necessary because the parsing of the
// --no-color flag is done fairly late in the application cycle
// --no-color flag is done fairly late in the application cycle.
func Initialize(shouldDisableColors bool) {
DisableColors = shouldDisableColors
color = Color()
Expand Down
5 changes: 5 additions & 0 deletions internal/auth0/email_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ package auth0
import "github.com/auth0/go-auth0/management"

type EmailTemplateAPI interface {
// Create an email template.
//
// See: https://auth0.com/docs/api/management/v2#!/Email_Templates/post_email_templates
Create(template *management.EmailTemplate, opts ...management.RequestOption) error

// Read an email template by pre-defined name.
//
// These names are `verify_email`, `reset_email`, `welcome_email`,
Expand Down
Loading

0 comments on commit 8d756cc

Please sign in to comment.