mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
behaviors still diverge from what real API Gateway delivers to a payload 2.0 AWS_PROXY Lambda (measured against a Cognito-backed HTTP API in ap-northeast-1, 2026-08-05; raw captures in #2011): - Claim values: array claims rendered as their JSON text and null-valued claims as the string "null". Real events use the space-separated bracket form (cognito:groups -> "[admin poweruser]"), stringify scalars, omit null-valued claims entirely, and fall back to JSON text only for nested objects. - jwt.scopes: any scope claim was split and surfaced. On real AWS a route without authorizationScopes renders "scopes": null even when the token carries a scope claim; a route with authorizationScopes surfaces the token's FULL scope list (scp array/string first, else scope split on whitespace), not the intersection with the route's scopes. - Route.authorizationScopes did not exist, so scoped routes could not enforce anything. Routes now persist and return authorizationScopes on both management surfaces (REST and JSON 1.1), and enforcement rejects tokens whose scp/scope claim matches none of the route's scopes with 403 {"message":"Forbidden"} after signature verification. Co-authored-by: mitsukado-shinagawa <mitsukado-shinagawa@users.noreply.github.com>