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

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new 742f1b1  Improve support for Azure AD OAuth 2.0 (#634)
742f1b1 is described below

commit 742f1b1074033655e33137b60f2d0c6c2957fe54
Author: Eron Wright <ewri...@streamnative.io>
AuthorDate: Wed Oct 6 08:44:57 2021 -0700

    Improve support for Azure AD OAuth 2.0 (#634)
    
    - rename scopes param to scope
---
 pulsar/internal/auth/oauth2.go      | 4 ++--
 pulsar/internal/auth/oauth2_test.go | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pulsar/internal/auth/oauth2.go b/pulsar/internal/auth/oauth2.go
index 7fae133..e162e4e 100644
--- a/pulsar/internal/auth/oauth2.go
+++ b/pulsar/internal/auth/oauth2.go
@@ -36,7 +36,7 @@ const (
        ConfigParamTypeClientCredentials = "client_credentials"
        ConfigParamIssuerURL             = "issuerUrl"
        ConfigParamAudience              = "audience"
-       ConfigParamScopes                = "scopes"
+       ConfigParamScope                 = "scope"
        ConfigParamKeyFile               = "privateKey"
        ConfigParamClientID              = "clientId"
 )
@@ -64,7 +64,7 @@ func NewAuthenticationOAuth2WithParams(params 
map[string]string) (Provider, erro
        case ConfigParamTypeClientCredentials:
                flow, err := 
oauth2.NewDefaultClientCredentialsFlow(oauth2.ClientCredentialsFlowOptions{
                        KeyFile:          params[ConfigParamKeyFile],
-                       AdditionalScopes: 
strings.Split(params[ConfigParamScopes], " "),
+                       AdditionalScopes: 
strings.Split(params[ConfigParamScope], " "),
                })
                if err != nil {
                        return nil, err
diff --git a/pulsar/internal/auth/oauth2_test.go 
b/pulsar/internal/auth/oauth2_test.go
index a3825e2..536c0dd 100644
--- a/pulsar/internal/auth/oauth2_test.go
+++ b/pulsar/internal/auth/oauth2_test.go
@@ -98,7 +98,7 @@ func TestNewAuthenticationOAuth2WithParams(t *testing.T) {
                        ConfigParamClientID:  "client-id",
                        ConfigParamAudience:  "audience",
                        ConfigParamKeyFile:   kf,
-                       ConfigParamScopes:    "profile",
+                       ConfigParamScope:     "profile",
                },
                {
                        ConfigParamType:      ConfigParamTypeClientCredentials,
@@ -106,7 +106,7 @@ func TestNewAuthenticationOAuth2WithParams(t *testing.T) {
                        ConfigParamClientID:  "client-id",
                        ConfigParamAudience:  "audience",
                        ConfigParamKeyFile:   fmt.Sprintf("file://%s", kf),
-                       ConfigParamScopes:    "profile",
+                       ConfigParamScope:     "profile",
                },
                {
                        ConfigParamType:      ConfigParamTypeClientCredentials,
@@ -120,7 +120,7 @@ func TestNewAuthenticationOAuth2WithParams(t *testing.T) {
   "client_email":"oa...@test.org",
   "issuer_url":"%s"
 }`, server.URL),
-                       ConfigParamScopes: "profile",
+                       ConfigParamScope: "profile",
                },
        }
 

Reply via email to