about summary refs log tree commit diff
path: root/test/python/server_test_case.py
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-10-05 07:34:38 +0000
committerPjotr <wrk@bosa.lan>2026-10-05 07:34:38 +0000
commit551bb2f8a6aaa420b6bdd4729e4fb2bd2f739b5d (patch)
tree716b848dfc15afe785045c43d3f5164739f0c3b9 /test/python/server_test_case.py
parent649ff6395bdca06530ceabd3e216c66851dc60d6 (diff)
downloadgenenetwork4-551bb2f8a6aaa420b6bdd4729e4fb2bd2f739b5d.tar.gz
doc: Add auth/testing insights to docs/SKILL.md
Captures the reusable practices from this session's token-gating work,
for reuse on a similar Rust/Axum service:

- utoipa: a document-wide default security(...) on #[derive(OpenApi)]
  instead of repeating it per operation, with per-operation empty
  security() overrides for the exceptions; a shared
  #[derive(utoipa::IntoResponses)] type for a response shape (e.g. 401)
  repeated across many handlers, referenced bare in responses(...).
- Authentication/authorization: an opt-in-per-handler extractor
  (AuthToken) over blanket middleware; keeping "is this token valid"
  and "is this specific resource public" as independent checks;
  resolving a (container, item)-addressed resource's container
  category before ever looking up item, rather than guessing item
  across categories; a dev-only token-issuing endpoint needing at
  least two independent config conditions (not runtime-detected),
  registered conditionally rather than registered-and-rejected, with
  credentials defaulting to the target service's own published dev
  fixtures.
- Testing: a test suite fetching its own token from that dev endpoint
  (in-process for an in-process Rust suite, via per-test-class
  subprocess env for a spawned-binary Python suite) instead of
  requiring a human to provision one; the concurrency hazard of
  mutating process-wide env vars across #[tokio::test] functions in one
  file, and why a spawned-subprocess-per-class suite doesn't have it;
  Rust edition 2024's unsafe env::set_var/remove_var.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDDpXvZBQat9uSgDeEMJ8d
Diffstat (limited to 'test/python/server_test_case.py')
0 files changed, 0 insertions, 0 deletions