Repository navigation
feat: add jwt auth for ateapi - #248
Conversation
ededf6a to
57a1ac5
Compare
9a1e6b3 to
ba351a2
Compare
ba351a2 to
2e847dd
Compare
|
Zoe Zhao (@zoez7) addressed your comments. Also Just FYI I changed the e2e test workflow to use a matrix and install substrate in both modes to make sure they work. Let me know if you think that's overkill |
Zoe Zhao (zoez7)
left a comment
There was a problem hiding this comment.
Thanks, let's rebase and merge.
|
Done in 8422f51. I renamed the matrix job id to |
|
Zoe Zhao (@zoez7) a change went in to the pr workflow that caused a conflict, should be good to go now. |
|
Hey there Zoe Zhao (@zoez7), the |
|
Looks like we need another rebase. |
Done. Can we please try and merge this ASAP. It has been approved for a bit now but I've had to resolve merge conflicts a few times already. |
Rebased onto main and integrated with the ateapi-auth (mtls|jwt) mode that landed on main in agent-substrate#248. Router (client): - ateapi-auth=mtls now performs real mutual TLS: the router presents its podidentity credential bundle (--ateapi-client-cert) as a client cert and verifies ateapi's serving cert against the servicedns trust bundle (--ateapi-ca-certs), instead of the previous insecure TLS dial. No insecure fallback: missing material is a hard error. - ateapi-auth=jwt (from agent-substrate#248) is unchanged and still routes through ateapiauth.DialOptions; otel tracing/metrics are preserved. ateapi (server): - The ateapiauth server interceptor now injects an authenticated principal (internal/principal) into the request context in both modes: the mtls authenticator extracts the client's SPIFFE identity from its mTLS peer cert, and the jwt authenticator records the verified token subject (VerifyBearerToken now returns the principal ID). The principal carries a Kind (mtls|jwt) and is included in RPC request logs. Supporting changes: - Move credbundle to internal/credbundle and add ClientLoader for client certs. - podcertcontroller signers, valkey, and install-ate.sh updated to provision and mount the podidentity/servicedns bundles; manifests mount them into the router and apiserver pods.

Description
Closes #222.
Adds a portable JWT authentication path for ateapi clients while keeping the
existing mTLS mode as the default.
What changed
internal/ateapiauthwith:mtlsandjwtauth modesate-api-serverate-controlleratenet routerkubectl-ateport-forward client pathOIDC/JWKS discovery.
manifests/ate-install/jwtmanifests/ate-install/kind-jwthack/install-ate.shto opt into JWT mode with:ATE_API_AUTH_MODE=jwt--auth-mode=jwtNotes
Default install behavior remains
mtls. I think this deserves a second look as JWT will support more clusters.The JWT overlay projects short-lived ServiceAccount tokens with audience
api.ate-system.svcand mounts the service-DNS trust bundle for ateapi TLSverification.
The current discovery mechanism for JWT mode involves reading the deployment which I really don't like, but we don't have a "config file" concept so that bit is a massive TODO.
Validation