-
Notifications
You must be signed in to change notification settings - Fork 186
Fix NPE on null user in RP code path #4421
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
brianf-aws
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.
Thank you for providing the fix! Do we need any backport labels?
Lets also monitor the CI.
| new OpenSearchStatusException( | ||
| "User " | ||
| + user.getName() | ||
| + (user == null ? null : user.getName()) |
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 user is null and model group is public, does the user have access or not ?
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.
no.. null users are not granted access..
if you are talking from anonymous user login perspective then yes since anonymous users can access resource in two ways:
- Resource is shared with anonymous user or backend role (https://github.com/opensearch-project/security/blob/9e6047f99da4df3404e2d52f3afe4e49e508c3a5/src/main/java/org/opensearch/security/auth/BackendRegistry.java#L480)
- Resource is marked as public by following the new convention (https://github.com/opensearch-project/security/blob/main/RESOURCE_SHARING_AND_ACCESS_CONTROL.md#example-publicly-shared-resource)
Description
Resolves NPE thrown when user is null and RP code path is executed:
We are updating migrate API such that all resources with no owners will now have a "default_owner" to be supplied upon calling migrate API.
(opensearch-project/security#5789)
These resources will not have public access by default. Instead will have to be shared publicly.
Related Issues
Check List
--signoff.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.