-
Notifications
You must be signed in to change notification settings - Fork 37
TAN-5763 JWT token data tool #12427
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
TAN-5763 JWT token data tool #12427
Conversation
|
| jwt_token = json_parse(response_body)[:jwt_token] | ||
|
|
||
| # Test JWT structure (payloads starting with "{" will always start with "eyJ" when encoded) | ||
| expect(jwt_token).to match(/\AeyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\z/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regex generated with Copilot.
back/app/services/user_service.rb
Outdated
| user.save! | ||
| end | ||
|
|
||
| def jwt_token(user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename this method (&/or add a comment) to make it clear what the use case is, as I expect other devs would get confused about which JWT token in used in the the 'regular' requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, for some reason I thought this was a separate service within the admin API engine, but seems like I didn't see that right. I'll rename it or move it somewhere else. Or add a comment indeed.
jinjagit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion to disambiuguate the new jwt token generation method from the existing one(s)
Changelog
Added