You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2018/05/14 15:20:01 UTC

[1/2] qpid-broker-j git commit: QPID-8172: [Broker-J] Address review comments from Keith Wall

Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 8b5577b9d -> 2fdbde270


QPID-8172: [Broker-J] Address review comments from Keith Wall


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/11aa5827
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/11aa5827
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/11aa5827

Branch: refs/heads/master
Commit: 11aa5827ddcdee9f621714e097ecab4c6d24f39a
Parents: 8b5577b
Author: Alex Rudyy <or...@apache.org>
Authored: Mon May 14 16:05:32 2018 +0100
Committer: Alex Rudyy <or...@apache.org>
Committed: Mon May 14 16:05:32 2018 +0100

----------------------------------------------------------------------
 .../oauth2/OAuth2AuthenticationProviderImpl.java     | 15 +++++++++------
 .../oauth2/OAuth2AuthenticationProviderImplTest.java |  1 -
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/11aa5827/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImpl.java
index 56f69b9..43ce269 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImpl.java
@@ -272,20 +272,23 @@ public class OAuth2AuthenticationProviderImpl
             connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=" + UTF_8.name());
             connection.setRequestProperty("Accept", "application/json");
 
+            Map<String, String> requestBody = new HashMap<>();
             String clientSecret = getClientSecret() == null ? "" : getClientSecret();
             if (getTokenEndpointNeedsAuth())
             {
                 String encoded = DatatypeConverter.printBase64Binary((getClientId() + ":" + clientSecret).getBytes(UTF_8));
                 connection.setRequestProperty("Authorization", "Basic " + encoded);
             }
-
-            Map<String, String> requestBody = new HashMap<>();
-            requestBody.put("code", authorizationCode);
-            requestBody.put("client_id", getClientId());
-            if (!getTokenEndpointNeedsAuth() && !"".equals(clientSecret))
+            else
             {
-                requestBody.put("client_secret", clientSecret);
+                requestBody.put("client_id", getClientId());
+                if (!"".equals(clientSecret))
+                {
+                    requestBody.put("client_secret", clientSecret);
+                }
             }
+
+            requestBody.put("code", authorizationCode);
             requestBody.put("redirect_uri", redirectUri);
             requestBody.put("grant_type", "authorization_code");
             requestBody.put("response_type", "token");

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/11aa5827/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImplTest.java
----------------------------------------------------------------------
diff --git a/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImplTest.java b/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImplTest.java
index 02d3dbb..f4348dd 100644
--- a/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImplTest.java
+++ b/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImplTest.java
@@ -279,7 +279,6 @@ public class OAuth2AuthenticationProviderImplTest extends UnitTestBase
         tokenEndpoint.putExpectedParameter("response_type", "token");
         tokenEndpoint.putExpectedParameter("code", TEST_VALID_AUTHORIZATION_CODE);
         tokenEndpoint.putExpectedParameter("redirect_uri", TEST_REDIRECT_URI);
-        tokenEndpoint.putExpectedParameter("client_id", TEST_CLIENT_ID);
         tokenEndpoint.setExpectedMethod("POST");
         tokenEndpoint.setNeedsAuth(true);
         tokenEndpoint.setResponse(200, String.format("{\"access_token\":\"%s\","


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[2/2] qpid-broker-j git commit: QPID-8167: [Broker-J] Address review comments from Keith Wall

Posted by or...@apache.org.
QPID-8167: [Broker-J] Address review comments from Keith Wall


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/2fdbde27
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/2fdbde27
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/2fdbde27

Branch: refs/heads/master
Commit: 2fdbde27053a9574ead2299acbf0890c507d38e1
Parents: 11aa582
Author: Alex Rudyy <or...@apache.org>
Authored: Mon May 14 16:09:37 2018 +0100
Committer: Alex Rudyy <or...@apache.org>
Committed: Mon May 14 16:18:29 2018 +0100

----------------------------------------------------------------------
 broker/src/main/java/org/apache/qpid/server/Main.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/2fdbde27/broker/src/main/java/org/apache/qpid/server/Main.java
----------------------------------------------------------------------
diff --git a/broker/src/main/java/org/apache/qpid/server/Main.java b/broker/src/main/java/org/apache/qpid/server/Main.java
index a37cd0d..446cf8b 100644
--- a/broker/src/main/java/org/apache/qpid/server/Main.java
+++ b/broker/src/main/java/org/apache/qpid/server/Main.java
@@ -133,8 +133,8 @@ public class Main
                                                                .build();
 
     private static final Option OPTION_MM_QUIESCE_VHOST = Option.builder("mmqv")
-                                                                .desc("make virtualhosts stay in the quiesced state during management mode.")
-                                                                .longOpt("management-mode-quiesce-virtualhosts")
+                                                                .desc("make virtual host nodes stay in the quiesced state during management mode")
+                                                                .longOpt("management-mode-quiesce-virtualhostnodes")
                                                                 .build();
 
     private static final Option OPTION_MM_HTTP_PORT = Option.builder("mmhttp")
@@ -147,7 +147,7 @@ public class Main
     private static final Option OPTION_MM_PASSWORD = Option.builder("mmpass")
                                                            .argName("password")
                                                            .hasArg()
-                                                           .desc("Set the password for the management mode user "
+                                                           .desc("set the password for the management mode user "
                                                                  + SystemConfig.MANAGEMENT_MODE_USER_NAME)
                                                            .longOpt("management-mode-password")
                                                            .build();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org