Skip to content

Add comprehensive testing documentation and smoke test script - #6

Merged
profradha merged 1 commit into
mainfrom
claude/backend-service-setup-h0tf92
Aug 27, 2026
Merged

Add comprehensive testing documentation and smoke test script#6
profradha merged 1 commit into
mainfrom
claude/backend-service-setup-h0tf92

Conversation

@profradha

Copy link
Copy Markdown
Member

Summary

This PR adds comprehensive testing documentation and a smoke test script for the claim-signer service, along with configuration updates to support local development and testing workflows.

Key Changes

  • Added services/claim-signer/TESTING.md: Comprehensive testing guide covering three layers of testing:

    • Unit tests for the crate itself
    • Running service tests with local test PKI
    • End-to-end testing through the browser
    • Production testing on SSL.com credentials
    • Troubleshooting guide with common issues and solutions
  • Added services/claim-signer/scripts/smoke-test.sh: Black-box test script that exercises a running claim-signer service:

    • Tests unauthenticated endpoints (/healthz, /v1/identity)
    • Tests authenticated signing endpoint with HMAC-SHA256 authentication
    • Validates refusal cases (missing auth, replayed nonce, stale timestamp, unknown key)
    • Works against both local and production deployments
  • Updated apps/editor/vite.config.ts: Added development proxy configuration:

    • Proxies /signer/* requests to the claim-signer service
    • Strips the /signer prefix (required for correct HMAC computation)
    • Supports self-signed certificates for local TLS testing
    • Includes detailed comments explaining the CORS and path rewriting requirements
  • Updated README.md:

    • Clarified that claim-signer.json should use /signer URL instead of direct http://localhost:8443
    • Explained the proxy prefix stripping requirement
    • Added reference to smoke test script and full testing documentation
  • Updated services/claim-signer/README.md: Added reference to comprehensive TESTING.md documentation

  • Updated .gitignore: Added apps/editor/public/claim-signer.json to prevent committing development secrets

  • Updated conformance/enrolment-runbook.md: Added cross-reference to full testing procedures

Notable Implementation Details

  • The smoke test script correctly implements the HMAC-SHA256 authentication scheme matching the service's auth.rs and the editor's signer implementation
  • The vite proxy configuration includes the critical path rewriting step that is also required in production reverse proxies
  • Testing documentation covers both development (test PKI) and production (SSL.com) scenarios with specific validation expectations
  • The smoke test is designed as a black-box test requiring no access to the keystore or signing key, making it suitable for auditing and validation

https://claude.ai/code/session_0168skCigxtfbBu6Lwx68AjS

The claim-signer's README covers running it and the enrolment runbook covers
getting a certificate, but nothing said how to establish that a given
deployment actually works — that this service, on this host, with this
certificate, produces credentials someone else's validator accepts.

services/claim-signer/TESTING.md is that procedure, in two parts: a local run
on the test PKI, and a production one on an SSL.com credential. It records the
answers each check is allowed to give, including the two validator results that
look like failures and are not, and it ends in a symptom-to-cause table.

Three things it documents were found by running the path rather than reading it:

  - The service serves no CORS headers and answers 405 to a preflight, so a
    page cannot call it cross-origin. This affects local development as much as
    deployment, since :5173 calling :8443 is cross-origin too. The dev server
    now proxies /signer/* to the service instead.

  - Any proxy in front of it must strip its path prefix. The Edge computes its
    request MAC over the literal path /v1/sign and the service recomputes it
    over the path it receives, so an unstripped prefix refuses every signature
    while /v1/identity keeps working.

  - SSL.com's C2PA ECC endpoint answers unauthenticated and grants tokens under
    the C2PA policy OID, which makes it usable as a test target before any
    certificate exists. Its AIA names a staging authority whose intermediate is
    not on the official C2PA TSA Trust List, so tokens from it validate as
    timestamp.untrusted; the production endpoint has to come from the account.

scripts/smoke-test.sh exercises a running service — the public endpoints, one
authenticated signature, and the refusals: replayed nonce, stale timestamp,
unknown key id. Signing by hand needs an HMAC over the request, so testing
/v1/sign was otherwise not something a person could do with curl. The same
invocation works against localhost and production.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168skCigxtfbBu6Lwx68AjS
@profradha
profradha merged commit 0a87bed into main Aug 27, 2026
4 checks passed
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.

2 participants