MCPcopy Create free account
hub / github.com/auth0/auth0-cli / updateAppCmd

Function updateAppCmd

internal/cli/apps.go:679–937  ·  view source on GitHub ↗
(cli *cli)

Source from the content-addressed store, hash-verified

677}
678
679func updateAppCmd(cli *cli) *cobra.Command {
680 var inputs struct {
681 ID string
682 Name string
683 Type string
684 Description string
685 Callbacks []string
686 AllowedOrigins []string
687 AllowedWebOrigins []string
688 AllowedLogoutURLs []string
689 AuthMethod string
690 Grants []string
691 RevealSecrets bool
692 Metadata map[string]string
693 RefreshToken string
694 AllowAnyProfileOfType []string
695 IsFirstParty bool
696 ThirdPartySecurityMode string
697 RedirectionPolicy string
698 }
699
700 cmd := &cobra.Command{
701 Use: "update",
702 Args: cobra.MaximumNArgs(1),
703 Short: "Update an application",
704 Long: "Update an application.\n\n" +
705 "To update interactively, use `auth0 apps update` with no arguments.\n\n" +
706 "To update non-interactively, supply the application id, name, type and other information you " +
707 "might want to change through the available flags.",
708 Example: ` auth0 apps update
709 auth0 apps update <app-id> --name myapp
710 auth0 apps update <app-id> --name myapp --description <description>
711 auth0 apps update <app-id> --name myapp --description <description> --type [native|spa|regular|m2m]
712 auth0 apps update <app-id> --name myapp --description <description> --type [native|spa|regular|m2m] --reveal-secrets
713 auth0 apps update <app-id> -n myapp -d <description> -t [native|spa|regular|m2m] -r --json
714 auth0 apps update <app-id> -n myapp -d <description> -t [native|spa|regular|m2m] -r --json-compact
715 auth0 apps update <app-id> -n myapp -d <description> -t [native|spa|regular|m2m] -r --json --metadata "foo=bar"
716 auth0 apps update <app-id> -n myapp -d <description> -t [native|spa|regular|m2m] -r --json --metadata "foo=bar" --metadata "bazz=buzz"
717 auth0 apps update <app-id> -n myapp -d <description> -t [native|spa|regular|m2m] -r --json --metadata "foo=bar,bazz=buzz"
718 auth0 apps update <app-id> --allow-any-profile-of-type custom_authentication,on_behalf_of_token_exchange
719 auth0 apps update <app-id> --redirection-policy allow_always`,
720 RunE: func(cmd *cobra.Command, args []string) error {
721 var current *management.Client
722
723 if len(args) == 0 {
724 err := appID.Pick(cmd, &inputs.ID, cli.appPickerOptions())
725 if err != nil {
726 return err
727 }
728 } else {
729 inputs.ID = args[0]
730 }
731
732 if err := ansi.Waiting(func() (err error) {
733 current, err = cli.api.Client.Read(cmd.Context(), inputs.ID)
734 return err
735 }); err != nil {
736 return fmt.Errorf("failed to find application with ID %q: %w", inputs.ID, err)

Callers 1

appsCmdFunction · 0.85

Calls 15

WaitingFunction · 0.92
typeForFunction · 0.85
apiTypeForFunction · 0.85
apiAuthMethodForFunction · 0.85
apiGrantsForFunction · 0.85
excludeEmptyEntriesFunction · 0.85
appPickerOptionsMethod · 0.80
ErrorfMethod · 0.80
AskUMethod · 0.80
SelectUMethod · 0.80
AskManyUMethod · 0.80
IsSetMethod · 0.80

Tested by

no test coverage detected