From 72ba89be63d7ade60160fccf86694287f6232198 Mon Sep 17 00:00:00 2001 From: Mathias Date: Fri, 3 Jul 2026 23:17:39 +0200 Subject: [PATCH] =?UTF-8?q?feat(auth):=20adopt=20chassis=20v0.3.0=20?= =?UTF-8?q?=E2=80=94=20auth=20audit=20logs=20+=20503=20on=20Dex=20outage?= =?UTF-8?q?=20(#6,=20#9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps mcp-chassis to v0.3.0, which adds structured audit logging on every auth rejection and returns 503 temporarily_unavailable (not a silent 401) when Dex is unreachable at validation time. Wires slog.SetDefault so those audit lines flow through gitea-mcp's JSON handler. Together with the earlier /healthz jwt-status reporting and startup degradation warning, this closes #6 (Dex-down is now observable and distinct from a bad token) and #9 (auth failures are audit-logged: reason, IP, token type, hashed fingerprint — never the raw token). Co-Authored-By: Claude Opus 4.8 (1M context) --- cmd/gitea-mcp/main.go | 3 +++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/gitea-mcp/main.go b/cmd/gitea-mcp/main.go index ecf9998..da46432 100644 --- a/cmd/gitea-mcp/main.go +++ b/cmd/gitea-mcp/main.go @@ -20,6 +20,9 @@ import ( func main() { logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + // Route the chassis's package-level slog (auth audit logs, gitea-mcp#9) through + // the same structured handler as the rest of the server. + slog.SetDefault(logger) cfg, err := config.Load() if err != nil { diff --git a/go.mod b/go.mod index a313508..a10af02 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.d-ma.be/mathias/gitea-mcp go 1.26.2 require ( - git.d-ma.be/mathias/mcp-chassis v0.2.0 + git.d-ma.be/mathias/mcp-chassis v0.3.0 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/stretchr/testify v1.11.1 ) diff --git a/go.sum b/go.sum index 3dd8130..4d0b523 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.d-ma.be/mathias/mcp-chassis v0.2.0 h1:6fLmb7xqRa2nNVWsHaUbbfbArgDXJw/gDhb09clBIjo= -git.d-ma.be/mathias/mcp-chassis v0.2.0/go.mod h1:Ks7EK2UnGAN0H3rJjKUxUagX8/ZBdtLrOlcUbv0RwH8= +git.d-ma.be/mathias/mcp-chassis v0.3.0 h1:lV/vDsjrDeZojT7lhcwolM1lMZpsnEKEvf4kEHrxIa0= +git.d-ma.be/mathias/mcp-chassis v0.3.0/go.mod h1:Ks7EK2UnGAN0H3rJjKUxUagX8/ZBdtLrOlcUbv0RwH8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=