Skip to content

Commit

Permalink
allow specifying scopes in oauth config
Browse files Browse the repository at this point in the history
  • Loading branch information
bachmanity1 committed Mar 1, 2024
1 parent 0ccb57e commit 0e38e57
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions cmd/kaf/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func newTokenProvider() *tokenProvider {
ClientID: cluster.SASL.ClientID,
ClientSecret: cluster.SASL.ClientSecret,
TokenURL: cluster.SASL.TokenURL,
Scopes: cluster.SASL.Scopes,
},
staticToken: false,
}
Expand Down
3 changes: 3 additions & 0 deletions examples/sasl_ssl_oauth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ clusters:
clientID: my_client_oauth
clientSecret: my_secret_oauth
tokenURL: https//some.token.endpoint.com/token
scopes:
- scope1
- scope2
TLS:
insecure: true
security-protocol: SASL_SSL
17 changes: 9 additions & 8 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import (
)

type SASL struct {
Mechanism string `yaml:"mechanism"`
Username string `yaml:"username"`
Password string `yaml:"password"`
ClientID string `yaml:"clientID"`
ClientSecret string `yaml:"clientSecret"`
TokenURL string `yaml:"tokenURL"`
Token string `yaml:"token"`
Version int16 `yaml:"version"`
Mechanism string `yaml:"mechanism"`
Username string `yaml:"username"`
Password string `yaml:"password"`
ClientID string `yaml:"clientID"`
ClientSecret string `yaml:"clientSecret"`
TokenURL string `yaml:"tokenURL"`
Scopes []string `yaml:"scopes"`
Token string `yaml:"token"`
Version int16 `yaml:"version"`
}

type TLS struct {
Expand Down

0 comments on commit 0e38e57

Please sign in to comment.