-
Notifications
You must be signed in to change notification settings - Fork 147
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
adding multi-tenancy to config api and master key related changes #3439
adding multi-tenancy to config api and master key related changes #3439
Conversation
6b5ad0a
to
9578ff1
Compare
f897de2
to
4f70041
Compare
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3439 +/- ##
============================================
- Coverage 81.31% 80.45% -0.87%
- Complexity 6094 6723 +629
============================================
Files 573 599 +26
Lines 25268 29186 +3918
Branches 2666 3232 +566
============================================
+ Hits 20547 23481 +2934
- Misses 3601 4304 +703
- Partials 1120 1401 +281
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Looks good. Please add missing unit test for lines missing code coverage.
} | ||
|
||
@Override | ||
protected void doExecute(Task task, ActionRequest request, ActionListener<MLConfigGetResponse> actionListener) { | ||
MLConfigGetRequest mlConfigGetRequest = MLConfigGetRequest.fromActionRequest(request); | ||
String configId = mlConfigGetRequest.getConfigId(); | ||
String tenantId = mlConfigGetRequest.getTenantId(); |
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.
Currently tenantId
is not being used. Please add a comment that tenantId will be used as part of SDKClient migration.
I do see a lot of place did not cover by UT according to codecov report. I know the release time line is quite tense but could you please mark them and add those 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.
LGTM with a question
case TENANT_ID_FIELD: | ||
tenantId = parser.textOrNull(); |
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.
Do we need the tenant ID field added to the config? We use a hash of the key as part of the document ID and never actually compare vs. 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.
We had is here in the multi-tenancy branch, I will deep dive later (after merging all the code) if we can remove it from here.
4f70041
to
518f7a8
Compare
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
518f7a8
to
6e94702
Compare
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.
Code changes looks good. Seems build is failing due to flaky test. Please validate that build succeeds before merging.
@@ -48,50 +53,52 @@ public class EncryptorImpl implements Encryptor { | |||
"The ML encryption master key has not been initialized yet. Please retry after waiting for 10 seconds."; | |||
private ClusterService clusterService; | |||
private Client client; | |||
private volatile String masterKey; | |||
private final Map<String, String> tenantMasterKeys; |
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.
I don't get why we have different key for every tenant. Currently this key is shared on the cluster level and crosses users. It's only for the node internal use, doesn't matter with user information. If we did so, we would also need to have different key for every user.
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.
Tenant isn't an user here. So every tenant will have their own separate master key which will be used to encrypt/decrypt their connector credentials. If we have only one master key, that'll be a security concern for multi-tenancy.
) * adding multi-tenancy to config api and master key related changes Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding more unit tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> (cherry picked from commit 9846e6e)
) (#3444) * adding multi-tenancy to config api and master key related changes Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding more unit tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> (cherry picked from commit 9846e6e) Co-authored-by: Dhrubo Saha <dhrubo@amazon.com>
Description
[adding multi-tenancy to config api and master key related changes]
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
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.