diff --git a/oauth2/client_credentials_provider.go b/oauth2/client_credentials_provider.go index 271637653b..731b39955b 100644 --- a/oauth2/client_credentials_provider.go +++ b/oauth2/client_credentials_provider.go @@ -19,14 +19,9 @@ package oauth2 import ( "encoding/json" - "fmt" "io/ioutil" ) -const ( - KeyFileTypeServiceAccount = "sn_service_account" -) - type KeyFileProvider struct { KeyFile string } @@ -58,9 +53,6 @@ func (k *KeyFileProvider) GetClientCredentials() (*KeyFile, error) { if err != nil { return nil, err } - if v.Type != KeyFileTypeServiceAccount { - return nil, fmt.Errorf("open %s: unsupported format", k.KeyFile) - } return &v, nil } diff --git a/pulsar/client_impl_test.go b/pulsar/client_impl_test.go index 276e4fb313..ba17219e9c 100644 --- a/pulsar/client_impl_test.go +++ b/pulsar/client_impl_test.go @@ -266,7 +266,7 @@ func mockKeyFile(server string) (string, error) { return "", err } _, err = kf.WriteString(fmt.Sprintf(`{ - "type":"sn_service_account", + "type":"resource", "client_id":"client-id", "client_secret":"client-secret", "client_email":"oauth@test.org", diff --git a/pulsar/internal/auth/oauth2_test.go b/pulsar/internal/auth/oauth2_test.go index c8a4830485..f1f9e07e17 100644 --- a/pulsar/internal/auth/oauth2_test.go +++ b/pulsar/internal/auth/oauth2_test.go @@ -69,7 +69,7 @@ func mockKeyFile(server string) (string, error) { return "", err } _, err = kf.WriteString(fmt.Sprintf(`{ - "type":"sn_service_account", + "type":"resource", "client_id":"client-id", "client_secret":"client-secret", "client_email":"oauth@test.org",