Skip to content

Commit

Permalink
fix: wrong jwtconfig lifetime type (#262)
Browse files Browse the repository at this point in the history
* fix: wrong jwtconfig lifetime type

* fix test

Co-authored-by: Rita Zerrizuela <[email protected]>
  • Loading branch information
jfatta and Widcket authored Apr 23, 2021
1 parent 0f4fee7 commit efb1c6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion internal/cli/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ 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)
defer ctrl.Finish()

clientAPI := auth0.NewMockClientAPI(ctrl)
clientAPI.EXPECT().
List().
List(gomock.Any()).
Return(&management.ClientList{
Clients: []*management.Client{
{
Expand Down

0 comments on commit efb1c6f

Please sign in to comment.