You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description Allow external API callers (service-accounts, MCP server) to target a specific database per request, rather than always using the server's currently active database. ## Use Case An MCP server or automation container authenticated via API key needs to query a specific vocabulary database (e.g., vocabgen-dutch.db) without depending on which database was last selected in the web UI. ## Current Behavior The API always reads from the server's active database (configured via config.yamldb_path or last switched via the web UI database picker). External callers have no way to specify which database to target. ## Proposed Options ### Option A: Query parameter GET /api/words?db=vocabgen-dutch.db ### Option B: Request header X-VocabGen-Database: vocabgen-dutch.db ### Option C: Per-service-account binding in users.yaml yaml service_accounts: - name: mcp-server key_hash: "$2a$..." scope: read-only database: vocabgen-dutch.db ## Acceptance Criteria - WHEN an API request specifies a database, THE server SHALL use that database for the request - WHEN the specified database does not exist, THE server SHALL return 404 JSON - WHEN no database is specified, THE server SHALL use the default (current behavior) - WHEN a service-account has a bound database, THE server SHALL use it regardless of the active UI database ## Notes - This is a follow-up to #101 (API-key auth for service-accounts) - Low priority — default DB is sufficient for most single-DB deployments - Security: restrict to databases in the config directory only (no arbitrary path traversal) ## Target Release v1.6.0 (or later)
Description Allow external API callers (service-accounts, MCP server) to target a specific database per request, rather than always using the server's currently active database. ## Use Case An MCP server or automation container authenticated via API key needs to query a specific vocabulary database (e.g.,
vocabgen-dutch.db) without depending on which database was last selected in the web UI. ## Current Behavior The API always reads from the server's active database (configured viaconfig.yamldb_pathor last switched via the web UI database picker). External callers have no way to specify which database to target. ## Proposed Options ### Option A: Query parameterGET /api/words?db=vocabgen-dutch.db### Option B: Request headerX-VocabGen-Database: vocabgen-dutch.db### Option C: Per-service-account binding in users.yamlyaml service_accounts: - name: mcp-server key_hash: "$2a$..." scope: read-only database: vocabgen-dutch.db## Acceptance Criteria - WHEN an API request specifies a database, THE server SHALL use that database for the request - WHEN the specified database does not exist, THE server SHALL return 404 JSON - WHEN no database is specified, THE server SHALL use the default (current behavior) - WHEN a service-account has a bound database, THE server SHALL use it regardless of the active UI database ## Notes - This is a follow-up to #101 (API-key auth for service-accounts) - Low priority — default DB is sufficient for most single-DB deployments - Security: restrict to databases in the config directory only (no arbitrary path traversal) ## Target Release v1.6.0 (or later)