feat(auth): implement OAuth 2.0 authorization code flow and dynamic client registration

- Add OAuth 2.0 support with authorization code flow and dynamic client registration.
- Introduce new handlers for OAuth metadata, client registration, authorization, and token issuance.
- Enhance authentication middleware to support OAuth client credentials.
- Create in-memory stores for authorization codes and tokens.
- Update configuration to include OAuth client details.
- Ensure validation checks for OAuth clients in the configuration.
This commit is contained in:
2026-03-26 21:17:55 +02:00
parent ed05d390b7
commit 56c84df342
19 changed files with 970 additions and 40 deletions

View File

@@ -14,7 +14,6 @@ mcp:
transport: "streamable_http"
auth:
mode: "api_keys"
header_name: "x-brain-key"
query_param: "key"
allow_query_param: false
@@ -22,6 +21,12 @@ auth:
- id: "local-client"
value: "replace-me"
description: "main local client key"
oauth:
clients:
- id: "oauth-client"
client_id: ""
client_secret: ""
description: "used when auth.mode=oauth_client_credentials"
database:
url: "postgres://postgres:postgres@db:5432/amcs?sslmode=disable"