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

Function verifyCustomDomainCmd

internal/cli/custom_domains.go:466–508  ·  view source on GitHub ↗
(cli *cli)

Source from the content-addressed store, hash-verified

464}
465
466func verifyCustomDomainCmd(cli *cli) *cobra.Command {
467 var inputs struct {
468 ID string
469 }
470
471 cmd := &cobra.Command{
472 Use: "verify",
473 Args: cobra.MaximumNArgs(1),
474 Short: "Verify a custom domain",
475 Long: "Verify a custom domain.\n\n" +
476 "To verify interactively, use `auth0 domains verify` with no arguments.\n\n" +
477 "To verify non-interactively, supply the custom domain id.",
478 Example: ` auth0 domains verify
479 auth0 domains verify <domain-id>`,
480 RunE: func(cmd *cobra.Command, args []string) error {
481 if len(args) == 0 {
482 if err := customDomainID.Pick(cmd, &inputs.ID, cli.customDomainsPickerOptions); err != nil {
483 return err
484 }
485 } else {
486 inputs.ID = args[0]
487 }
488
489 var customDomain *management.CustomDomain
490
491 if err := ansi.Waiting(func() (err error) {
492 customDomain, err = cli.api.CustomDomain.Verify(cmd.Context(), url.PathEscape(inputs.ID))
493 return err
494 }); err != nil {
495 return fmt.Errorf("failed to verify custom domain with ID %q: %w", inputs.ID, err)
496 }
497
498 cli.renderer.CustomDomainShow(customDomain)
499
500 return nil
501 },
502 }
503
504 cmd.Flags().BoolVar(&cli.json, "json", false, "Output in json format.")
505 cmd.Flags().BoolVar(&cli.jsonCompact, "json-compact", false, "Output in compact json format.")
506
507 return cmd
508}
509
510func apiProvisioningTypeFor(v string) *string {
511 switch v {

Callers 1

customDomainsCmdFunction · 0.85

Calls 5

WaitingFunction · 0.92
ErrorfMethod · 0.80
CustomDomainShowMethod · 0.80
VerifyMethod · 0.65
PickMethod · 0.45

Tested by

no test coverage detected