-
Notifications
You must be signed in to change notification settings - Fork 47
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: Oauth design #269
base: oauth
Are you sure you want to change the base?
feat: Oauth design #269
Conversation
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.
Pull Request Overview
This pull request introduces OAuth support by adding a new token authentication mechanism and updating corresponding API service and client methods. Key changes include:
- A new package module (oauth.go) that implements token fetching and expiration using JWT.
- Updates to REST API documentation, including new endpoints and model definitions for OAuth tokens.
- Enhancements in the client and base client to support OAuth integration alongside basic authentication.
Reviewed Changes
Copilot reviewed 62 out of 62 changed files in this pull request and generated no comments.
File | Description |
---|---|
oauth.go | Adds TokenAuth and APIOAuth implementations for OAuth token handling. |
oauth_test.go | Introduces tests for token fetching and expiration checking. |
rest/iam/v1/, rest/preview_iam/v1/ | Updates and adds documentation and API service methods for OAuth. |
client/client.go and client/base_client.go | Enhances client functionality to support OAuth with new getters/setters. |
Comments suppressed due to low confidence (2)
oauth.go:71
- Setting the OAuth interface to nil before creating a token might lead to unintended behavior. Please review this line to ensure that the OAuth object is managed correctly.
a.iamService.RequestHandler().Client.SetOauth(nil)
client/client.go:235
- [nitpick] Consider renaming 'SetOauth' to 'SetOAuth' for consistency with the 'GetOAuth' method and to improve readability.
func (c *Client) SetOauth(oauth OAuth) {
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.
OK, we're getting closer. Still hoping for a test on expirations with UTC vs. other time zone.
I have now coverted all date to UTC. Do we still need these tests? |
Feature
This PR adds Oauth to twilio-go.
Changes added:
ClientCredentialProvider
object and pass Client Credential parameters.Client
hasOauth
object which contains the following:a. The IamService Object used --> This will act as an interface for any IAM service we plan to access
b. The Credentials details
Checklist
If you have questions, please file a support ticket, or create a GitHub Issue in this repository.