← ClaudeAtlas

hex-test-restapi-authlisted

Use when testing a token verifier, or any other part of a REST service that authenticates its callers — the token-verifier adapter's unit test, the signing-key and token-minting fixtures, the `authenticated_client` factory, the DI override that makes minted tokens verify, the discovered probe that every operation not declared public refuses an anonymous or untrusted caller, and — where the app has them — the role and cross-tenant assertions on an endpoint. Not an endpoint's non-auth half — its success body and advertised error codes (`hex-test-restapi-endpoint`) — and not another capability adapter's test (`hex-test-capability-adapter`). - Adding the auth fixtures to an integration suite, writing a 401 or 403 endpoint test, minting a JWT inside a test, or asserting that a protected route rejects an anonymous caller.
wntic/pyhouse · ★ 3 · API & Backend · score 76
Install: claude install-skill wntic/pyhouse
# Hex Test — REST API Auth Consult `test-principles` for the testing constitution. Where this skill contradicts `test-principles`, the constitution wins. Every test the auth machinery needs — the verifier's own unit test and the auth half of the integration suite — and all of it exists **only for an app that declares auth** (`hex-restapi-auth`). An auth-less app produces none of these files: no verifier to test, no `tests/helpers/jwt.py`, no `tests/integration/api/conftest.py` — this skill creates it — no `test_unauthenticated_returns_401.py`, and every endpoint test drives a plain ASGI client. ## When to use vs. neighbours - Any other capability adapter's test — containerized, HTTP-gateway over a stub transport, or another pure-CPU one → `hex-test-capability-adapter`, which owns the three flavors; the verifier test in `UNIT.md` is its pure-CPU flavor bound to auth. - The containers, the engine, the rollback `session_factory`, `container` and `real_app` itself → `hex-test-integration-setup` (one-shot; both are defined there and every integration file here consumes `real_app`). - A per-endpoint test's non-auth half — success body, advertised error codes, per-resource fixtures → `hex-test-restapi-endpoint`. - The other discovered invariants — OpenAPI error codes, CORS, request-size limit, the construct smoke → `hex-test-app-invariants`. - The route-side dependencies, the verifier and the code sets under test → `hex-restapi-auth`. - A handler-level authorization rule