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

Method appPickerOptions

internal/cli/apps.go:1111–1149  ·  view source on GitHub ↗
(requestOpts ...management.RequestOption)

Source from the content-addressed store, hash-verified

1109}
1110
1111func (c *cli) appPickerOptions(requestOpts ...management.RequestOption) pickerOptionsFunc {
1112 requestOpts = append(requestOpts, management.Parameter("is_global", "false"))
1113
1114 return func(ctx context.Context) (pickerOptions, error) {
1115 clientList, err := c.api.Client.List(ctx, requestOpts...)
1116 if err != nil {
1117 return nil, fmt.Errorf("failed to list applications: %w", err)
1118 }
1119
1120 tenant, err := c.Config.GetTenant(c.tenant)
1121 if err != nil {
1122 return nil, err
1123 }
1124
1125 var priorityOpts, opts pickerOptions
1126 for _, client := range clientList.Clients {
1127 value := client.GetClientID()
1128 label := fmt.Sprintf(
1129 "%s [%s] %s",
1130 client.GetName(),
1131 display.ApplyColorToFriendlyAppType(display.FriendlyAppType(client.GetAppType())),
1132 ansi.Faint("("+value+")"),
1133 )
1134 option := pickerOption{value: value, label: label}
1135
1136 if tenant.DefaultAppID == client.GetClientID() {
1137 priorityOpts = append(priorityOpts, option)
1138 } else {
1139 opts = append(opts, option)
1140 }
1141 }
1142
1143 if len(opts)+len(priorityOpts) == 0 {
1144 return nil, errNoApps
1145 }
1146
1147 return append(priorityOpts, opts...), nil
1148 }
1149}
1150
1151// Session Transfer.
1152func appsSessionTransferCmd(cli *cli) *cobra.Command {

Callers 11

fromArgsMethod · 0.80
resolveAPIAppLinkFunction · 0.80
useAppCmdFunction · 0.80
showAppCmdFunction · 0.80
deleteAppCmdFunction · 0.80
updateAppCmdFunction · 0.80
openAppCmdFunction · 0.80

Calls 7

FriendlyAppTypeFunction · 0.92
FaintFunction · 0.92
ErrorfMethod · 0.80
GetTenantMethod · 0.80
ListMethod · 0.65
GetNameMethod · 0.65

Tested by

no test coverage detected