Skip to content

Commit

Permalink
fix: remove shim around lifetime in seconds (#296)
Browse files Browse the repository at this point in the history
Continuation of #276. Connects to go-auth0/auth0#213
  • Loading branch information
cyx authored May 15, 2021
1 parent f5da1ff commit d297e9f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
16 changes: 5 additions & 11 deletions internal/cli/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ var (
Help: "List of grant types supported for this application. Can include code, implicit, refresh-token, credentials, password, password-realm, mfa-oob, mfa-otp, mfa-recovery-code, and device-code.",
IsRequired: false,
}
clientExcludedList = []string{
// woraround for issue when ocassionally
// (probably legacy apps) arrive at the SDK
// with a `lifetime_in_seconds` value as string instead of int:
"jwt_configuration.lifetime_in_seconds",
}
)

func appsCmd(cli *cli) *cobra.Command {
Expand Down Expand Up @@ -199,7 +193,7 @@ auth0 apps ls`,

if err := ansi.Waiting(func() error {
var err error
list, err = cli.api.Client.List(management.ExcludeFields(clientExcludedList...))
list, err = cli.api.Client.List()
return err
}); err != nil {
return fmt.Errorf("An unexpected error occurred: %w", err)
Expand Down Expand Up @@ -239,7 +233,7 @@ auth0 apps show <id>`,

if err := ansi.Waiting(func() error {
var err error
a, err = cli.api.Client.Read(inputs.ID, management.ExcludeFields(clientExcludedList...))
a, err = cli.api.Client.Read(inputs.ID)
return err
}); err != nil {
return fmt.Errorf("Unable to load application. The Id %v specified doesn't exist", inputs.ID)
Expand Down Expand Up @@ -283,7 +277,7 @@ auth0 apps delete <id>`,
}

return ansi.Spinner("Deleting Application", func() error {
_, err := cli.api.Client.Read(inputs.ID, management.ExcludeFields(clientExcludedList...))
_, err := cli.api.Client.Read(inputs.ID)

if err != nil {
return fmt.Errorf("Unable to delete application. The specified Id: %v doesn't exist", inputs.ID)
Expand Down Expand Up @@ -482,7 +476,7 @@ auth0 apps update <id> -n myapp --type [native|spa|regular|m2m]`,
// Load app by id
if err := ansi.Waiting(func() error {
var err error
current, err = cli.api.Client.Read(inputs.ID, management.ExcludeFields(clientExcludedList...))
current, err = cli.api.Client.Read(inputs.ID)
return err
}); err != nil {
return fmt.Errorf("Unable to load application. The Id %v specified doesn't exist", inputs.ID)
Expand Down Expand Up @@ -821,7 +815,7 @@ func interfaceToStringSlice(s []interface{}) []string {
}

func (c *cli) appPickerOptions() (pickerOptions, error) {
list, err := c.api.Client.List(management.ExcludeFields(clientExcludedList...))
list, err := c.api.Client.List()
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/quickstarts.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ auth0 qs download --stack <stack>`,
var client *management.Client
err := ansi.Waiting(func() error {
var err error
client, err = cli.api.Client.Read(inputs.ClientID, management.ExcludeFields(clientExcludedList...))
client, err = cli.api.Client.Read(inputs.ClientID)
return err
})

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (cli *cli) obtainCustomTemplateData(ctx context.Context) (*branding.Templat

g.Go(func() error {
var err error
clients, err = cli.api.Client.List(management.Context(ctx), management.ExcludeFields(clientExcludedList...))
clients, err = cli.api.Client.List(management.Context(ctx))
return err
})

Expand Down
4 changes: 2 additions & 2 deletions internal/cli/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ auth0 test login <client-id> --connection <connection>`,

defer cleanupTempApplication(isTempClient, cli, inputs.ClientID)

client, err := cli.api.Client.Read(inputs.ClientID, management.ExcludeFields(clientExcludedList...))
client, err := cli.api.Client.Read(inputs.ClientID)
if err != nil {
return fmt.Errorf("Unable to find client %s; if you specified a client, please verify it exists, otherwise re-run the command", inputs.ClientID)
}
Expand Down Expand Up @@ -234,7 +234,7 @@ auth0 test token --client-id <id> --audience <audience> --scopes <scope1,scope2>
inputs.ClientID = client.GetClientID()
}

client, err := cli.api.Client.Read(inputs.ClientID, management.ExcludeFields(clientExcludedList...))
client, err := cli.api.Client.Read(inputs.ClientID)
if err != nil {
return fmt.Errorf("Unable to find client %s; if you specified a client, please verify it exists, otherwise re-run the command", inputs.ClientID)
}
Expand Down

0 comments on commit d297e9f

Please sign in to comment.