Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
T
Tidal
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • PLN
  • Tidal
  • Repository

Switch branch/tag
  • Tidal
  • armada
  • api
  • tests
  • test_ears_light.py
Find file
BlameHistoryPermalink
  • PLN (Algolia)'s avatar
    feat(douanier): adopt the platform's path-derived scope convention (#43) · 4197696d
    The audio API now speaks the platform scope convention (nechapi scopes.py):
    access is hierarchical realm:domain:path and the required scope is DERIVED FROM
    THE ROUTE, so it's maintenance-free — add an endpoint and its scope exists.
    
    - scopes.py — vendored byte-for-byte from nechapi/_platform/scopes.py; a
      drift-guard test (test_scopes.py) fails if the two ever diverge, so the
      gateway and this service can never disagree on who's allowed in.
    - app.py — replaced the per-route require_scope("emotion"|"features"|…) strings
      with ONE path-derived dependency: `require` computes api:audio:<path> from the
      request and checks it; `require_auth` covers /me (any identity). Also closed a
      footgun: a gateway-injected request with a MISSING X-Scopes header now defaults
      to NO scopes (was "*").
    - auth.py — Principal.has_scope is now the hierarchical matcher (api:audio:*
      authorizes api:audio:analyze:emotion, etc.).
    - tests — gateway-header tests grant api:audio:*; the scope-enforcement tests now
      prove real path-derivation (a sibling grant like api:audio:features → 403 on
      /grade and /onsets). +test_scopes.py for the matcher + drift guard. 67 passing.
    - clients/README — scope table rewritten to the convention (api:audio:<path>,
      grant api:audio:* or api:* for breadth).
    
    Validated end-to-end through https://api.nech.pl/audio/v1 with a freshly minted
    api:* token: /me → scopes [api:*]; /features 200 (cache miss→hit); a sibling
    scope 403s; no-identity 401s. Built + redeployed douanier:latest to erable
    (seccomp=unconfined per DEPLOY.md).
    PLN (Algolia) authored Jun 28, 2026
    4197696d
test_ears_light.py 2.47 KB
EditWeb IDE
×

Replace test_ears_light.py

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.