Tenant Permissions : added the possibility to specify tenants via par…#819
Tenant Permissions : added the possibility to specify tenants via par…#819chrousto wants to merge 2 commits intoopensearch-project:mainfrom
Conversation
|
|
||
| //for(String matchingTenant: ) { | ||
| // tuples.add(new Tuple<String, Boolean>(matchingTenant, agr.resolvedActions(tenant.getAllowed_actions()).contains("kibana:saved_objects/*/write"))); | ||
| //} |
There was a problem hiding this comment.
Should these be removed if it's not needed?
There was a problem hiding this comment.
Hello @cliu123 and thanks for reviewing my PR.
Indeed those lines were useless and I have removed them, please check it out.
Regards,
Christophe.
There was a problem hiding this comment.
@cliu123 : did you have a chance to have a look at my reviewed code ?
Is there something I need to improve in order to start the discussion.
Please let me know.
Thanks in advance
Christophe
Codecov Report
@@ Coverage Diff @@
## main #819 +/- ##
=========================================
Coverage 64.54% 64.54%
+ Complexity 3171 3170 -1
=========================================
Files 244 244
Lines 17124 17131 +7
Branches 3036 3038 +2
=========================================
+ Hits 11052 11057 +5
Misses 4531 4531
- Partials 1541 1543 +2
Continue to review full report at Codecov.
|
02760e0 to
7ed4b48
Compare
|
Hey @chrousto, do you have any news over this? The ability to take advantage of user attributes for tenant patterns are really useful. |
|
Hello @francisco-hoo : No news at all on this, after removing comments according to the first answer, I did not receive any updates on this, even after posting in the forum or sending emails :( Thanks in advance. |
7ed4b48 to
07c61c3
Compare
|
@chrousto Thanks for these changes.
|
| // passed on as values of users' attributes, we have to make | ||
| // sure that we don't allow them to select tenants that do not exist. | ||
| if(ConfigModelV7.this.tenants.getCEntries().keySet().contains(tenant)) { | ||
| result.put(replaceProperties(tenant, user), rw); |
There was a problem hiding this comment.
why do we need to call replaceProperties() again? Value was already substitued and stored in tenant variable on line 1068
There was a problem hiding this comment.
Hello @hardik-k-shah I have integrated the changes in chrousto/security@a5683bf
| tuples.add(new Tuple<String, Boolean>(matchingTenant, agr.resolvedActions(tenant.getAllowed_actions()).contains("kibana:saved_objects/*/write"))); | ||
|
|
||
| // find Wildcarded tenant patterns | ||
| List<String> wildcardMatchingTenants = WildcardMatcher.from(tenant.getTenant_patterns()).getMatchAny(definedTenants.getCEntries().keySet(), Collectors.toList()) ; |
There was a problem hiding this comment.
not a wildcard (*).
But it is matching pattern configured in role, so better to rename wildcardMatchingTenants to original variable matchingTenants
Also update comments accordingly.
There was a problem hiding this comment.
Hello @hardik-k-shah I have integrated the changes in chrousto/security@a5683bf
|
@chrousto There are lot of changes which are not related to your PR topic and it is difficult to review. Can you fix that? If needed, please create new PR. |
|
@chrousto please rebase your PR against |
a5683bf to
12f0a42
Compare
|
@cliu123 : do you need more information on this ? |
|
@chrousto Thanks for contributing!
|
Hello
|
17acfe0 to
7d95dd5
Compare
…ants via parameter substitution.
7d95dd5 to
91effce
Compare
Hello there, I have updated the PR with everything you requested (tell me if that is ok).
Be able to have parameters AND wildcards would be a future improvement (something like this : Thanks for your feedback. |
|
@chrousto Thanks for taking care the requests! As you might have noticed, the repo has been moved from ODFE org to opensearch-project org. We are working on migration from ODFE to OpenSearch currently. The |
Hello, could you please point me to the naming conventions, I can't seem to find them. |
I believe you can rebase against |
|
@chrousto I've recently looked over this change and I think its valuable. I've created a branch main...peternied:TenantsParameterSubstitutions in my fork, you can force push onto your branch if you would like to make progress towards merging. |
|
Hello Peter, I am happy to see interest In this change.
I will have to dive into it again in order be able to push properly.
Thanks
Christophe
Le lun. 25 avr. 2022, 21:17, Peter Nied ***@***.***> a écrit :
… @chrousto <https://github.com/chrousto> I've recently looked over this
change and I think its valuable. I've created a branch
main...peternied:TenantsParameterSubstitutions
<main...peternied:TenantsParameterSubstitutions>
in my fork, you can force push onto your branch if you would like to make
progress towards merging.
—
Reply to this email directly, view it on GitHub
<#819 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFFOMOXNDFXLYAAY3ZJL5M3VG3VTTANCNFSM4TGPBICA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
@chrousto If you'd like, I'm happy to get this pull request merged doing some of the resolving/merging on my own. However, we require a Developer Certificate of Origin.
If you are willing to reply with the above statement and your permission, I can get this merged - what would you like to do? |
|
Hello, @peternied, indeed I give you my permission to proceed with the merge : By submitting this pull request, I (Christophe Chazeau christophe.chazeau@gmail.com) confirm that my contribution is made under the terms of the Apache 2.0 license. Thanks in advance. Christophe. |
|
I am migrating this pull request to #1813 so I can rebase and add signatures for DCO |
Please provide as much details as possible to get feedback/acceptance on your PR quickly
Category: (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)
Enhancement / New Feature : specify tenants in roles via parameter substitution (like for indexes and DLS)
Description of changes:
The idea would be that this user :
Would only have access to the tenant tenant1 if the role role-tenant1 was defined like this :
Why these changes are required?
Enhancement of the way tenants are specified in roles definitions. Allows for more generic roles to be created with information being received from the authorization backend for instance.
What is the old behavior before changes and new behavior after changes? (Please add any example/logs/screen-shot if available)
Before the change, tenants could only be specified statically or via patterns in role definitions
Testing done: (Please provide details of testing done: Unit testing, integration testing and manual testing)
Testing done manually
TO-DOs, if any: (Please describe pending items and provide Github issues# for each of them)
Provide proper tests units.
Is it backport from master branch? (If yes, please add backport PR # and commits #)
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.