Skip to content

feat: Oauth design (#269) #272

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

Merged
merged 36 commits into from
Apr 7, 2025
Merged

feat: Oauth design (#269) #272

merged 36 commits into from
Apr 7, 2025

Conversation

manisha1997
Copy link
Contributor

@manisha1997 manisha1997 commented Apr 2, 2025

Feature

This PR adds Oauth to twilio-go.
Changes added:

  1. Customers will now use the ClientCredentialProvider object and pass Client Credential parameters.
  2. The struct Client has Oauth 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
  3. Added test cases

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

* feat: oauth feature

* feat: auth feature

* refactor the interface

* feat: Oauth implementation

* feat: remove no auth client

* feat: Add test cases

* chore: address review comments

* chore: address review comments

* feat: Add docs

* feat: Add docs

* chore: address review comments

* feat: addressed review comments

* feat: addressed review comments

* feat: addressed review comments

* feat: addressed review comments

* feat: added public oauth examples

---------

Co-authored-by: kburke <[email protected]>
@manisha1997 manisha1997 force-pushed the oauth branch 4 times, most recently from dae1096 to f060659 Compare April 2, 2025 16:52
oauth.go Outdated
return true, err
}

expirationTime := time.Unix(int64(exp), 0).UTC()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to be careful here and probably need some tests.

I believe what this will do if you have a non-Unix time, is create a local timestamp, and then convert it to UTC.

What we want to do is parse the timestamp in the UTC time zone.

We should add some time zone related test cases.

Copy link
Contributor

@kevinburkesegment kevinburkesegment Apr 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the above comment is correct on a closer reading but I'd prefer if we had test cases

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I will add them.

Copy link
Contributor

@tiwarishubham635 tiwarishubham635 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@manisha1997 manisha1997 merged commit 16c2946 into main Apr 7, 2025
19 checks passed
@manisha1997 manisha1997 deleted the oauth branch April 7, 2025 07:21
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 this pull request may close these issues.

3 participants