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

Method customDomainPickerOptions

internal/cli/test.go:370–400  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

368}
369
370func (c *cli) customDomainPickerOptions(ctx context.Context) (pickerOptions, error) {
371 var opts pickerOptions
372
373 domains, err := c.api.CustomDomain.List(ctx)
374 if err != nil {
375 errStatus := err.(management.Error)
376 // 403 is a valid response for free tenants that don't have
377 // custom domains enabled.
378 if errStatus != nil && errStatus.Status() == 403 {
379 return nil, errNoCustomDomains
380 }
381
382 return nil, err
383 }
384
385 for _, d := range domains {
386 if d.GetStatus() != "ready" {
387 continue
388 }
389
390 opts = append(opts, pickerOption{value: d.GetDomain(), label: d.GetDomain()})
391 }
392
393 if len(opts) == 0 {
394 return nil, errNoCustomDomains
395 }
396
397 opts = append(opts, pickerOption{value: "", label: fmt.Sprintf("none (use %s)", c.tenant)})
398
399 return opts, nil
400}
401
402func (c *cli) appPickerWithCreateOption(ctx context.Context) (pickerOptions, error) {
403 options, err := c.appPickerOptions()(ctx)

Callers

nothing calls this directly

Calls 2

ListMethod · 0.65
StatusMethod · 0.45

Tested by

no test coverage detected