Skip to content

Commit 2ae6587

Browse files
authored
Add entry point for setting StoreAuthedClientId config property (#94)
In #87, one entry point for setting the config value is missing. This commit adds the entry point in QuorumPeerConfig. All znode group acl tests passed. Will validate the config loading manually by deploying zk server with StoreAuthedClientId enabled in zk config.
1 parent 56d478b commit 2ae6587

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

zookeeper-server/src/main/java/org/apache/zookeeper/server/auth/X509AuthenticationConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ public void setZnodeGroupAclServerDedicatedDomain(String znodeGroupAclServerDedi
230230
this.znodeGroupAclServerDedicatedDomain = znodeGroupAclServerDedicatedDomain;
231231
}
232232

233+
public void setStoreAuthedClientIdEnabled(String enabled) {
234+
storeAuthedClientIdEnabled = enabled;
235+
}
236+
233237
// Getters for X509 properties
234238

235239
public String getClientCertIdType() {
@@ -269,10 +273,6 @@ public int getClientCertIdSanExtractMatcherGroupIndex() {
269273
: clientCertIdSanExtractMatcherGroupIndex;
270274
}
271275

272-
public void setStoreAuthedClientIdEnabled(String enabled) {
273-
storeAuthedClientIdEnabled = enabled;
274-
}
275-
276276
// Getters for X509 Znode Group Acl properties
277277

278278
public boolean isX509ClientIdAsAclEnabled() {

zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,8 @@ public void parseProperties(Properties zkProp) throws IOException, ConfigExcepti
397397
X509AuthenticationConfig.getInstance().setZnodeGroupAclSuperUserIdStr(value);
398398
} else if (key.equals(X509AuthenticationConfig.OPEN_READ_ACCESS_PATH_PREFIX)) {
399399
X509AuthenticationConfig.getInstance().setZnodeGroupAclOpenReadAccessPathPrefixStr(value);
400+
} else if (key.equals(X509AuthenticationConfig.STORE_AUTHED_CLIENT_ID)) {
401+
X509AuthenticationConfig.getInstance().setStoreAuthedClientIdEnabled(value);
400402
} else if (key.equals("standaloneEnabled")) {
401403
if (value.toLowerCase().equals("true")) {
402404
setStandaloneEnabled(true);

0 commit comments

Comments
 (0)