rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From duhengfore...@apache.org
Subject [rocketmq-ons] 29/43: Added compatibility with not enable ACL model in server
Date Fri, 06 Dec 2019 04:22:51 GMT
This is an automated email from the ASF dual-hosted git repository.

duhengforever pushed a commit to branch OpenMessaging
in repository https://gitbox.apache.org/repos/asf/rocketmq-ons.git

commit b31ad6a2f597e147e2bcf6cd2bcb07d5054d34ef
Author: duhenglucky <duheng0522@gmail.com>
AuthorDate: Tue Sep 3 17:37:05 2019 +0800

    Added compatibility with not enable ACL model in server
---
 .../apache/rocketmq/ons/api/impl/authority/SessionCredentials.java  | 2 +-
 .../org/apache/rocketmq/ons/api/impl/rocketmq/ClientRPCHook.java    | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ons-core/ons-auth4client/src/main/java/org/apache/rocketmq/ons/api/impl/authority/SessionCredentials.java
b/ons-core/ons-auth4client/src/main/java/org/apache/rocketmq/ons/api/impl/authority/SessionCredentials.java
index 854c093..fdbac11 100644
--- a/ons-core/ons-auth4client/src/main/java/org/apache/rocketmq/ons/api/impl/authority/SessionCredentials.java
+++ b/ons-core/ons-auth4client/src/main/java/org/apache/rocketmq/ons/api/impl/authority/SessionCredentials.java
@@ -46,7 +46,7 @@ public class SessionCredentials {
     private String securityToken;
     private String signature;
     private String signatureMethod;
-    private ONSChannel onsChannel = ONSChannel.CLOUD;
+    private ONSChannel onsChannel = ONSChannel.ALIYUN;
 
     public SessionCredentials() {
         String keyContent = null;
diff --git a/ons-core/ons-auth4client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ClientRPCHook.java
b/ons-core/ons-auth4client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ClientRPCHook.java
index 72e36b9..5184bd5 100644
--- a/ons-core/ons-auth4client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ClientRPCHook.java
+++ b/ons-core/ons-auth4client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ClientRPCHook.java
@@ -17,9 +17,9 @@
 
 package org.apache.rocketmq.ons.api.impl.rocketmq;
 
-import org.apache.rocketmq.remoting.protocol.RemotingCommand;
 import org.apache.rocketmq.ons.api.impl.authority.AuthUtil;
 import org.apache.rocketmq.ons.api.impl.authority.SessionCredentials;
+import org.apache.rocketmq.remoting.protocol.RemotingCommand;
 
 import static org.apache.rocketmq.ons.api.impl.authority.SessionCredentials.AccessKey;
 import static org.apache.rocketmq.ons.api.impl.authority.SessionCredentials.ONSChannelKey;
@@ -35,6 +35,9 @@ public class ClientRPCHook extends AbstractRPCHook {
 
     @Override
     public void doBeforeRequest(String remoteAddr, RemotingCommand request) {
+        if (sessionCredentials.getAccessKey() == null && sessionCredentials.getSecretKey()
== null) {
+            return;
+        }
         byte[] total = AuthUtil.combineRequestContent(request,
             parseRequestContent(request, sessionCredentials.getAccessKey(),
                 sessionCredentials.getSecurityToken(), sessionCredentials.getOnsChannel().name()));
@@ -48,7 +51,6 @@ public class ClientRPCHook extends AbstractRPCHook {
         }
     }
 
-
     @Override
     public void doAfterResponse(String remoteAddr, RemotingCommand request, RemotingCommand
response) {
 


Mime
View raw message