Skip to content

Commit

Permalink
Merge pull request #309 from bachmanity1/add-scopes-config
Browse files Browse the repository at this point in the history
Allow specifying scopes in oauth config
birdayz authored Mar 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents daaf2e8 + 0e38e57 commit 23dc332
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
@@ -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,
}
3 changes: 3 additions & 0 deletions examples/sasl_ssl_oauth.yaml
Original file line number Diff line number Diff line change
@@ -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
@@ -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 {

0 comments on commit 23dc332

Please sign in to comment.