-
Notifications
You must be signed in to change notification settings - Fork 281
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
Cluster permissions evaluation logic will now include index_template
type action
#1885
Cluster permissions evaluation logic will now include index_template
type action
#1885
Conversation
e5c6b46
to
eb73447
Compare
@opensearch-project/security Seems like the test failures are related to audit-log changes. Need some help fixing this. |
@DarshitChanpura CI failed. Would you please take a look? |
src/test/java/org/opensearch/security/IndexTemplateClusterPermissionsCheckTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/security/IndexTemplateClusterPermissionsCheckTest.java
Show resolved
Hide resolved
It failed due to errors unrelated to the changes in this PR, example look here. Have we seen this error before? |
} else { | ||
} else if (request instanceof PutComponentTemplateAction.Request) { | ||
// do nothing | ||
}else { |
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.
nitpick: space before else
(do we have a linting rule for this?)
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.
done
eb73447
to
6c8cfdc
Compare
Could you please add a description to either this PR or the associated issue explaining what the implications of |
6c8cfdc
to
f2ea0c2
Compare
done... description added to the referenced issue |
6d92a32
to
cbc53e5
Compare
src/test/java/org/opensearch/security/test/helper/rest/RestHelper.java
Outdated
Show resolved
Hide resolved
827286e
to
260f7bb
Compare
Codecov Report
@@ Coverage Diff @@
## main #1885 +/- ##
=========================================
Coverage 61.01% 61.02%
Complexity 3232 3232
=========================================
Files 256 256
Lines 18085 18087 +2
Branches 3222 3224 +2
=========================================
+ Hits 11034 11037 +3
+ Misses 5469 5466 -3
- Partials 1582 1584 +2
Continue to review full report at Codecov.
|
final String pathEntry = jsonPathScanner.next(); | ||
String pathEntry = jsonPathScanner.next(); | ||
// if pathEntry is an array lookup | ||
boolean isArrayLookup = pathEntry.contains("["); |
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.
Much cleaner to use a regex, here is an example https://ideone.com/wEcFot
'test[12]' Name was: test, index position: 12
'result[2]' Name was: result, index position: 2
'res[2da]' No Match
'[a2da]' No Match
'sitename' No Match
If you have a match, immediately assign currentNode = currentNode.get(arrayEntryIdx);
and then call continue
to go back to the top of the loop
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 find.. this is much better.. Slight change, I can't immediately continue once I find the match, as I first have to check whether the current node on the requested path is an array and then try to get the request index.
…te permission type Signed-off-by: Darshit Chanpura <[email protected]>
…mission and fixes existing broken tests Signed-off-by: Darshit Chanpura <[email protected]>
260f7bb
to
c91015d
Compare
Great work @DarshitChanpura |
…endistro-1.11 Signed-off-by: Rutuja Surve <[email protected]> (cherry picked from commit 702c81a)
…endistro-1.10 Signed-off-by: Rutuja Surve <[email protected]> (cherry picked from commit 702c81a)
…endistro-1.2 Signed-off-by: Rutuja Surve <[email protected]> (cherry picked from commit 702c81a)
…endistro-1.2 Signed-off-by: Rutuja Surve <[email protected]> (cherry picked from commit 702c81a)
…endistro-1.11 Signed-off-by: Rutuja Surve <[email protected]> (cherry picked from commit 702c81a)
Signed-off-by: Rutuja Surve <[email protected]> (cherry picked from commit 702c81a)
Signed-off-by: Rutuja Surve <[email protected]> (cherry picked from commit 702c81a)
Signed-off-by: Rutuja Surve <[email protected]> (cherry picked from commit 702c81a)
Signed-off-by: Rutuja Surve <[email protected]>
Signed-off-by: Rutuja Surve <[email protected]>
… to opendistro-1.11 (opensearch-project#1986)" This reverts commit ec80578.
… to opendistro-1.11 (opensearch-project#1986)" This reverts commit ec80578. Signed-off-by: Rutuja Surve <[email protected]>
… to opendistro-1.11 (opensearch-project#1986)" This reverts commit ec80578. Signed-off-by: Rutuja Surve <[email protected]>
Signed-off-by: Rutuja Surve <[email protected]>
…ch-project#1885 Signed-off-by: Rutuja Surve <[email protected]>
…project#1885 Signed-off-by: Rutuja Surve <[email protected]>
…project#1885 Signed-off-by: Rutuja Surve <[email protected]>
…project#1885 Signed-off-by: Rutuja Surve <[email protected]>
…project#1885 Signed-off-by: Rutuja Surve <[email protected]>
…` type action (opensearch-project#1885) * Updates the cluster permission check function to include index_template permission type Signed-off-by: Darshit Chanpura <[email protected]> Signed-off-by: Stephen Crawford <[email protected]>
…` type action (opensearch-project#1885) * Updates the cluster permission check function to include index_template permission type Signed-off-by: Darshit Chanpura <[email protected]>
Description
Title
Issues Resolved
index_template
action type is not part of cluster-permissions check even thoughtemplate
is. #1884Testing
A test is written to evaluate this
Check List
- [ ] New functionality has been documentedBy 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.