Skip to content

test(evidence): live-serving integration test for getEvidenceJwks#195

Merged
amavashev merged 1 commit into
mainfrom
test/evidence-jwks-serving
Jun 15, 2026
Merged

test(evidence): live-serving integration test for getEvidenceJwks#195
amavashev merged 1 commit into
mainfrom
test/evidence-jwks-serving

Conversation

@amavashev

Copy link
Copy Markdown
Collaborator

What

Live-serving integration test for getEvidenceJwks over real HTTP — the live half of the evidence authority-loop validation. Test-only (the endpoint shipped in v0.1.25.32 / #194).

JwksEndpointIntegrationTest extends BaseIntegrationTest: full @SpringBootTest(RANDOM_PORT), real Tomcat with the Spring Security filter chain ACTIVE, Testcontainers Redis. This proves what the JwksControllerTest @WebMvcTest can't — that @WebMvcTest runs with filters disabled, so it can't show the public-path exemption actually works.

Assertions

  • GET /v1/.well-known/cycles-jwks.json with no API key200 (the /v1/.well-known/** permitAll + the tenant filter's public-path skip hold end-to-end through the real chain).
  • The served JWK's x decodes to exactly the configured signer_did bytes; kid / cycles_nbf_ms / status are property-backed; Cache-Control: public, max-age (NOT immutable).
  • A bogus X-Cycles-API-Key still yields 200 (a public endpoint must not turn into a 401).
  • The base class's contract-validating interceptor additionally checks the body against the published CyclesEvidenceJwks schema (cycles-protocol@main, fix(deps): bump Spring Boot 3.5.11→3.5.13, pin tomcat 10.1.54 (v0.1.25.16) #113).

Review

codex-reviewed: no findings (confirmed it genuinely hits the real HTTP stack + filter chain, meaningful assertions, no @TestPropertySource context pollution).

2 tests, green locally. Test-only — no production/wire/spec change.

Refs: #194, runcycles/cycles-protocol#113.

JwksEndpointIntegrationTest (extends BaseIntegrationTest: full @SpringBootTest
RANDOM_PORT, real Tomcat + the Spring Security filter chain ACTIVE, Testcontainers
Redis) proves the JWK Set endpoint serves over real HTTP WITHOUT an API key — the
/v1/.well-known/** public-path exemption actually holds end-to-end through the
filter chain, not just as an array entry (the JwksControllerTest @WebMvcTest runs
with filters disabled, so it can't show this).

With the evidence signing identity set via @TestPropertySource: GET
/v1/.well-known/cycles-jwks.json with no header → 200 + a JWK whose x decodes to
exactly the configured signer_did bytes, correct kid/cycles_nbf_ms/status, and
Cache-Control: public, max-age (NOT immutable); a bogus API key still yields 200
(public, never 401). The base class's contract-validating interceptor also checks
the body against the published CyclesEvidenceJwks schema (cycles-protocol@main,
#113).

codex review: no findings. 2 tests; test-only (impl shipped in v0.1.25.32 / #194;
no production/wire/spec change).
@amavashev amavashev merged commit ddf074c into main Jun 15, 2026
6 checks passed
@amavashev amavashev deleted the test/evidence-jwks-serving branch June 15, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant