Skip to content

Commit 8135576

Browse files
authored
Add google format version (#9)
Extracted out of #6
1 parent a2b7ece commit 8135576

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
<cleanthat.version>2.17</cleanthat.version>
3939
<error-prone.version>2.24.1</error-prone.version>
40+
<google-java-format.version>1.19.2</google-java-format.version>
4041

4142
<maven-clean-plugin.version>3.3.2</maven-clean-plugin.version>
4243
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>

src/main/java/tech/stackable/hadoop/StackableGroupMapper.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@
2121

2222
public class StackableGroupMapper implements GroupMappingServiceProvider {
2323

24-
private static final Logger LOG = LoggerFactory.getLogger(StackableGroupMapper.class);
25-
2624
public static final String OPA_MAPPING_URL_PROP = "hadoop.security.group.mapping.opa.policy.url";
27-
// response base field: see https://www.openpolicyagent.org/docs/latest/rest-api/#response-message
28-
private static final String OPA_RESULT_FIELD = "result";
29-
25+
private static final Logger LOG = LoggerFactory.getLogger(StackableGroupMapper.class);
3026
private final HttpClient httpClient = HttpClient.newHttpClient();
3127
private final ObjectMapper json;
3228
private URI opaUri;
@@ -59,12 +55,10 @@ public StackableGroupMapper() {
5955
.setSerializationInclusion(JsonInclude.Include.NON_NULL);
6056
}
6157

62-
private static class OpaQueryResult {
63-
public List<String> result;
64-
}
65-
6658
/**
67-
* Returns list of groups for a user.
59+
* Returns list of groups for a user. Internally Hadoop will pass the short name to this function,
60+
* but this prevents us from effectively separating users with the same names but with different
61+
* kerberos principals.
6862
*
6963
* @param user get groups for this user
7064
* @return list of groups for a given user
@@ -139,4 +133,8 @@ public void cacheGroupsAdd(List<String> groups) {
139133
"ignoring cacheGroupsAdd for groups [{}]: caching should be provided by the policy provider",
140134
groups);
141135
}
136+
137+
private static class OpaQueryResult {
138+
public List<String> result;
139+
}
142140
}

0 commit comments

Comments
 (0)