feat!: connector system with grant implementation#67
Merged
mateonunez merged 3 commits intomainfrom Jan 7, 2026
Merged
Conversation
Signed-off-by: mateonunez <mateonunez95@gmail.com>
- Grant Service - Gateway routes - Modal configurator Signed-off-by: mateonunez <mateonunez95@gmail.com>
Signed-off-by: mateonunez <mateonunez95@gmail.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces comprehensive multi-user/tenant support for connectors, adds encryption for sensitive configuration data, and implements a grant-based access control system. This enables secure, user-scoped connector management in a multi-tenant environment.
✨ New Features
1. Encryption Utilities (
core/src/utils/encryption.utils.ts)AIT_ENCRYPTION_KEY(required for connector configs).env.examplefiles2. Connector Grant Service (
connectors/src/services/connector.grant.service.ts)isGranted(vendor, userId?): Check if user has access to a vendorgetGrantedVendors(userId): Get all granted vendors for a userinvalidateCache(): Clear grant cache3. Multi-User Connector Architecture
IConnectorOAuthConfigwithuserIdandconnectorConfigIduserIdandconnectorConfigIdin constructorsgetServiceByConfig()method that:configIdanduserIduserIdandconnectorConfigIdinto service config4. Database Schema Updates
connector_configs,oauth_tokens, andproviderstablesconnector-configs.schema.tswith encrypted config supportpostgres/src/schemas/index.ts🔧 Improvements
Gateway Routes
userIdvia:X-User-IdheaderuserIdquery parameterstateparameter (format:configId:userId)getServiceByConfig()for database-driven connector instancesgetService()methodBrowser Compatibility
cryptoto CryptoJS for browser compatibilitybuffer,global, andprocessbuffer@^6.0.3dependencyUI Enhancements
vendorprop to all integration pages (GitHub, Linear, Spotify, X, Slack, Notion, Google)VendorConnectButtonwith fallback icons and colorsPostgres Package
db:seedscript for database seedingdb:cleanupscript for truncating oauth_tokensand,eq) from main indexschemas/index.ts🔄 Refactoring
userIdandconnectorConfigIdgetterssaveOAuthData()to acceptuserIdandconnectorConfigIduserIdandconnectorConfigIdfieldsIConnectorOAuthConfig📦 Dependencies
buffer@^6.0.3to@ait/uitfor browser polyfills@ait/postgresdependency to@ait/gateway🔌 Configuration
AIT_ENCRYPTION_KEY: 64-character hex string (32 bytes) for encrypting connector configs.env,connectors/.env,postgres/.env,retove/.env🗄️ Database Migrations
🔒 Security
📊 Impact
🧪 Testing
encryption.utils.test.ts)userIdandconnectorConfigIdin constructorsAIT_ENCRYPTION_KEYenvironment variable is now required for connector functionality