sunxi92 commented on a change in pull request #3761:
URL: https://github.com/apache/rocketmq/pull/3761#discussion_r790222823
##########
File path:
acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java
##########
@@ -136,42 +184,46 @@ public boolean updateAccessConfig(PlainAccessConfig
plainAccessConfig) {
Permission.checkResourcePerms(plainAccessConfig.getTopicPerms());
Permission.checkResourcePerms(plainAccessConfig.getGroupPerms());
- Map<String, Object> aclAccessConfigMap =
AclUtils.getYamlDataObject(fileHome + File.separator + fileName,
- Map.class);
- if (aclAccessConfigMap == null || aclAccessConfigMap.isEmpty()) {
- throw new AclException(String.format("the %s file is not found or
empty", fileHome + File.separator + fileName));
- }
- List<Map<String, Object>> accounts = (List<Map<String, Object>>)
aclAccessConfigMap.get(AclConstants.CONFIG_ACCOUNTS);
- Map<String, Object> updateAccountMap = null;
- if (accounts != null) {
Review comment:
done
##########
File path:
acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java
##########
@@ -267,54 +318,61 @@ public boolean updateGlobalWhiteAddrsConfig(List<String>
globalWhiteAddrsList) {
}
// Update globalWhiteRemoteAddr element in memory map firstly
aclAccessConfigMap.put(AclConstants.CONFIG_GLOBAL_WHITE_ADDRS,
globalWhiteRemoteAddrList);
- if (AclUtils.writeDataObject(fileHome + File.separator + fileName,
updateAclConfigFileVersion(aclAccessConfigMap))) {
- return true;
- }
- return false;
+ return AclUtils.writeDataObject(defaultAclFile,
updateAclConfigFileVersion(aclAccessConfigMap));
}
- log.error("Users must ensure that the acl yaml config file has
globalWhiteRemoteAddresses flag firstly");
+ log.error("Users must ensure that the acl yaml config file has
globalWhiteRemoteAddresses flag in the %s firstly", defaultAclFile);
Review comment:
done
##########
File path:
common/src/main/java/org/apache/rocketmq/common/protocol/header/GetBrokerAclConfigResponseHeader.java
##########
@@ -16,14 +16,17 @@
*/
package org.apache.rocketmq.common.protocol.header;
+import org.apache.rocketmq.common.DataVersion;
import org.apache.rocketmq.remoting.CommandCustomHeader;
import org.apache.rocketmq.remoting.annotation.CFNotNull;
import org.apache.rocketmq.remoting.exception.RemotingCommandException;
+import java.util.Map;
+
public class GetBrokerAclConfigResponseHeader implements CommandCustomHeader {
@CFNotNull
- private String version;
+ private Map<String, DataVersion> version;
Review comment:
done
--
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]