Skip to content

Commit

Permalink
Rename --reveal-client-secret to --reveal-secrets in apps cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught committed Jan 10, 2023
1 parent 9ab1c1c commit 9a0f016
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 84 deletions.
32 changes: 16 additions & 16 deletions docs/auth0_apps_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ auth0 apps create [flags]
auth0 apps create --name myapp
auth0 apps create --name myapp --description <description>
auth0 apps create --name myapp --description <description> --type [native|spa|regular|m2m]
auth0 apps create --name myapp --description <description> --type [native|spa|regular|m2m] --reveal-client-secret
auth0 apps create --name myapp --description <description> --type [native|spa|regular|m2m] --reveal-secrets
auth0 apps create -n myapp -d <description> -t [native|spa|regular|m2m] -r --json
```


## Flags

```
-a, --auth-method string Defines the requested authentication method for the token endpoint. Possible values are 'None' (public application without a client secret), 'Post' (application uses HTTP POST parameters) or 'Basic' (application uses HTTP Basic).
-c, --callbacks strings After the user authenticates we will only call back to any of these URLs. You can specify multiple valid URLs by comma-separating them (typically to handle different environments like QA or testing). Make sure to specify the protocol (https://) otherwise the callback may fail in some cases. With the exception of custom URI schemes for native apps, all callbacks should use protocol https://.
-d, --description string Description of the application. Max character count is 140.
-g, --grants strings List of grant types supported for this application. Can include code, implicit, refresh-token, credentials, password, password-realm, mfa-oob, mfa-otp, mfa-recovery-code, and device-code.
--json Output in json format.
-l, --logout-urls strings Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.
-n, --name string Name of the application.
-o, --origins strings Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.
-r, --reveal-client-secret Display the Client Secret as part of the command output.
-t, --type string Type of application:
- native: mobile, desktop, CLI and smart device apps running natively.
- spa (single page application): a JavaScript front-end app that uses an API.
- regular: Traditional web app using redirects.
- m2m (machine to machine): CLIs, daemons or services running on your backend.
-w, --web-origins strings Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode.
-a, --auth-method string Defines the requested authentication method for the token endpoint. Possible values are 'None' (public application without a client secret), 'Post' (application uses HTTP POST parameters) or 'Basic' (application uses HTTP Basic).
-c, --callbacks strings After the user authenticates we will only call back to any of these URLs. You can specify multiple valid URLs by comma-separating them (typically to handle different environments like QA or testing). Make sure to specify the protocol (https://) otherwise the callback may fail in some cases. With the exception of custom URI schemes for native apps, all callbacks should use protocol https://.
-d, --description string Description of the application. Max character count is 140.
-g, --grants strings List of grant types supported for this application. Can include code, implicit, refresh-token, credentials, password, password-realm, mfa-oob, mfa-otp, mfa-recovery-code, and device-code.
--json Output in json format.
-l, --logout-urls strings Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.
-n, --name string Name of the application.
-o, --origins strings Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.
-r, --reveal-secrets signing_keys Display the application secrets (signing_keys, `client_secret`) as part of the command output.
-t, --type string Type of application:
- native: mobile, desktop, CLI and smart device apps running natively.
- spa (single page application): a JavaScript front-end app that uses an API.
- regular: Traditional web app using redirects.
- m2m (machine to machine): CLIs, daemons or services running on your backend.
-w, --web-origins strings Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode.
```


Expand Down
10 changes: 5 additions & 5 deletions docs/auth0_apps_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ auth0 apps list [flags]
```
auth0 apps list
auth0 apps ls
auth0 apps list --reveal-client-secret
auth0 apps list --reveal-client-secret --number 100
auth0 apps list --reveal-secrets
auth0 apps list --reveal-secrets --number 100
auth0 apps ls -r -n 100 --json
```


## Flags

```
--json Output in json format.
-n, --number int Number of apps to retrieve (default 50)
-r, --reveal-client-secret Display the Client Secret as part of the command output.
--json Output in json format.
-n, --number int Number of apps to retrieve (default 50)
-r, --reveal-secrets signing_keys Display the application secrets (signing_keys, `client_secret`) as part of the command output.
```


Expand Down
8 changes: 4 additions & 4 deletions docs/auth0_apps_show.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ auth0 apps show [flags]
```
auth0 apps show
auth0 apps show <app-id>
auth0 apps show <app-id> --reveal-client-secret
auth0 apps show <app-id> --reveal-client-secret --json
auth0 apps show <app-id> --reveal-secrets
auth0 apps show <app-id> -r --json
```


## Flags

```
--json Output in json format.
-r, --reveal-client-secret Display the Client Secret as part of the command output.
--json Output in json format.
-r, --reveal-secrets signing_keys Display the application secrets (signing_keys, `client_secret`) as part of the command output.
```


Expand Down
32 changes: 16 additions & 16 deletions docs/auth0_apps_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ auth0 apps update [flags]
auth0 apps update <app-id> --name myapp
auth0 apps update <app-id> --name myapp --description <description>
auth0 apps update <app-id> --name myapp --description <description> --type [native|spa|regular|m2m]
auth0 apps update <app-id> --name myapp --description <description> --type [native|spa|regular|m2m] --reveal-client-secret
auth0 apps update <app-id> --name myapp --description <description> --type [native|spa|regular|m2m] --reveal-secrets
auth0 apps update <app-id> -n myapp -d <description> -t [native|spa|regular|m2m] -r --json
```


## Flags

```
-a, --auth-method string Defines the requested authentication method for the token endpoint. Possible values are 'None' (public application without a client secret), 'Post' (application uses HTTP POST parameters) or 'Basic' (application uses HTTP Basic).
-c, --callbacks strings After the user authenticates we will only call back to any of these URLs. You can specify multiple valid URLs by comma-separating them (typically to handle different environments like QA or testing). Make sure to specify the protocol (https://) otherwise the callback may fail in some cases. With the exception of custom URI schemes for native apps, all callbacks should use protocol https://.
-d, --description string Description of the application. Max character count is 140.
-g, --grants strings List of grant types supported for this application. Can include code, implicit, refresh-token, credentials, password, password-realm, mfa-oob, mfa-otp, mfa-recovery-code, and device-code.
--json Output in json format.
-l, --logout-urls strings Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.
-n, --name string Name of the application.
-o, --origins strings Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.
-r, --reveal-client-secret Display the Client Secret as part of the command output.
-t, --type string Type of application:
- native: mobile, desktop, CLI and smart device apps running natively.
- spa (single page application): a JavaScript front-end app that uses an API.
- regular: Traditional web app using redirects.
- m2m (machine to machine): CLIs, daemons or services running on your backend.
-w, --web-origins strings Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode.
-a, --auth-method string Defines the requested authentication method for the token endpoint. Possible values are 'None' (public application without a client secret), 'Post' (application uses HTTP POST parameters) or 'Basic' (application uses HTTP Basic).
-c, --callbacks strings After the user authenticates we will only call back to any of these URLs. You can specify multiple valid URLs by comma-separating them (typically to handle different environments like QA or testing). Make sure to specify the protocol (https://) otherwise the callback may fail in some cases. With the exception of custom URI schemes for native apps, all callbacks should use protocol https://.
-d, --description string Description of the application. Max character count is 140.
-g, --grants strings List of grant types supported for this application. Can include code, implicit, refresh-token, credentials, password, password-realm, mfa-oob, mfa-otp, mfa-recovery-code, and device-code.
--json Output in json format.
-l, --logout-urls strings Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.
-n, --name string Name of the application.
-o, --origins strings Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.
-r, --reveal-secrets signing_keys Display the application secrets (signing_keys, `client_secret`) as part of the command output.
-t, --type string Type of application:
- native: mobile, desktop, CLI and smart device apps running natively.
- spa (single page application): a JavaScript front-end app that uses an API.
- regular: Traditional web app using redirects.
- m2m (machine to machine): CLIs, daemons or services running on your backend.
-w, --web-origins strings Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode.
```


Expand Down
84 changes: 42 additions & 42 deletions internal/cli/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ var (
Help: "List of grant types supported for this application. Can include code, implicit, refresh-token, credentials, password, password-realm, mfa-oob, mfa-otp, mfa-recovery-code, and device-code.",
IsRequired: false,
}
revealClientSecret = Flag{
revealSecrets = Flag{
Name: "Reveal",
LongForm: "reveal-client-secret",
LongForm: "reveal-secrets",
ShortForm: "r",
Help: "Display the Client Secret as part of the command output.",
Help: "Display the application secrets (`signing_keys`, `client_secret`) as part of the command output.",
}
number = Flag{
Name: "Number",
Expand Down Expand Up @@ -200,8 +200,8 @@ func useAppCmd(cli *cli) *cobra.Command {

func listAppsCmd(cli *cli) *cobra.Command {
var inputs struct {
RevealClientSecret bool
Number int
RevealSecrets bool
Number int
}

cmd := &cobra.Command{
Expand All @@ -212,8 +212,8 @@ func listAppsCmd(cli *cli) *cobra.Command {
Long: "List your existing applications. To create one, run: `auth0 apps create`.",
Example: ` auth0 apps list
auth0 apps ls
auth0 apps list --reveal-client-secret
auth0 apps list --reveal-client-secret --number 100
auth0 apps list --reveal-secrets
auth0 apps list --reveal-secrets --number 100
auth0 apps ls -r -n 100 --json`,
RunE: func(cmd *cobra.Command, args []string) error {
list, err := getWithPagination(
Expand All @@ -237,22 +237,22 @@ func listAppsCmd(cli *cli) *cobra.Command {
for _, item := range list {
typedList = append(typedList, item.(*management.Client))
}
cli.renderer.ApplicationList(typedList, inputs.RevealClientSecret)
cli.renderer.ApplicationList(typedList, inputs.RevealSecrets)
return nil
},
}

cmd.Flags().BoolVar(&cli.json, "json", false, "Output in json format.")
revealClientSecret.RegisterBool(cmd, &inputs.RevealClientSecret, false)
revealSecrets.RegisterBool(cmd, &inputs.RevealSecrets, false)
number.RegisterInt(cmd, &inputs.Number, defaultPageSize)

return cmd
}

func showAppCmd(cli *cli) *cobra.Command {
var inputs struct {
ID string
RevealClientSecret bool
ID string
RevealSecrets bool
}

cmd := &cobra.Command{
Expand All @@ -262,8 +262,8 @@ func showAppCmd(cli *cli) *cobra.Command {
Long: "Display the name, description, app type, and other information about an application.",
Example: ` auth0 apps show
auth0 apps show <app-id>
auth0 apps show <app-id> --reveal-client-secret
auth0 apps show <app-id> --reveal-client-secret --json`,
auth0 apps show <app-id> --reveal-secrets
auth0 apps show <app-id> -r --json`,
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
err := appID.Pick(cmd, &inputs.ID, cli.appPickerOptions)
Expand All @@ -284,13 +284,13 @@ func showAppCmd(cli *cli) *cobra.Command {
return fmt.Errorf("Unable to load application: %w", err)
}

cli.renderer.ApplicationShow(a, inputs.RevealClientSecret)
cli.renderer.ApplicationShow(a, inputs.RevealSecrets)
return nil
},
}

cmd.Flags().BoolVar(&cli.json, "json", false, "Output in json format.")
revealClientSecret.RegisterBool(cmd, &inputs.RevealClientSecret, false)
revealSecrets.RegisterBool(cmd, &inputs.RevealSecrets, false)

return cmd
}
Expand Down Expand Up @@ -348,16 +348,16 @@ func deleteAppCmd(cli *cli) *cobra.Command {

func createAppCmd(cli *cli) *cobra.Command {
var inputs struct {
Name string
Type string
Description string
Callbacks []string
AllowedOrigins []string
AllowedWebOrigins []string
AllowedLogoutURLs []string
AuthMethod string
Grants []string
RevealClientSecret bool
Name string
Type string
Description string
Callbacks []string
AllowedOrigins []string
AllowedWebOrigins []string
AllowedLogoutURLs []string
AuthMethod string
Grants []string
RevealSecrets bool
}
var oidcConformant = true
var algorithm = "RS256"
Expand All @@ -373,7 +373,7 @@ func createAppCmd(cli *cli) *cobra.Command {
auth0 apps create --name myapp
auth0 apps create --name myapp --description <description>
auth0 apps create --name myapp --description <description> --type [native|spa|regular|m2m]
auth0 apps create --name myapp --description <description> --type [native|spa|regular|m2m] --reveal-client-secret
auth0 apps create --name myapp --description <description> --type [native|spa|regular|m2m] --reveal-secrets
auth0 apps create -n myapp -d <description> -t [native|spa|regular|m2m] -r --json`,
RunE: func(cmd *cobra.Command, args []string) error {
// Prompt for app name
Expand Down Expand Up @@ -478,7 +478,7 @@ func createAppCmd(cli *cli) *cobra.Command {
}

// Render result
cli.renderer.ApplicationCreate(a, inputs.RevealClientSecret)
cli.renderer.ApplicationCreate(a, inputs.RevealSecrets)

return nil
},
Expand All @@ -494,24 +494,24 @@ func createAppCmd(cli *cli) *cobra.Command {
appLogoutURLs.RegisterStringSlice(cmd, &inputs.AllowedLogoutURLs, nil)
appAuthMethod.RegisterString(cmd, &inputs.AuthMethod, "")
appGrants.RegisterStringSlice(cmd, &inputs.Grants, nil)
revealClientSecret.RegisterBool(cmd, &inputs.RevealClientSecret, false)
revealSecrets.RegisterBool(cmd, &inputs.RevealSecrets, false)

return cmd
}

func updateAppCmd(cli *cli) *cobra.Command {
var inputs struct {
ID string
Name string
Type string
Description string
Callbacks []string
AllowedOrigins []string
AllowedWebOrigins []string
AllowedLogoutURLs []string
AuthMethod string
Grants []string
RevealClientSecret bool
ID string
Name string
Type string
Description string
Callbacks []string
AllowedOrigins []string
AllowedWebOrigins []string
AllowedLogoutURLs []string
AuthMethod string
Grants []string
RevealSecrets bool
}

cmd := &cobra.Command{
Expand All @@ -526,7 +526,7 @@ func updateAppCmd(cli *cli) *cobra.Command {
auth0 apps update <app-id> --name myapp
auth0 apps update <app-id> --name myapp --description <description>
auth0 apps update <app-id> --name myapp --description <description> --type [native|spa|regular|m2m]
auth0 apps update <app-id> --name myapp --description <description> --type [native|spa|regular|m2m] --reveal-client-secret
auth0 apps update <app-id> --name myapp --description <description> --type [native|spa|regular|m2m] --reveal-secrets
auth0 apps update <app-id> -n myapp -d <description> -t [native|spa|regular|m2m] -r --json`,
RunE: func(cmd *cobra.Command, args []string) error {
var current *management.Client
Expand Down Expand Up @@ -688,7 +688,7 @@ func updateAppCmd(cli *cli) *cobra.Command {
}

// Render result
cli.renderer.ApplicationUpdate(a, inputs.RevealClientSecret)
cli.renderer.ApplicationUpdate(a, inputs.RevealSecrets)

return nil
},
Expand All @@ -704,7 +704,7 @@ func updateAppCmd(cli *cli) *cobra.Command {
appLogoutURLs.RegisterStringSliceU(cmd, &inputs.AllowedLogoutURLs, nil)
appAuthMethod.RegisterStringU(cmd, &inputs.AuthMethod, "")
appGrants.RegisterStringSliceU(cmd, &inputs.Grants, nil)
revealClientSecret.RegisterBool(cmd, &inputs.RevealClientSecret, false)
revealSecrets.RegisterBool(cmd, &inputs.RevealSecrets, false)

return cmd
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestAppsListCmd(t *testing.T) {
},
{
name: "reveal secrets",
args: []string{"--reveal-client-secret"},
args: []string{"--reveal-secrets"},
assertOutput: func(t testing.TB, out string) {
expectTable(t, out,
[]string{"CLIENT ID", "NAME", "TYPE", "CLIENT SECRET"},
Expand Down

0 comments on commit 9a0f016

Please sign in to comment.