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

[FUNK-1504] actions-webhook-extensible - Make changes to oauth2 refresh token handler #2630

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

cyberlord29
Copy link
Contributor

@cyberlord29 cyberlord29 commented Dec 9, 2024

Made changes to to the refreshtoken handler to handle different flows for oauth2.0
Changes limited to action folder

Precursor to removing duplicate oauth object inside dynamicAuthSettings and introducing dynamic auth options into Destination Kit

Testing

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [If destination is already live] Tested for backward compatibility of destination. Note: New required fields are a breaking change.
  • [Segmenters] Tested in the staging environment
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.

Project coverage is 78.51%. Comparing base (b3bf231) to head (999eb3d).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...tions/src/destinations/webhook-extensible/index.ts 11.11% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2630      +/-   ##
==========================================
- Coverage   78.97%   78.51%   -0.46%     
==========================================
  Files        1083     1030      -53     
  Lines       20838    18199    -2639     
  Branches     4150     3436     -714     
==========================================
- Hits        16456    14289    -2167     
+ Misses       3233     2767     -466     
+ Partials     1149     1143       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

},
body: new URLSearchParams({
grant_type: 'refresh_token',
refresh_token: auth.refreshToken ?? oauth.access.refresh_token,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Callout - will get rid of this in the next iteration when we introduce dynamic auth options in the authentication types in destination kit

Copy link
Contributor

Choose a reason for hiding this comment

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

Is the access path oauth.access.refresh_token correct? or should it be oauth.refresh_token?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oauth.access.refresh_token, access has tokens and ttl

@joe-ayoub-segment joe-ayoub-segment merged commit 168f3d0 into main Dec 10, 2024
12 of 14 checks passed
@joe-ayoub-segment joe-ayoub-segment deleted the feature/webhook-refresh-token branch December 10, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants