Skip to content

Connection validation and making expires_at optional #244

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 6 commits into from
Jan 28, 2025

Conversation

pellicceama
Copy link
Collaborator

@pellicceama pellicceama commented Jan 28, 2025

Important

Enhances connection validation by introducing optional expires_at in OAuth credentials and adding a skipValidation parameter for flexible schema validation.

  • Behavior:
    • Introduces zOauthCredentials schema in oauthConnector.ts to handle optional expires_at in OAuth credentials.
    • Updates proxyHandler.ts to check for optional expires_at in credentials.
    • Modifies connectionRouter.ts to pass true for skipValidation in getConnectionOrFail() and getConnectionExpandedOrFail().
  • Validation:
    • Adds skipValidation parameter to getConnectorConfigOrFail(), getIntegrationOrFail(), getConnectionOrFail(), getPipelineOrFail(), getConnectionExpandedOrFail(), and getPipelineExpandedOrFail() in dbService.ts.
    • Uses skipValidation to bypass schema validation when necessary.
  • Misc:
    • Refactors oauthConnector.ts to use zOauthCredentials in oauthBaseSchema.
    • Fixes optional chaining in proxyHandler.ts for credentialsExpired check.

This description was created by Ellipsis for d069ddc. It will automatically update as commits are pushed.

Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
openint ❌ Failed (Inspect) Jan 28, 2025 6:05pm

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 40a6400 in 2 minutes and 24 seconds

More details
  • Looked at 89 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. packages/api/proxyHandler.ts:17
  • Draft comment:
    The expires_at field is now optional in the zOauthCredentials schema, but this code assumes it is always present. Consider handling the case where expires_at is undefined to avoid potential runtime errors.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_z30jVbX9rgx38nUV


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on a0e3eaa in 39 seconds

More details
  • Looked at 63 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_9zSk6wCSJgv6MEqP


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -205,15 +208,16 @@ export function makeDBService({
return zRaw.pipeline.parse(pipe)
})

const getConnectionExpandedOrFail = (id: Id['conn']) =>
const getConnectionExpandedOrFail = (id: Id['conn'], skipValidation = false) =>
getConnectionOrFail(id).then(async (conn) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

The getConnectionExpandedOrFail function should pass the skipValidation parameter to getConnectionOrFail to ensure consistent behavior.

Suggested change
getConnectionOrFail(id).then(async (conn) => {
getConnectionOrFail(id, skipValidation)

@pellicceama pellicceama merged commit 95751ad into main Jan 28, 2025
3 of 4 checks passed
@pellicceama pellicceama deleted the connection-validation branch January 28, 2025 18:04
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on d069ddc in 35 seconds

More details
  • Looked at 122 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. packages/engine-backend/services/dbService.ts:213
  • Draft comment:
    The skipValidation parameter should be passed to getConnectionOrFail to ensure consistent behavior when validation is skipped. Please update the call to getConnectionOrFail(id, skipValidation).
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_dWBk4LFDjqFUIECl


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

1 participant