fix: add strict location scope mode and scope audit logging for gateway #77
Merged
wasabi opened 2 days ago

Summary

Tightens gateway location authorization and adds scope audit trail.

Changes

  • KOKONUT_STRICT_LOCATION_SCOPE env var: when enabled, 2-part scopes (no location segment) are rejected for location-specific requests
  • Scope audit trail: _scope_allows() returns the matched scope string; verify_request() includes scope_checked in response; audit metadata captures which scope was evaluated
  • Catch-all route warning: logs when requests hit undefined routes

Backward Compatibility

Default behavior unchanged (KOKONUT_STRICT_LOCATION_SCOPE defaults to off). Enable for strict 3-part scope enforcement.

Tests

7 tests covering strict mode, scope logging, and backward compatibility.

Commits were merged into target branch
1/1
Submitter wasabi
Target main
Source fix/gateway-location-auth
Jobs
Merge Strategy
Create Merge Commit
Watchers (1)
Reference
pull request KI-77
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover