Use caseIdentity
JWKS
Use case GET /.well-known/jwks.json của Go Identity Service.
Use case: JWKS
Trạng thái
Đã đóng trong checkpoint Go Gateway + Go Identity.
Service sở hữu
Identity Service.
API Gateway dùng endpoint này để validate JWT.
Endpoint
| Method | Path |
|---|---|
GET | /.well-known/jwks.json |
Yêu cầu xác thực
Public.
Không cần Authorization.
Mục tiêu
Publish public signing keys để Gateway và tooling validate JWT.
Luồng request
Client
→ Identity Service
→ token key provider
→ ResponseGateway dùng URL nội bộ:
http://centeros-identity-service:8081/.well-known/jwks.jsonContract API
Request
{}Success response
{
"keys": [
{
"kty": "RSA",
"use": "sig",
"kid": "key-id",
"alg": "RS256",
"n": "modulus",
"e": "exponent"
}
]
}Error response
JWT_KEY_NOT_CONFIGURED: key provider/config lỗi.- TODO: JWKS error paths khác chưa được document chi tiết.
Hành vi database
Read:
- Không đọc database trong handler/code path đã inspect.
- Public key lấy từ token key provider/config.
Write:
- Không ghi DB.
Hành vi token/session
- Không issue token.
- Không validate session.
- Không set
HttpOnly cookie. - Chỉ expose public key material, không expose private key.
Logs và observability
- Identity log có
path=/.well-known/jwks.json. - Gateway Bruno debug helpers gọi direct Identity JWKS.
- Gateway route registry hiện không proxy public
/.well-known/jwks.json.
Tiêu chí nghiệm thu
- Happy path pass.
- Error path pass.
- Logs có request/correlation id nếu đi qua Gateway.
- Bruno/local smoke test pass nếu có.
TODO
- Chưa đóng: production key rotation docs.