feat(auth): enhance middleware to support Bearer token auth

* Added support for extracting Bearer tokens from Authorization header.
* Updated middleware to prefer explicit header over Bearer token.
* Improved test coverage for authentication scenarios.
This commit is contained in:
Hein
2026-03-26 17:02:38 +02:00
parent ef0ace2bab
commit ed05d390b7
3 changed files with 69 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ A Go MCP server for capturing and retrieving thoughts, memory, and project conte
Config is YAML-driven. Copy `configs/config.example.yaml` and set:
- `database.url` — Postgres connection string
- `auth.keys` — API keys for MCP endpoint access
- `auth.keys` — API keys for MCP endpoint access via `x-brain-key` or `Authorization: Bearer <key>`
- `ai.litellm.base_url` and `ai.litellm.api_key` — LiteLLM proxy
- `ai.ollama.base_url` and `ai.ollama.api_key` — Ollama local or remote server