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

fix: wrong jwtconfig lifetime type #262

merged 3 commits into from
Apr 23, 2021

Conversation

jfatta
Copy link
Contributor

@jfatta jfatta commented Apr 23, 2021

Exclude the jwt_configuration.lifetime_in_seconds file from the Clients.List operation.
We experienced the following error in some cases:

 ▸    json: cannot unmarshal string into Go struct field ClientJWTConfiguration.clients.jwt_configuration.lifetime_in_seconds of type int
exit status 1

From the investigation, it seems that legacy application are returning a jwt_configuration.lifetime_in_seconds of type string instead of *int. Since this field is not used on the CLI, we can safely ignore it for now.

verifying that the field is being excluded
image

apps list command working as expected since the excluded field is not used
image

replicated the issue when logged with a github account, and listing a pretty old application

"jwt_configuration":{
            "lifetime_in_seconds":"36000" <----- this should be a number instead of a string.
         },

// 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

Copy link
Contributor

@Widcket Widcket left a comment

Choose a reason for hiding this comment

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

Thank you!

@Widcket
Copy link
Contributor

Widcket commented Apr 23, 2021

Tried it with Proxyman (key not found in res body) 👍🏼

Screen Shot 2021-04-23 at 16 20 53

@jfatta jfatta merged commit efb1c6f into main Apr 23, 2021
@jfatta jfatta deleted the fix-wrong-jwtconfig-error branch April 23, 2021 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants