You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2020/07/31 04:32:10 UTC

[pulsar-client-go] branch master updated: Add oauth2 to the provider (#338)

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

sijie 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 27a9c06  Add oauth2 to the provider (#338)
27a9c06 is described below

commit 27a9c0699498108a65c5c8379af59f6eb785fdbc
Author: Yong Zhang <zh...@gmail.com>
AuthorDate: Fri Jul 31 12:32:00 2020 +0800

    Add oauth2 to the provider (#338)
    
    ---
    
    *Motivation*
    
    Add oauth2 authentication can be constructed by name.
---
 pulsar/internal/auth/provider.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pulsar/internal/auth/provider.go b/pulsar/internal/auth/provider.go
index 220ff14..669056d 100644
--- a/pulsar/internal/auth/provider.go
+++ b/pulsar/internal/auth/provider.go
@@ -63,6 +63,9 @@ func NewProvider(name string, params string) (Provider, error) {
 	case "athenz", "org.apache.pulsar.client.impl.auth.AuthenticationAthenz":
 		return NewAuthenticationAthenzWithParams(m)
 
+	case "oauth2", "org.apache.pulsar.client.impl.auth.oauth2.AuthenticationOAuth2":
+		return NewAuthenticationOAuth2WithParams(m)
+
 	default:
 		return nil, errors.New(fmt.Sprintf("invalid auth provider '%s'", name))
 	}