-
Notifications
You must be signed in to change notification settings - Fork 621
fix: throw if a protected prop is passed to JWTDataAPI #630
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
Conversation
if (getVersionFromRequest(req).greaterThanOrEqualTo(SemVer.v2_21) && | ||
Arrays.stream(protectedPropNames).anyMatch(userDataInJWT::has)) { | ||
throw new ServletException(new BadRequestException("The user payload contains protected field")); | ||
} |
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.
these checks should not happen here, instead, update updateSession to have this check, and create another updateSessionBeforeCDI2_21 without the check and mark that as deprecated
|
||
if (Arrays.stream(protectedPropNames).anyMatch(userDataInJWT::has)) { | ||
throw new ServletException(new BadRequestException("The user payload contains protected field")); | ||
} |
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.
if (Arrays.stream(protectedPropNames).anyMatch(userDataInJWT::has)) { | |
throw new ServletException(new BadRequestException("The user payload contains protected field")); | |
} |
if (getVersionFromRequest(req).greaterThanOrEqualTo(SemVer.v2_21) && | ||
userDataInJWT != null && | ||
Arrays.stream(protectedPropNames).anyMatch(userDataInJWT::has)) { | ||
throw new ServletException(new BadRequestException("The user payload contains protected field")); | ||
} |
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.
if (getVersionFromRequest(req).greaterThanOrEqualTo(SemVer.v2_21) && | |
userDataInJWT != null && | |
Arrays.stream(protectedPropNames).anyMatch(userDataInJWT::has)) { | |
throw new ServletException(new BadRequestException("The user payload contains protected field")); | |
} | |
Summary of change
Related issues
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your
changes work. Bonus points for screenshots and videos!)
Documentation changes
(If relevant, please create a PR in our docs repo, or create a checklist here
highlighting the necessary changes)
Checklist for important updates
coreDriverInterfaceSupported.json
file has been updated (if needed)pluginInterfaceSupported.json
file has been updated (if needed)build.gradle
getPaidFeatureStats
function in FeatureFlag.java filebuild.gradle
, please make sure to add themin
implementationDependencies.json
.git tag
) in the formatvX.Y.Z
, and then find thelatest branch (
git branch --all
) whoseX.Y
is greater than the latest released tag.Remaining TODOs for this PR