navidrome/core/apiauth
Deluan d1b876097f refactor(api): use the grant secret as the API v1 bearer credential
API v1 no longer mints short-lived JWT access tokens. Clients send the grant
secret from POST /auth/login or /auth/setup as `Authorization: Bearer` on
every request.

Every request already looked the grant up in the database, so the JWT gave
no speed or revocation benefit and only added a refresh loop, which early
client authors pushed back on. The grant already is an API key: one per
client sign-in, scoped and revocable. Revocation is now immediate on every
node; the contract promises "within one minute".

Removed: POST /auth/token, the grantAuth scheme, the TokenRequest and
AccessToken schemas, the token_expired problem code, the API v1 JWT signer
and its signing key, the grant liveness cache, and PropertyRepository.PutIfAbsent.
ResolveGrant is now Authenticate.

Short-lived tokens return later only as narrow media tokens for
?access_token= on media URLs, together with the media endpoints.

Signed-off-by: Deluan <deluan@navidrome.org>
2026-09-28 21:05:57 -04:00
..
apiauth_suite_test.go feat(api): add API v1 scope rules and grant secrets 2026-09-28 20:06:27 -04:00
context.go feat(api): add API v1 login, setup, grant resolution and token minting 2026-09-28 20:06:27 -04:00
credentials.go feat(api): add API v1 login, setup, grant resolution and token minting 2026-09-28 20:06:27 -04:00
credentials_test.go feat(api): add API v1 login, setup, grant resolution and token minting 2026-09-28 20:06:27 -04:00
db_test.go refactor(api): use the grant secret as the API v1 bearer credential 2026-09-28 21:05:57 -04:00
export_test.go feat(api): add API v1 login, setup, grant resolution and token minting 2026-09-28 20:06:27 -04:00
scopes.go refactor(api): use the grant secret as the API v1 bearer credential 2026-09-28 21:05:57 -04:00
scopes_test.go refactor(api): use the grant secret as the API v1 bearer credential 2026-09-28 21:05:57 -04:00
secret.go feat(api): add API v1 scope rules and grant secrets 2026-09-28 20:06:27 -04:00
secret_test.go feat(api): add API v1 scope rules and grant secrets 2026-09-28 20:06:27 -04:00
service.go refactor(api): use the grant secret as the API v1 bearer credential 2026-09-28 21:05:57 -04:00
service_session_test.go refactor(api): use the grant secret as the API v1 bearer credential 2026-09-28 21:05:57 -04:00
service_test.go refactor(api): use the grant secret as the API v1 bearer credential 2026-09-28 21:05:57 -04:00