Skip to content

Commit

Permalink
[apache#4960] fix(server): hive metastore authentication failed when …
Browse files Browse the repository at this point in the history
…checking whether securable object exists in createRole() method (apache#4978)

### What changes were proposed in this pull request?

put the check code into the code block Utils.doAs.

### Why are the changes needed?

Fix: apache#4960 

### Does this PR introduce _any_ user-facing change?

Passing identity authentication information when checking hive resource

### How was this patch tested?

yes,finish functional test By hand, based on the hive meatasotre with
kerberos authentication enabled.

Co-authored-by: yangyuxia <[email protected]>
Co-authored-by: yangyx <[email protected]>
  • Loading branch information
3 people authored Sep 21, 2024
1 parent 2b40142 commit 720a67a
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,12 @@ public Response getRole(@PathParam("metalake") String metalake, @PathParam("role
@ResponseMetered(name = "create-role", absolute = true)
public Response createRole(@PathParam("metalake") String metalake, RoleCreateRequest request) {
try {

for (SecurableObjectDTO object : request.getSecurableObjects()) {
checkSecurableObject(metalake, object);
}

return Utils.doAs(
httpRequest,
() -> {
for (SecurableObjectDTO object : request.getSecurableObjects()) {
checkSecurableObject(metalake, object);
}
List<SecurableObject> securableObjects =
Arrays.stream(request.getSecurableObjects())
.map(
Expand Down

0 comments on commit 720a67a

Please sign in to comment.