-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-6968. Addendum: [Multi-Tenant] Fix USER_MISMATCH error even on correct user. #3578
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -90,11 +90,10 @@ public class TestS3GetSecretRequest { | |
|
|
||
| // Multi-tenant related vars | ||
| private static final String USER_ALICE = "[email protected]"; | ||
| private static final String USER_ALICE_SHORT = "alice"; | ||
| private static final String TENANT_ID = "finance"; | ||
| private static final String USER_BOB_SHORT = "bob"; | ||
| private static final String USER_BOB = "bob@EXAMPLE.COM"; | ||
| private static final String ACCESS_ID_BOB = | ||
| OMMultiTenantManager.getDefaultAccessId(TENANT_ID, USER_BOB_SHORT); | ||
| OMMultiTenantManager.getDefaultAccessId(TENANT_ID, USER_BOB); | ||
|
|
||
| private UserGroupInformation ugiAlice; | ||
|
|
||
|
|
@@ -247,7 +246,7 @@ public void testGetOwnSecretAsNonAdmin() throws IOException { | |
| S3GetSecretRequest s3GetSecretRequest1 = | ||
| new S3GetSecretRequest( | ||
| new S3GetSecretRequest( | ||
| s3GetSecretRequest(USER_ALICE_SHORT) | ||
| s3GetSecretRequest(USER_ALICE) | ||
| ).preExecute(ozoneManager) | ||
| ); | ||
|
|
||
|
|
@@ -263,15 +262,15 @@ public void testGetOwnSecretAsNonAdmin() throws IOException { | |
|
|
||
| // Check response | ||
| final S3SecretValue s3SecretValue = s3GetSecretResponse.getS3SecretValue(); | ||
| Assert.assertEquals(USER_ALICE_SHORT, s3SecretValue.getKerberosID()); | ||
| Assert.assertEquals(USER_ALICE, s3SecretValue.getKerberosID()); | ||
| final String awsSecret1 = s3SecretValue.getAwsSecret(); | ||
| Assert.assertNotNull(awsSecret1); | ||
|
|
||
| final GetS3SecretResponse getS3SecretResponse = | ||
| s3GetSecretResponse.getOMResponse().getGetS3SecretResponse(); | ||
| // The secret inside should be the same. | ||
| final S3Secret s3Secret1 = getS3SecretResponse.getS3Secret(); | ||
| Assert.assertEquals(USER_ALICE_SHORT, s3Secret1.getKerberosID()); | ||
| Assert.assertEquals(USER_ALICE, s3Secret1.getKerberosID()); | ||
| Assert.assertEquals(awsSecret1, s3Secret1.getAwsSecret()); | ||
|
|
||
|
|
||
|
|
@@ -282,7 +281,7 @@ public void testGetOwnSecretAsNonAdmin() throws IOException { | |
| S3GetSecretRequest s3GetSecretRequest2 = | ||
| new S3GetSecretRequest( | ||
| new S3GetSecretRequest( | ||
| s3GetSecretRequest(USER_ALICE_SHORT) | ||
| s3GetSecretRequest(USER_ALICE) | ||
| ).preExecute(ozoneManager) | ||
| ); | ||
|
|
||
|
|
@@ -303,7 +302,7 @@ public void testGetOwnSecretAsNonAdmin() throws IOException { | |
| s3GetSecretResponse2.getOMResponse().getGetS3SecretResponse(); | ||
| // The secret inside should be the same. | ||
| final S3Secret s3Secret2 = getS3SecretResponse2.getS3Secret(); | ||
| Assert.assertEquals(USER_ALICE_SHORT, s3Secret2.getKerberosID()); | ||
| Assert.assertEquals(USER_ALICE, s3Secret2.getKerberosID()); | ||
|
|
||
| // Should get the same secret as the first request's. | ||
| Assert.assertEquals(awsSecret1, s3Secret2.getAwsSecret()); | ||
|
|
@@ -378,7 +377,7 @@ public void testGetSecretWithTenant() throws IOException { | |
| new OMTenantAssignUserAccessIdRequest( | ||
| new OMTenantAssignUserAccessIdRequest( | ||
| assignUserToTenantRequest(TENANT_ID, | ||
| USER_BOB_SHORT, ACCESS_ID_BOB) | ||
aswinshakil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| USER_BOB, ACCESS_ID_BOB) | ||
| ).preExecute(ozoneManager) | ||
| ); | ||
|
|
||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.