Skip to content

Comments

feat(gateway): Phase 4 - Save & List Connector Configs#35

Merged
TelivANT merged 1 commit intomainfrom
feat/wiki-connector-phase4-redis
Feb 21, 2026
Merged

feat(gateway): Phase 4 - Save & List Connector Configs#35
TelivANT merged 1 commit intomainfrom
feat/wiki-connector-phase4-redis

Conversation

@TelivANT
Copy link
Owner

Phase 4 Implementation - 100% Complete! πŸŽ‰

Features

  • βœ… Save connector configurations
  • βœ… List saved configurations
  • βœ… File-based storage (minimal dependencies)
  • βœ… UUID v7 for config IDs

New Endpoints

  1. POST /v1/wiki/connectors - Save configuration
  2. GET /v1/wiki/connectors/saved - List saved configs

Storage Design

  • Path: ./data/connectors/{id}.json
  • Format: JSON (human-readable)
  • No encryption: Can add AES-256-GCM later if needed
  • Async I/O: tokio::fs for non-blocking operations

Request/Response Examples

Save Config:

POST /v1/wiki/connectors
{
  "name": "My GitHub Repo",
  "connector_type": "git",
  "config": {
    "url": "https://github.com/user/repo.git",
    "token": "ghp_xxx"
  }
}

Response:
{
  "id": "<uuid-v7>",
  "message": "Connector saved successfully"
}

List Configs:

GET /v1/wiki/connectors/saved

Response:
[
  {
    "id": "<uuid>",
    "name": "My GitHub Repo",
    "connector_type": "git",
    "config": {...},
    "created_at": "2026-02-21T15:30:00Z"
  }
]

Complete API (7/7 Endpoints) βœ…

  1. βœ… GET /v1/wiki/connectors - List connector types
  2. βœ… POST /v1/wiki/connectors/test - Test connection
  3. βœ… POST /v1/wiki/connectors/browse - Browse directories
  4. βœ… POST /v1/wiki/connectors/generate - Generate wiki
  5. βœ… GET /v1/wiki/jobs/{id} - Check status
  6. βœ… POST /v1/wiki/connectors - Save config
  7. βœ… GET /v1/wiki/connectors/saved - List configs

Implementation Details

  • No external DB: Uses file system (project standard)
  • Minimal code: ~80 lines for both endpoints
  • Type-safe: Rust structs with serde
  • Async: Non-blocking I/O

Future Enhancements (Optional)

  • Add AES-256-GCM encryption for sensitive fields
  • Add user_id filtering
  • Add config update/delete endpoints
  • Migrate to Redis/SQLite if needed

Progress Summary

  • βœ… Phase 1: Core API (3 endpoints)
  • βœ… Phase 2: Session management
  • βœ… Phase 3: Wiki generation
  • βœ… Phase 4: Config persistence

Total: 8 connectors + 7 API endpoints + ~2400 lines of code

Closes #34 follow-up

Changes:
- Add POST /v1/wiki/connectors (save config)
- Add GET /v1/wiki/connectors/saved (list configs)
- File-based storage in ./data/connectors/
- UUID v7 for config IDs

Implementation:
- Minimal file storage (no external dependencies)
- JSON format for easy inspection
- Async file I/O with tokio::fs
- No encryption (can add later if needed)

Storage:
- Path: ./data/connectors/{id}.json
- Format: SavedConnector struct
- Fields: id, name, type, config, created_at

Complete API (7/7 endpoints):
βœ… GET /v1/wiki/connectors
βœ… POST /v1/wiki/connectors/test
βœ… POST /v1/wiki/connectors/browse
βœ… POST /v1/wiki/connectors/generate
βœ… GET /v1/wiki/jobs/{id}
βœ… POST /v1/wiki/connectors (save)
βœ… GET /v1/wiki/connectors/saved (list)

100% feature complete!
@TelivANT TelivANT merged commit 92657d3 into main Feb 21, 2026
3 checks passed
@TelivANT TelivANT deleted the feat/wiki-connector-phase4-redis branch February 21, 2026 16:03
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