fix(gateway): enforce location-scoped authorization for API keys #70
Merged
wasabi opened 3 days ago

Changes

  • Extend _scope_allows() to accept optional location_id parameter
  • Parse three-part scope format: name:resource:action:location_id
  • Wildcard * in any segment (resource, action, location) matches all
  • Two-part scopes (resource:action) remain backward-compatible
  • Admin keys bypass scope checks (unchanged)
  • Capability tokens already enforce location matching (unchanged)

Scope Format

  • field-worker:harvest_event:write:loc-123 -> only loc-123
  • field-worker:harvest_event:write:* -> any location
  • field-worker:harvest_event:write -> any location (backward-compat)
Commits were merged into target branch
  • fix(gateway): enforce location-scoped authorization for API keys
    - Extend _scope_allows() to accept optional location_id parameter
    - Parse three-part scope format: name:resource:action:location_id
    - Wildcard * in any segment (resource, action, location) matches all
    - Two-part scopes (resource:action) remain backward-compatible
    - Admin keys bypass scope checks (unchanged)
    - Capability tokens already enforce location matching (unchanged)
    
    Scope format examples:
      field-worker:harvest_event:write:loc-123  → only loc-123
      field-worker:harvest_event:write:*         → any location
      field-worker:harvest_event:write           → any location (backward-compat)
    3 days ago
  • wasabi merged 3 days ago
1/1
Submitter wasabi
Target main
Source feat/gateway-location-scope
Jobs
Merge Strategy
Create Merge Commit
Watchers (1)
Reference
pull request KI-70
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover