Skip to content
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

Provide mutator methods for google.go's oauth2 config. #76

Closed
chrishalbert opened this issue Jan 15, 2024 · 2 comments · Fixed by #77
Closed

Provide mutator methods for google.go's oauth2 config. #76

chrishalbert opened this issue Jan 15, 2024 · 2 comments · Fixed by #77

Comments

@chrishalbert
Copy link
Contributor

chrishalbert commented Jan 15, 2024

I'm using environment variables to handle my secrets. I was wondering if it would be ok for me to submit mutator methods to support another means of setting the oauth2.Config's in google.go specifically. I'd of course want to ensure this remains backwards compatible, so I would only be adding these setters. Below are the functions I'd like to add:

// Usage would be something like:
google.SetClientID(configs.ClientID)
google.SetClientSecret(configs.ClientSecret)
google.SetRedirectURL(redirectURL)
google.SetScopes([]string{gmail.GmailReadonlyScope})
google.SetEndpoint(google.Endpoint)

If there's no aversion, I'd be happy to submit an PR - with tests too! :)

@chrishalbert
Copy link
Contributor Author

I didn't see this listed, so I created an issue and went to the PR's to see what feedback I should be aware of, only to find #53 🤦 - I can close this, or fix their PR, or open a new one. Whatever it takes to get the addition. Thanks!

@szuecs
Copy link
Member

szuecs commented Jan 16, 2024

Sounds good @chrishalbert . You can also do something like WithOptions(o Options) and create all the settings you want to set via the Options struct that you would create.
Whatever you prefer (takeover the PR or recreate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants