-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Move request interceptors to AuthorizationService #38137
Merged
jaymode
merged 4 commits into
elastic:security_authz_engine
from
jaymode:cleanup_authz_engine
Feb 4, 2019
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,6 +127,8 @@ void authorizeIndexAction(RequestInfo requestInfo, AuthorizationInfo authorizati | |
ActionListener<IndexAuthorizationResult> listener); | ||
|
||
/** | ||
* Asynchronously loads a list of alias and index names for which the user is authorized | ||
* to execute the requested action. | ||
* | ||
* @param requestInfo object contain the request and associated information such as the action | ||
* and associated user(s) | ||
|
@@ -139,6 +141,25 @@ void authorizeIndexAction(RequestInfo requestInfo, AuthorizationInfo authorizati | |
void loadAuthorizedIndices(RequestInfo requestInfo, AuthorizationInfo authorizationInfo, | ||
Map<String, AliasOrIndex> aliasAndIndexLookup, ActionListener<List<String>> listener); | ||
|
||
/** | ||
* Asynchronously checks if that the permissions a user would have for a given list of names do | ||
* not exceed their permissions for a given name. This is used to ensure that a user cannot | ||
* perform operations that would escalate their privileges over the data. Some examples include | ||
* adding an alias to gain more permissions to a given index and/or resizing an index in order | ||
* to gain more privileges on the data since the index name changes. | ||
* | ||
* @param requestInfo object contain the request and associated information such as the action | ||
* and associated user(s) | ||
* @param authorizationInfo information needed from authorization that was previously retrieved | ||
* from {@link #resolveAuthorizationInfo(RequestInfo, ActionListener)} | ||
* @param indexNameToNewNames A map of an existing index/alias name to a one or more names of | ||
* an index/alias that the user is requesting to create. The method | ||
* should validate that none of the names have more permissions than | ||
* the name in the key would have. | ||
* @param listener the listener to be notified of the authorization result | ||
*/ | ||
void validateIndexPermissionsAreSubset(RequestInfo requestInfo, AuthorizationInfo authorizationInfo, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It took me a while to get my head around what this is doing. Good luck coming up with meaningful javadoc for that 😸 |
||
Map<String, List<String>> indexNameToNewNames, ActionListener<AuthorizationResult> listener); | ||
/** | ||
* Interface for objects that contains the information needed to authorize a request | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 0 additions & 61 deletions
61
...ch/xpack/security/action/interceptor/FieldAndDocumentLevelSecurityRequestInterceptor.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
s/if that/that/