Repository navigation
Add auth server TLS listener and SPIFFE middleware - #6843
Conversation
|
Is there a perhaps a breaking change here due to the func signature changing? Nothing in codebase but any out of tree callers? |
|
Good question. The change is source-compatible for anyone calling the constructors directly, because the new I checked all in-repo callers ( One behavior change to be aware of: the constructors now reject a configured TLS listener when no |
e0bf21b to
ab06841
Compare
ab06841 to
3a16520
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6843 +/- ##
========================================
Coverage 79.76% 79.77%
========================================
Files 825 827 +2
Lines 84263 84498 +235
========================================
+ Hits 67212 67405 +193
- Misses 17046 17088 +42
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3a16520 to
dd599c0
Compare
SPIFFE X.509-SVID client authentication needs the client certificate from a TLS handshake, but the MCP proxy port serves plain HTTP. Give the embedded authorization server its own TLS listener on port 8443, so the token endpoint can see client certificates without moving MCP traffic to HTTPS. The listener requests client certificates only when spiffe_x509 is configured, sends the SPIFFE CAs as a hint, and reloads the serving certificate when its files change, keeping the last good pair. spiffeauth.Middleware extracts a claimed SPIFFE ID from the presented peer certificate into the request context; it does not verify the certificate. Malformed SPIFFE identities receive an OAuth JSON error. Credential validation remains the responsibility of the client authentication strategy. EmbeddedAuthServer gains Start, and the proxy runner starts the listener on the same host as the MCP port, rejecting a proxy or diagnostics port that collides with it. Constructors reject configured TLS listeners without a listener host so unsupported callers fail explicitly. Graceful shutdown force-closes connections on timeout. SPIFFE trust configuration remains rejected at startup; this change does not yet enable SPIFFE client authentication. Co-authored-by: Mecatl <noreply@mecatl.dev>
4a83fa2 to
84ad39b
Compare
SPIFFE X.509-SVID client authentication needs the client certificate
from a TLS handshake, but the MCP proxy port serves plain HTTP. Give
the embedded authorization server its own TLS listener on port 8443,
so the token endpoint can see client certificates without moving MCP
traffic to HTTPS.
The listener requests client certificates only when spiffe_x509 is
configured, sends the SPIFFE CAs as a hint, and reloads the serving
certificate when its files change, keeping the last good pair.
spiffeauth.Middleware extracts a claimed SPIFFE ID from the presented
peer certificate into the request context; it does not verify the
certificate. Malformed SPIFFE identities receive an OAuth JSON error.
Credential validation remains the responsibility of the client
authentication strategy.
EmbeddedAuthServer gains Start, and the proxy runner starts the
listener on the same host as the MCP port, rejecting a proxy or
diagnostics port that collides with it. Constructors reject configured
TLS listeners without a listener host so unsupported callers fail
explicitly. Graceful shutdown force-closes connections on timeout.
SPIFFE trust configuration remains rejected at startup; this change
does not yet enable SPIFFE client authentication.
Co-authored-by: Mecatl noreply@mecatl.dev