API Version Check Divergence
Compare authorization behavior across API versions and deployment generations, so a check fixed in v2 cannot silently regress in v1
Use when: the API serves multiple versions, prefixes or generations in parallel, which is the standard state for aging products
Avoid when: exactly one version exists with no legacy surface, making version divergence structurally impossible
Procedure
- Enumerate every version prefix that answers: versioned paths, header-selected versions and content-type negotiation.
- Pick matched operations across versions and run the same object-level and function-level test through each.
- Record per-version outcomes side by side, and verify that a fix deployed everywhere actually landed everywhere.
- Check deprecation behavior: how much longer retired versions keep answering and whether authorization drifts there first.
- Inspect internal or preview versions reachable from your environment for divergent code paths.
- Record each divergence with the version pair, the operation and the observed difference in enforcement.
Signals
- v2 returns 403 for a peer object while v1 still serves the body, showing version-skew in the fix.
- A retired legacy prefix remains open with weaker enforcement than any current version.
- Header-based version selection bypasses prefix matching entirely, reaching a dispatch layer with its own checks.
- A preview or internal version exposes operations absent from any public version, with lighter guards.
Patterns
1. Version row
GET /api/v1/orders/{peer-id} as bob -> 200 | v2 -> 403 -> fix incomplete across versions
2. Negotiation
Accept: application/vnd.api+json;version=1 -> dispatches to legacy path despite v2 prefix
3. Result row
versions=[v1,v2,v3] flagged=[v1-bola-leak,v3-admin-open] skew-found=yes
Pitfalls
- Testing only the newest version, which flatters a review while legacy prefixes keep answering.
- Assuming the version dispatch layer applies your middleware, when each version can register its own.
- Ignoring internally reachable versions on a different host, which often lag public fixes by several releases.
Done when
- Matched operations are tested across every served version with side-by-side outcomes recorded per version pair.
- Retired and internal versions are enumerated with their remaining reachability and authorization state documented.