You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by rx...@apache.org on 2020/08/12 02:41:19 UTC

[pulsar] branch branch-2.6 updated (16df38c -> efa984b)

This is an automated email from the ASF dual-hosted git repository.

rxl pushed a change to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/pulsar.git.


    from 16df38c  Bump the release version to 2.6.1
     new f7e8288  [CPP client]Fix the issue_url parsing failure in oauth2 (#7791)
     new efa984b  Set default root log level to debug (#7789)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 conf/log4j2.yaml                          | 2 +-
 pulsar-client-cpp/lib/auth/AuthOauth2.cc  | 1 +
 pulsar-client-cpp/tests/AuthPluginTest.cc | 6 +++---
 3 files changed, 5 insertions(+), 4 deletions(-)


[pulsar] 01/02: [CPP client]Fix the issue_url parsing failure in oauth2 (#7791)

Posted by rx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rxl pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit f7e828850cfc885f371f4c89dd38e04b4bc81cf0
Author: 冉小龙 <rx...@apache.org>
AuthorDate: Mon Aug 10 17:38:14 2020 +0800

    [CPP client]Fix the issue_url parsing failure in oauth2 (#7791)
    
    Signed-off-by: xiaolong.ran <rx...@apache.org>
    
    
    ### Motivation
    
    The `issuer_url` in the current cpp example needs to be suffixed with `/oauth/token`, otherwise it cannot be recognized correctly and the following error will be returned:
    
    ```
    OAuth2 auth data: 2020-08-10 15:21:06.117 ERROR [0x10ff855c0] AuthOauth2:243 | Response failed for issuerurl https://cloud.streamnative.dev/oauth2/token. response Code 404 passedin: {
        "grant_type": "client_credentials",
        "client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "audience": "urn:sn:pulsar:pi-ns:pi-name"
    }
    
    libc++abi.dylib: terminating with uncaught exception of type char const*
    ```
    
    
    ### Modifications
    
    Add a fixed suffix of `/oauth/token` to issuer_url
    
    ### Verifying this change
    
    Fix test cases as follows:
    
    - testOauth2CredentialFile
    - testOauth2WrongSecret
    - testOauth2
    
    (cherry picked from commit c88ba50ebede46d1d0396e5665c140ca88e17d37)
---
 pulsar-client-cpp/lib/auth/AuthOauth2.cc  | 1 +
 pulsar-client-cpp/tests/AuthPluginTest.cc | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pulsar-client-cpp/lib/auth/AuthOauth2.cc b/pulsar-client-cpp/lib/auth/AuthOauth2.cc
index 72cdf97..5d38eb7 100644
--- a/pulsar-client-cpp/lib/auth/AuthOauth2.cc
+++ b/pulsar-client-cpp/lib/auth/AuthOauth2.cc
@@ -183,6 +183,7 @@ Oauth2TokenResultPtr ClientCredentialFlow::authenticate() {
     curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, "POST");
 
     // set URL: issuerUrl
+    issuerUrl_.append("/oauth/token");
     curl_easy_setopt(handle, CURLOPT_URL, issuerUrl_.c_str());
 
     // Write callback
diff --git a/pulsar-client-cpp/tests/AuthPluginTest.cc b/pulsar-client-cpp/tests/AuthPluginTest.cc
index 6430fd8..18016f6 100644
--- a/pulsar-client-cpp/tests/AuthPluginTest.cc
+++ b/pulsar-client-cpp/tests/AuthPluginTest.cc
@@ -342,7 +342,7 @@ TEST(AuthPluginTest, testOauth2) {
     pulsar::AuthenticationDataPtr data;
     std::string params = R"({
         "type": "client_credentials",
-        "issuer_url": "https://dev-kt-aa9ne.us.auth0.com/oauth/token",
+        "issuer_url": "https://dev-kt-aa9ne.us.auth0.com",
         "client_id": "Xd23RHsUnvUlP7wchjNYOaIfazgeHd9x",
         "client_secret": "rT7ps7WY8uhdVuBTKWZkttwLdQotmdEliaM5rLfmgNibvqziZ-g07ZH52N_poGAb",
         "audience": "https://dev-kt-aa9ne.us.auth0.com/api/v2/"})";
@@ -363,7 +363,7 @@ TEST(AuthPluginTest, testOauth2WrongSecret) {
 
         std::string params = R"({
         "type": "client_credentials",
-        "issuer_url": "https://dev-kt-aa9ne.us.auth0.com/oauth/token",
+        "issuer_url": "https://dev-kt-aa9ne.us.auth0.com",
         "client_id": "Xd23RHsUnvUlP7wchjNYOaIfazgeHd9x",
         "client_secret": "rT7ps7WY8uhdVuBTKWZkttwLdQotmdEliaM5rLfmgNibvqziZ",
         "audience": "https://dev-kt-aa9ne.us.auth0.com/api/v2/"})";
@@ -387,7 +387,7 @@ TEST(AuthPluginTest, testOauth2CredentialFile) {
     pulsar::AuthenticationDataPtr data;
     std::string params = R"({
         "type": "client_credentials",
-        "issuer_url": "https://dev-kt-aa9ne.us.auth0.com/oauth/token",
+        "issuer_url": "https://dev-kt-aa9ne.us.auth0.com",
         "private_key": "../../pulsar-broker/src/test/resources/authentication/token/cpp_credentials_file.json",
         "audience": "https://dev-kt-aa9ne.us.auth0.com/api/v2/"})";
 


[pulsar] 02/02: Set default root log level to debug (#7789)

Posted by rx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rxl pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit efa984bf5afd7af828622780e1522293fdaa19de
Author: Sijie Guo <si...@apache.org>
AuthorDate: Mon Aug 10 07:21:41 2020 -0700

    Set default root log level to debug (#7789)
    
    *Motivation*
    
    Since currently the root log level is set to info, it is not easy to turn the logging level
    to debug by running `PULSAR_LOG_LEVEL=debug bin/pulsar standalone`.
    
    (cherry picked from commit 76090c5ddcd6dfba17542c4a082374085e403432)
---
 conf/log4j2.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conf/log4j2.yaml b/conf/log4j2.yaml
index 3482674..0ca3966 100644
--- a/conf/log4j2.yaml
+++ b/conf/log4j2.yaml
@@ -33,7 +33,7 @@ Configuration:
       - name: "pulsar.log.appender"
         value: "RoutingAppender"
       - name: "pulsar.log.root.level"
-        value: "info"
+        value: "debug"
       - name: "pulsar.log.level"
         value: "info"
       - name: "pulsar.routing.appender.default"