Files
gateway/tests/fixtures/specs/param_forwarding_2.json
zooqueenandHanzo Dev 25262baa1d keys: sk- is the server-side credential; hk- is retired
Every hk- in the docs, the widget refusal messages and the fixture tokens
named a shape that authenticates nothing. Cloud accepts pk- and sk- and
nothing else, IAM mints sk-, and no generator in the fleet still produces
hk- — so a reader who copied one of these examples got a 401 and no way to
see why.

The predicate keeps it. authz.IsAPIKey still matches hk-, and should: those
keys are still in circulation and have to reach the backend that refuses
them rather than be parsed here as a JWT. TestIsAPIKey pins that row, and
the two comments annotating the predicate now mark the shape retired rather
than list it alongside the current ones.

Where the hk- row sat in the forged-header and widget-key tables, pk- takes
its place. sk- was already covered in both, and pk- — the shape that ships
in a browser bundle — is the one neither table had ever exercised.

Verified: make test, 489 pass / 0 fail, including all four param_forwarding
fixtures whose bearer changed.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-13 18:06:33 -07:00

21 lines
780 B
JSON

{
"in": {
"method": "GET",
"url": "http://localhost:8080/param_forwarding/all/foo/bar?a=1&b=2",
"header": {
"Authorization": "bearer sk-test-fixture-token",
"X-Y-Z": "true",
"A-B-C": "ignore"
}
},
"out": {
"status_code": 200,
"body": "{\"foo\":42,\"headers\":{\"A-B-C\":[\"ignore\"],\"Accept-Encoding\":[\"gzip\"],\"Authorization\":[\"bearer sk-test-fixture-token\"],\"User-Agent\":[\"Go-http-client/1.1\"],\"X-Forwarded-Host\":[\"localhost:8080\"],\"X-Forwarded-Via\":[\"hanzoai/gateway Version 2.13.0\"],\"X-Y-Z\":[\"true\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}",
"header": {
"content-type": ["application/json; charset=utf-8"],
"Cache-Control": ["public, max-age=3600"],
"X-Gateway-Completed": ["true"]
}
}
}