justinmclean opened a new issue, #8379:
URL: https://github.com/apache/gravitino/issues/8379
### What would you like to be improved?
In
core/src/main/java/org/apache/gravitino/credential/CredentialOperationDispatcher.java,
getPathBasedCredentialContexts will throw an exception if a duplicate
credential type is passed, even if those are for different paths.
Here's a test showing that:
```
@Test
void testMergePathContextsWithSameCredentialType() {
List<PathContext> pathContexts =
Arrays.asList(new PathContext("path1", "dummy"), new
PathContext("path2", "dummy"));
Map<String, CredentialContext> contexts =
CredentialOperationDispatcher.getPathBasedCredentialContexts(
CredentialPrivilege.WRITE, pathContexts);
Assertions.assertEquals(1, contexts.size());
PathBasedCredentialContext context = (PathBasedCredentialContext)
contexts.get("dummy");
Assertions.assertEquals(Set.of("path1", "path2"),
context.getWritePaths());
Assertions.assertTrue(context.getReadPaths().isEmpty());
}
```
### How should we improve?
No excpetion shoudl be thrown.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]