feat(gateway): implement Phase 1 connector API endpoints#32
Merged
Conversation
Phase 1 API Implementation: 1. GET /v1/wiki/connectors - List available connector types 2. POST /v1/wiki/connectors/test - Test connection 3. POST /v1/wiki/connectors/browse - Browse directory Features: - Connector metadata with field definitions - Support for Local, Git, S3 connectors (more to add) - UUID v7 for connector IDs (time-sortable) - Proper field validation metadata - Sensitive field marking API Structure: - ConnectorMetadata - Type, name, description, fields - ConnectorField - Name, type, required, options, sensitive - TestConnectionRequest/Response - Connection validation - BrowseDirectoryRequest/Response - Directory listing Implementation Status: - β API structure defined - β Routes integrated into wiki routes - β Basic responses (TODO: actual implementation) - β³ Connection test logic (Phase 2) - β³ Directory browsing logic (Phase 2) Next: - Implement actual connector instantiation - Implement connection testing - Implement directory browsing - Add session management Code: ~240 lines
Implementation Guide: - Helper function for connector creation - Test connection actual logic - Browse directory options (stateless vs session) - Add more connector metadata Challenges: - StorageConnector requires &mut self for connect() - Need session management for browse - Ownership handling (Box vs Arc) Recommended Approach: 1. Implement test_connection (30 min) 2. Keep browse as stub 3. Merge PR #32 4. Session management in Phase 2 Estimated: 30-60 minutes for basic functionality
Changes: - Add LocalConnector and GitConnector imports - Implement actual connection testing for local and git - Handle missing config fields with clear errors - Return proper error codes on failure - Keep UUID v7 for connector IDs Supported: - Local filesystem connector - Git connector with optional token auth Error Handling: - Missing config fields -> INVALID_CONFIG - Connection failures -> CONNECTION_FAILED Next: Session management for browse_directory (Phase 2)
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.
π‘ Phase 1 Connector API Implementation
β Implemented Endpoints
1. GET /v1/wiki/connectors
List all available connector types with metadata:
Currently supports: Local, Git, S3 (more to be added)
2. POST /v1/wiki/connectors/test
Test connection with provided credentials:
Status: Basic structure (TODO: actual testing logic)
3. POST /v1/wiki/connectors/browse
Browse directory structure:
Status: Basic structure (TODO: actual browsing logic)
π§ Technical Details
UUID v7:
Data Structures:
Field Types:
π Code Stats
π― Implementation Status
Phase 1 (This PR):
Phase 2 (Next):
π§ͺ Testing
Manual Test:
π Next Steps
π Related