| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| clients | ||
| engines | ||
| tests | ||
| .dockerignore | ||
| .gitignore | ||
| DEPLOY.md | ||
| Dockerfile | ||
| README.md | ||
| SRE.md | ||
| app.py | ||
| auth.py | ||
| cache.py | ||
| config.py | ||
| db.py | ||
| douanier.py | ||
| requirements-deploy.txt | ||
| requirements.txt | ||
| scopes.py |
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).
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| clients | Loading commit data... | |
| engines | Loading commit data... | |
| tests | Loading commit data... | |
| .dockerignore | Loading commit data... | |
| .gitignore | Loading commit data... | |
| DEPLOY.md | Loading commit data... | |
| Dockerfile | Loading commit data... | |
| README.md | Loading commit data... | |
| SRE.md | Loading commit data... | |
| app.py | Loading commit data... | |
| auth.py | Loading commit data... | |
| cache.py | Loading commit data... | |
| config.py | Loading commit data... | |
| db.py | Loading commit data... | |
| douanier.py | Loading commit data... | |
| requirements-deploy.txt | Loading commit data... | |
| requirements.txt | Loading commit data... | |
| scopes.py | Loading commit data... |