Skip to content

feat: Integrations catalog #553

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

Draft
wants to merge 950 commits into
base: main
Choose a base branch
from

Conversation

openint-bot
Copy link
Collaborator

@openint-bot openint-bot commented May 5, 2025

CodeAnt-AI Description

  • Added a new listConnectorIntegrations endpoint to the integrationRouter, enabling clients to retrieve a list of integrations for a specified connector, with OpenAPI documentation and robust input/output validation.
  • Implemented logic to handle connectors both with and without a listIntegrations method, ensuring consistent API responses.
  • Created comprehensive tests for the new endpoint, verifying correct behavior and response structure for the 'google-drive' connector.

This PR introduces a new API endpoint for listing connector integrations, complete with OpenAPI metadata and validation. It also adds thorough tests to ensure the endpoint works as intended, improving the API's extensibility and reliability.


Changes walkthrough

Relevant files
Enhancement
integration.ts
Add listConnectorIntegrations endpoint to integrationRouter with
OpenAPI metadata

packages/api-v1/trpc/routers/integration.ts

  • Introduced a new integrationRouter with a listConnectorIntegrations
    endpoint.
  • Added OpenAPI metadata for the new endpoint, including method, path,
    description, and summary.
  • Implemented logic to list integrations for a given connector, handling
    both connectors with and without a listIntegrations method.
  • Defined input and output schemas using Zod for type safety and
    validation.
  • +61/-0   
    Tests
    integration.test.ts
    Add tests for listConnectorIntegrations endpoint in integrationRouter

    packages/api-v1/trpc/routers/integration.test.ts

  • Added a test suite for the new listConnectorIntegrations endpoint.
  • Tested the endpoint for the 'google-drive' connector, verifying
    response structure and content.
  • Utilized database test utilities and mocked viewer context for
    endpoint calls.
  • +30/-0   
    💡 Usage Guide

    Checking Your Pull Request

    Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

    Talking to CodeAnt AI

    Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

    @codeant-ai ask: Your question here
    

    This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

    Retrigger review

    Ask CodeAnt AI to review the PR again, by typing:

    @codeant-ai: review
    

    Check Your Repository Health

    To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

    openint-bot and others added 30 commits March 28, 2025 15:47
    * Update to base on connector config not connector
    
    * Call the correct useConnectHook
    
    * Got the plaid dialog to show up
    
    * Successfully calling postConnect res also
    
    * fix  some type errors
    
    * Fix remaining type errors
    
    * optimize pre-connect to occur in server component with initial data
    
    * Remove dummy
    
    * Add myConnections
    
    * Add tabs back again
    
    * Tabs.client working
    
    * fix so only passing structured data to server component
    
    * Use hash kind of works but has initial flash
    
    * Finally got the right approach
    
    * Moving into proper utils
    
    * magic link page with connect embed
    
    * fix schemaForm so connect re-renders in real time
    
    * Accept param connector_name
    
    * Cannot figure out why zod schema does not work
    
    * Create pattern around passing theme variables into connect
    
    * Make it look like a browser
    
    * Add support for delete connection
    * adding organization model
    
    * adding get organization api
    
    * adding settings page
    * connectpage with new schemaform in storybook
    
    * connectionportal
    
    * refactor: update ConnectionPortal card styles
    
    * ui tweaks to cards
    
    * UI changes and reorganizing files
    * adding events table
    
    * new connections detail sheet
    
    * lint
    * adding webhook url to settings form
    
    * making font light
    
    * fixing tests
    
    * adding to export
    
    * Update packages/api-v1/routers/onboarding.ts
    
    Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
    …te (#402)
    
    * Adding separate commands package
    
    * Popver, Dialog and inline variants for commands
    
    * Test out with keyboard shortcuts
    
    * Command components story ready
    
    * Remove previous ui-v0 commands
    
    * Commands to switch organization
    
    * Navigate command also
    
    * Introduce CommandContext and use it for the cmd+k
    hint in AppHeader
    
    * move command into its own file
    
    * Use command button inside connect also
    
    * hideGroupHeadings and initialParams, CommandButton later
    
    * Fixing global commands provider hierarchy
    
    * Add scaffolding for a bunch more connection actions
    
    * Fix types and build
    
    * use client
    * figma components and connectionstable
    
    * vercel fix
    
    ---------
    
    Co-authored-by: Amadeo Pellicce <[email protected]>
    …console (#405)
    
    * consolidating rewrite logic
    
    * removing dashboard path
    
    * adjusting rewrite
    
    * setting correct vercel hosts
    * Scaffold connnector card proper
    
    * Add some fixture data for connections card and start of .cursorrules
    
    * Further update fixtures for connect
    
    * Bettering story
    
    * Add grid for connection
    
    * Add DataTileView component and its associated stories for rendering connection and simple item tiles
    
    * Remove SimpleDataTable and related story files; update .cursorrules with additional guidelines for component creation and usage.
    
    * Use ConnectionCard in Connect
    
    * expand on connector when retrieving connection
    
    * Removing irrelevant stuff
    
    * Scaffold ConnectorConfigCard
    
    * use the connector config card in connect
    
    * Fix type errors
    
    * fix more tests
    
    * Fix more tests
    * adding /api/v1 url
    
    * making request init
    
    * adding v1 project
    
    * No more elysia prefix, always assume root
    
    * fix regex bug
    
    * Fix test utils
    
    ---------
    
    Co-authored-by: OpenInt Bot <[email protected]>
    * Mass removing everything unrelated to v1
    
    * Remove patches
    
    * Fix sdk test
    
    * Delete outdated snapshot
    * OAuth2 client on fetch
    
    * Add a default page
    * adding org id to connect context
    
    * fetching redirect uri from db
    
    * refactoring webhook input form
    
    * renaming onboarding->organization router
    
    * renaming onboarding->organization router
    
    * abstracting metadata url endpoint
    
    * updating import
    
    * Update packages/api-v1/routers/organization.ts
    
    Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
    
    * Update connectors/cnext/_defaults/oauth2/utils.ts
    
    Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
    )
    
    * Fix crash due to ConnectorConfigForm importing from all connectors
    
    Unable to setup eslint rule properly... but nice try
    
    * comment out eslint change for now
    
    * Temp fix for storybook
    * Lazily create api key and org, plus add api e2e test
    
    * Fix broken preConnect from plaid
    
    * fix test
    Due to build failures on main
    
    This reverts commit 7190340.
    * adding import connection method
    
    * adding import connection method
    
    * reusing ref
    …t to showing client_id and client_secret. The toggle should not be shown (#554)
    
    * Add hasOpenIntCredentials flag to determine if the toggle is visible in ccfg sheet
    
    * Update docs
    
    * Use correct casing for new flag
    
    * Update api casing for auth_type and all ui references
    
    * Regenerate docs after api changes
    @openint-bot openint-bot force-pushed the oint-1291-integrations-directory-search branch from 55a592b to 086edc6 Compare May 7, 2025 03:38
    Copy link

    prophet-code-review-bot bot commented May 7, 2025

    Bug Report

    Name Severity Example test case Description
    Plaid integration uses production credentials in all environments Critical Run the integration page in a development environment. The listIntegrations method in connectors/connector-plaid/server.ts always sets the env variable to 'production', causing it to use production credentials regardless of the actual environment.

    Comments? Email us.

    Copy link

    prophet-code-review-bot bot commented May 7, 2025

    Bug Report

    Name Severity Example test case Description
    Missing Environment Variable Handling in Plaid Connector Medium Deploy the application without setting the int_plaid__CLIENT_ID and int_plaid__CLIENT_SECRET_PRODUCTION environment variables, and access the /connector/plaid/integrations endpoint. The getPlatformConfig function in connectors/connector-plaid/PlaidClient.ts does not handle the case where the required environment variables (int_plaid__CLIENT_ID, int_plaid__CLIENT_SECRET_SANDBOX, int_plaid__CLIENT_SECRET_DEVELOPMENT, int_plaid__CLIENT_SECRET_PRODUCTION) are not set. This will cause createEnv to throw an error, crashing the application or causing unexpected behavior when listing Plaid integrations. To fix this, the getPlatformConfig function should check if the environment variables are set and return an error or a default value if they are not.

    Comments? Email us.

    pellicceama and others added 19 commits May 7, 2025 19:58
    * adding build vs buy section
    
    * disabling apis from oas and docs
    
    * Update docs/generateDocsOas.bin.cjs
    
    Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
    
    * updating docs
    
    * updating defs
    
    * merging main and updating oas
    
    ---------
    
    Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
    * adding expires_at calculation back
    
    * improving the connection sheet page
    * fix: union for default credentials overlapping causing custom credentials to be parsed as default
    
    * Fix types
    * fixing check connection and tightening tests
    
    * adding expires_at calculation at import and check
    … free form user input (#560)
    
    * small improvs
    
    * ditto scopes trim
    
    * final check
    @openint-bot openint-bot force-pushed the oint-1291-integrations-directory-search branch from 441d048 to 9d283d5 Compare May 9, 2025 00:31
    Copy link

    prophet-code-review-bot bot commented May 9, 2025

    Bug Report

    Name Severity Example test case Description
    Plaid API Injection Vulnerability in listConnectorIntegrations endpoint High Send a crafted search_text query to the listConnectorIntegrations endpoint for the Plaid connector. For example, a string like " OR 1=1" or similar SQL-like injection payloads. The search_text parameter in the listConnectorIntegrations endpoint is not properly sanitized before being passed to the Plaid /institutions/search API. This could allow an attacker to perform a Plaid API Injection attack, potentially accessing sensitive institution data or causing denial-of-service.

    Comments? Email us.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    size:M This PR changes 30-99 lines, ignoring generated files
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    4 participants