-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RANGER-4955: Add support to retrieve group information from JWT
- Loading branch information
Abhishek Kumar
committed
Oct 9, 2024
1 parent
f06d0e7
commit 99bf651
Showing
4 changed files
with
124 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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
25 changes: 25 additions & 0 deletions
25
ranger-authn/src/main/java/org/apache/ranger/authz/authority/JwtAuthority.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.apache.ranger.authz.authority; | ||
|
||
import java.util.Set; | ||
import org.springframework.security.core.GrantedAuthority; | ||
|
||
public final class JwtAuthority implements GrantedAuthority { | ||
private static final long serialVersionUID = 12323L; | ||
private final String role; | ||
private final Set<String> groups; | ||
|
||
public JwtAuthority(String role, Set<String> groups) { | ||
this.role = role; | ||
this.groups = groups; | ||
} | ||
|
||
public String getAuthority() { | ||
return this.role; | ||
} | ||
|
||
public Set<String> getGroups() { return this.groups; } | ||
|
||
public String toString() { | ||
return this.role; | ||
} | ||
} |
This file contains 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 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