diff --git a/internal/cli/apps.go b/internal/cli/apps.go index 6d702bb51..810eb7683 100644 --- a/internal/cli/apps.go +++ b/internal/cli/apps.go @@ -111,6 +111,12 @@ 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, } + exludedFields = []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 { @@ -197,7 +203,7 @@ auth0 apps ls`, if err := ansi.Waiting(func() error { var err error - list, err = cli.api.Client.List() + list, err = cli.api.Client.List(management.ExcludeFields(exludedFields...)) return err }); err != nil { return fmt.Errorf("An unexpected error occurred: %w", err) diff --git a/internal/cli/apps_test.go b/internal/cli/apps_test.go index 7e3aff17e..c161478a5 100644 --- a/internal/cli/apps_test.go +++ b/internal/cli/apps_test.go @@ -11,7 +11,7 @@ import ( "gopkg.in/auth0.v5/management" ) -func TestClientsListCmd(t *testing.T) { +func TestAppsListCmd(t *testing.T) { // Step 1: Setup our client mock for this test. We only care about // Clients so no need to bootstrap other bits. ctrl := gomock.NewController(t) @@ -19,7 +19,7 @@ func TestClientsListCmd(t *testing.T) { clientAPI := auth0.NewMockClientAPI(ctrl) clientAPI.EXPECT(). - List(). + List(gomock.Any()). Return(&management.ClientList{ Clients: []*management.Client{ {