From 0b3f46fc011e6d8805f8b52f8aedc3f653ee3a65 Mon Sep 17 00:00:00 2001 From: Cyril David Date: Fri, 14 May 2021 16:46:11 -0700 Subject: [PATCH] fix: remove shim around lifetime in seconds Continuation of #276. Connects to https://github.com/go-auth0/auth0/pull/213 --- internal/cli/apps.go | 16 +++++----------- internal/cli/quickstarts.go | 2 +- internal/cli/template.go | 2 +- internal/cli/test.go | 4 ++-- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/internal/cli/apps.go b/internal/cli/apps.go index c3ba11412..a962bbcb2 100644 --- a/internal/cli/apps.go +++ b/internal/cli/apps.go @@ -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 { @@ -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) @@ -239,7 +233,7 @@ auth0 apps show `, 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) @@ -283,7 +277,7 @@ auth0 apps delete `, } 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) @@ -482,7 +476,7 @@ auth0 apps update -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) @@ -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 } diff --git a/internal/cli/quickstarts.go b/internal/cli/quickstarts.go index d307bed75..030fd6eb1 100644 --- a/internal/cli/quickstarts.go +++ b/internal/cli/quickstarts.go @@ -129,7 +129,7 @@ auth0 qs download --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 }) diff --git a/internal/cli/template.go b/internal/cli/template.go index 18d181b5d..f724ddc1f 100644 --- a/internal/cli/template.go +++ b/internal/cli/template.go @@ -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 }) diff --git a/internal/cli/test.go b/internal/cli/test.go index 0a3ee6d03..17bbebf0c 100644 --- a/internal/cli/test.go +++ b/internal/cli/test.go @@ -134,7 +134,7 @@ auth0 test login --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) } @@ -234,7 +234,7 @@ auth0 test token --client-id --audience --scopes 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) }