-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Abstract OAuth implementation in the SDK #13983
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
Abstract OAuth implementation in the SDK #13983
Conversation
* Install `simple-oauth2` to handle OAuth client requests * Rename some methods and types to reuse them * Abstract the HTTP requests so that it can be used for Connect and for normal API requests * Implement logic to fetch OAuth client credentials * Bump minor version of the SDK
@jverce is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe pull request introduces significant enhancements to the Changes
Possibly related PRs
Suggested reviewersPoem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
packages/sdk/src/server/index.ts
Outdated
/** | ||
* The client ID of your workspace's OAuth application. | ||
*/ | ||
oauthClientId: string; |
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.
We should make these optional for now, and handle that optionality in the rest of the code, since project keys alone can authorize Connect API requests and we don't yet want to force those customers to use OAuth clients. We may end up consolidating on OAuth for the Connect API, too, and just make people pass the dev / prod project ID (removing project secret entirely), but for now it's an either-or.
packages/sdk/src/server/index.ts
Outdated
@@ -358,6 +394,52 @@ class ServerClient { | |||
return result; | |||
} | |||
|
|||
/** | |||
* Makes a request to the Connect API. |
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.
replace "Connect" with "Pipedream"
Changelog
simple-oauth2
to handle OAuth client requestsWHY
So that we can make API requests using the OAuth credentials.
Summary by CodeRabbit
ServerClient
functionality with new methods for handling API requests securely.