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 <[email protected]>
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))
}