-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add scopes option to client #1082
Conversation
oidc_cli/oidc_impl/client/client.go
Outdated
@@ -36,7 +36,7 @@ type Config struct { | |||
} | |||
|
|||
// NewClient returns a new client | |||
func NewClient(ctx context.Context, config *Config, clientOptions ...Option) (*Client, error) { | |||
func NewClient(ctx context.Context, config *Config, scopes []string, clientOptions ...Option) (*Client, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this scopes argument and use the clientOptions instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to understand how this option works. Could you explain how we'd use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind of like this comment: #1082 (comment).
You'd have an Option function that updates the scopes, rather than passing them in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
As an additional item, please at a SetOauthConfigScope
function that does what you say in the comments. Place is under the here:
var SetOauth2AuthStyle = func(authStyle oauth2.AuthStyle) Option { |
No new added parameters to the function, the user will need to pass in something like this:
to add new scopes to the client if they don't want the default scopes.