opensearch-project / security

🔐 Secure your cluster with TLS, numerous authentication backends, data masking, audit logging as well as role-based access control on indices, documents, and fields
https://opensearch.org/docs/latest/security-plugin/index/
Apache License 2.0
180 stars 264 forks source link

Extracted the user attr handling methods from ConfigModelV7 into its own class #4416

Closed nibix closed 3 weeks ago

nibix commented 3 weeks ago

Description

This code change is just in preparation for the change in #4380 as requested in https://github.com/opensearch-project/security/pull/4380#discussion_r1621324272 .

The code for user attribute handling is moved from the class ConfigModelV7 into its own class, as other new code will need to use it. Additionally, it enhances the structuring of the code by moving code with a specific purpose into its own class.

Personal note: A thorough re-design of this code might be worthwhile.

Issues Resolved

Is this a backport? If so, please add backport PR # and/or commits #

Testing

[Please provide details of testing done: unit testing, integration testing and manual testing]

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.

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 78.57143% with 6 lines in your changes missing coverage. Please review.

Project coverage is 65.45%. Comparing base (8688d6b) to head (4695280).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/opensearch-project/security/pull/4416/graphs/tree.svg?width=650&height=150&src=pr&token=rBpySfQXMt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project)](https://app.codecov.io/gh/opensearch-project/security/pull/4416?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) ```diff @@ Coverage Diff @@ ## main #4416 +/- ## ========================================== + Coverage 65.42% 65.45% +0.02% ========================================== Files 310 311 +1 Lines 22013 22014 +1 Branches 3556 3556 ========================================== + Hits 14402 14409 +7 + Misses 5841 5836 -5 + Partials 1770 1769 -1 ``` | [Files](https://app.codecov.io/gh/opensearch-project/security/pull/4416?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | Coverage Δ | | |---|---|---| | [...pensearch/security/securityconf/ConfigModelV7.java](https://app.codecov.io/gh/opensearch-project/security/pull/4416?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fopensearch%2Fsecurity%2Fsecurityconf%2FConfigModelV7.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#diff-c3JjL21haW4vamF2YS9vcmcvb3BlbnNlYXJjaC9zZWN1cml0eS9zZWN1cml0eWNvbmYvQ29uZmlnTW9kZWxWNy5qYXZh) | `67.92% <100.00%> (-0.47%)` | :arrow_down: | | [...opensearch/security/privileges/UserAttributes.java](https://app.codecov.io/gh/opensearch-project/security/pull/4416?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fopensearch%2Fsecurity%2Fprivileges%2FUserAttributes.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#diff-c3JjL21haW4vamF2YS9vcmcvb3BlbnNlYXJjaC9zZWN1cml0eS9wcml2aWxlZ2VzL1VzZXJBdHRyaWJ1dGVzLmphdmE=) | `76.00% <76.00%> (ø)` | | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/opensearch-project/security/pull/4416/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project)