-
Notifications
You must be signed in to change notification settings - Fork 159
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
Update nextUrl validation to incorporate serverBasePath #2048
Update nextUrl validation to incorporate serverBasePath #2048
Conversation
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2048 +/- ##
=======================================
Coverage 69.34% 69.34%
=======================================
Files 96 96
Lines 2587 2587
Branches 382 382
=======================================
Hits 1794 1794
Misses 699 699
Partials 94 94 ☔ View full report in Codecov by Sentry. |
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.
Thanks for adding this @cwperks. Should the mutli auth routes also be validated?
https://github.com/opensearch-project/security-dashboards-plugin/blob/2.x/server/auth/types/multiple/routes.ts#L30
It only needs to be added on |
* Fix the nextUrl validation test and test url path using regex Signed-off-by: Craig Perkins <[email protected]> * Update nextUrl validation regex Signed-off-by: Craig Perkins <[email protected]> * Add missing tests Signed-off-by: Craig Perkins <[email protected]> * Combine url split to single line Signed-off-by: Craig Perkins <[email protected]> * Update docstring Signed-off-by: Craig Perkins <[email protected]> * Simplify condition Signed-off-by: Craig Perkins <[email protected]> * Add origin on redirect Signed-off-by: Craig Perkins <[email protected]> * Remove absolute url on redirect Signed-off-by: Craig Perkins <[email protected]> * Update login-page tests Signed-off-by: Craig Perkins <[email protected]> * Remove url.origin Signed-off-by: Craig Perkins <[email protected]> * Account for server base path that can be numeric Signed-off-by: Craig Perkins <[email protected]> * Update docstring Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit a44e265)
* Fix the nextUrl validation test and test url path using regex Signed-off-by: Craig Perkins <[email protected]> * Update nextUrl validation regex Signed-off-by: Craig Perkins <[email protected]> * Add missing tests Signed-off-by: Craig Perkins <[email protected]> * Combine url split to single line Signed-off-by: Craig Perkins <[email protected]> * Update docstring Signed-off-by: Craig Perkins <[email protected]> * Simplify condition Signed-off-by: Craig Perkins <[email protected]> * Add origin on redirect Signed-off-by: Craig Perkins <[email protected]> * Remove absolute url on redirect Signed-off-by: Craig Perkins <[email protected]> * Update login-page tests Signed-off-by: Craig Perkins <[email protected]> * Remove url.origin Signed-off-by: Craig Perkins <[email protected]> * Account for server base path that can be numeric Signed-off-by: Craig Perkins <[email protected]> * Update docstring Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit a44e265)
* Fix the nextUrl validation test and test url path using regex Signed-off-by: Craig Perkins <[email protected]> * Update nextUrl validation regex Signed-off-by: Craig Perkins <[email protected]> * Add missing tests Signed-off-by: Craig Perkins <[email protected]> * Combine url split to single line Signed-off-by: Craig Perkins <[email protected]> * Update docstring Signed-off-by: Craig Perkins <[email protected]> * Simplify condition Signed-off-by: Craig Perkins <[email protected]> * Add origin on redirect Signed-off-by: Craig Perkins <[email protected]> * Remove absolute url on redirect Signed-off-by: Craig Perkins <[email protected]> * Update login-page tests Signed-off-by: Craig Perkins <[email protected]> * Remove url.origin Signed-off-by: Craig Perkins <[email protected]> * Account for server base path that can be numeric Signed-off-by: Craig Perkins <[email protected]> * Update docstring Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit a44e265) Co-authored-by: Craig Perkins <[email protected]>
* Fix the nextUrl validation test and test url path using regex Signed-off-by: Craig Perkins <[email protected]> * Update nextUrl validation regex Signed-off-by: Craig Perkins <[email protected]> * Add missing tests Signed-off-by: Craig Perkins <[email protected]> * Combine url split to single line Signed-off-by: Craig Perkins <[email protected]> * Update docstring Signed-off-by: Craig Perkins <[email protected]> * Simplify condition Signed-off-by: Craig Perkins <[email protected]> * Add origin on redirect Signed-off-by: Craig Perkins <[email protected]> * Remove absolute url on redirect Signed-off-by: Craig Perkins <[email protected]> * Update login-page tests Signed-off-by: Craig Perkins <[email protected]> * Remove url.origin Signed-off-by: Craig Perkins <[email protected]> * Account for server base path that can be numeric Signed-off-by: Craig Perkins <[email protected]> * Update docstring Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit a44e265) Co-authored-by: Craig Perkins <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.3 1.3
# Navigate to the new working tree
cd .worktrees/backport-1.3
# Create a new branch
git switch --create backport/backport-2048-to-1.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a44e26539345c17e066bc3ceb9ff1e5c07d50428
# Push it to GitHub
git push --set-upstream origin backport/backport-2048-to-1.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.3 Then, create a pull request where the |
…roject#2048) * Fix the nextUrl validation test and test url path using regex Signed-off-by: Craig Perkins <[email protected]> * Update nextUrl validation regex Signed-off-by: Craig Perkins <[email protected]> * Add missing tests Signed-off-by: Craig Perkins <[email protected]> * Combine url split to single line Signed-off-by: Craig Perkins <[email protected]> * Update docstring Signed-off-by: Craig Perkins <[email protected]> * Simplify condition Signed-off-by: Craig Perkins <[email protected]> * Add origin on redirect Signed-off-by: Craig Perkins <[email protected]> * Remove absolute url on redirect Signed-off-by: Craig Perkins <[email protected]> * Update login-page tests Signed-off-by: Craig Perkins <[email protected]> * Remove url.origin Signed-off-by: Craig Perkins <[email protected]> * Account for server base path that can be numeric Signed-off-by: Craig Perkins <[email protected]> * Update docstring Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit a44e265)
Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit a44e265)
…roject#2048) (opensearch-project#2066) Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit a44e265)
…roject#2048) (opensearch-project#2050) (cherry picked from commit fc4f6a2)
…roject#2048) (opensearch-project#2050) (cherry picked from commit fc4f6a2) Signed-off-by: Yiheng Cao <[email protected]>
Description
Update nextUrl validation to incorporate the serverBasePath. All nextUrl's must be prefixed with the basePath, so this PR enhances the check by ensuring that the basePath is present in the nextUrl param.
Category
Enhancement
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.