Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong jwtconfig lifetime type #262

Merged
merged 3 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()).
Copy link
Contributor Author

@jfatta jfatta Apr 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

creating a matcher for this can be really tricky because it is a function that takes a request and apply the changes. I don't it would add a fundamental value to the test, but let me know

Return(&management.ClientList{
Clients: []*management.Client{
{
Expand Down