feat(oauth-client): broken-RP test helpers + Failure-AC conformance tests (C1)
Close the C1 gap from Phase 8 code review: the five Failure-AC checks
(AC6.5 pkce_required, AC6.6 dpop_required, AC7.4 jti_reused, AC7.5
nonce_ignored, AC7.6 refresh_token_reused) could not previously be
verified to fire on a broken log, because the production RelyingParty
always produces conforming requests and no test harness exercised the
SpecViolation path.
Added test-surface helpers on RelyingParty (explicitly documented as
conformance-test-only):
- send_raw_par: post a hand-rolled PAR body with an optional DPoP header.
- build_par_body_without_pkce: construct a PAR body lacking PKCE fields.
- build_par_body_with_pkce: construct a well-formed PAR body.
- sign_dpop_with_fixed_jti: sign a DPoP proof with a caller-supplied jti
(for AC7.4 replay tests).
- sign_dpop_ignoring_nonce: sign a DPoP proof that deliberately omits the
cached nonce claim (for AC7.5 tests).
Refactored sign_dpop internally to dispatch through sign_dpop_inner so
the nonce-inclusion policy and jti source can be overridden.
Added tests/oauth_client_broken_rp.rs with 5 integration tests, one per
Failure-AC. Each test spawns a fake AS, uses a broken-RP helper to
inject a non-conformant entry into the request log, then runs the
corresponding sub-stage (scope_variations or dpop_edges) and asserts
the specific Check emits SpecViolation with the stable code.
All 5 tests pass, bringing the Phase 8 Failure-AC checks from
observationally-only to test-enforced.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>