(cli *cli)
| 677 | } |
| 678 | |
| 679 | func 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) |
no test coverage detected