navidrome/server/apiv1
Deluan 870942c7dd fix(api): record the full client IP, challenge presented tokens and mark token responses no-store
The gate passed server.ClientIP to Authenticate and ResolveGrant, which
masks IPv6 addresses to their /64 for rate limiting, so lastUsedIp stored
a prefix. A new server.ClientAddr returns the resolved address unmasked;
ClientIP builds on it and stays the rate limiter key.

A 401 raised after a token was accepted by the gate, such as a password
change whose grant was revoked mid-request, carried a bare Bearer
challenge. writeProblemStatus now answers Bearer error="invalid_token"
whenever the request presented a bearer token.

login, setupFirstAdmin and createAccessToken responses now carry
Cache-Control: no-store (RFC 6749 section 5.1), set by the gate for a
small list of operations so their error responses are covered too.

The v0/v1 setup race test also checks the v1 status is 201 or 409.
2026-09-28 20:06:28 -04:00
..
api.go fix(api): record the full client IP, challenge presented tokens and mark token responses no-store 2026-09-28 20:06:28 -04:00
api_gen.go feat(api): report login methods and add GET /capabilities 2026-09-28 20:06:27 -04:00
api_test.go feat(api): report login methods and add GET /capabilities 2026-09-28 20:06:27 -04:00
apiv1_suite_test.go feat(api): add API v1 login, setup, token, grant and password endpoints 2026-09-28 20:06:27 -04:00
auth_handlers.go feat(api): add API v1 login, setup, token, grant and password endpoints 2026-09-28 20:06:27 -04:00
auth_test.go fix(api): record the full client IP, challenge presented tokens and mark token responses no-store 2026-09-28 20:06:28 -04:00
capabilities.go feat(api): report login methods and add GET /capabilities 2026-09-28 20:06:27 -04:00
capabilities_test.go feat(api): report login methods and add GET /capabilities 2026-09-28 20:06:27 -04:00
db_test.go feat(api): add API v1 login, setup, token, grant and password endpoints 2026-09-28 20:06:27 -04:00
dto.go feat(api): add API v1 login, setup, token, grant and password endpoints 2026-09-28 20:06:27 -04:00
gate.go fix(api): record the full client IP, challenge presented tokens and mark token responses no-store 2026-09-28 20:06:28 -04:00
gate_test.go fix(api): record the full client IP, challenge presented tokens and mark token responses no-store 2026-09-28 20:06:28 -04:00
oapi-codegen-overlay.yaml feat(api): add API v1 login, setup, token, grant and password endpoints 2026-09-28 20:06:27 -04:00
oapi-codegen.yaml feat(api): add API v1 login, setup, token, grant and password endpoints 2026-09-28 20:06:27 -04:00
password_handlers.go feat(api): add API v1 login, setup, token, grant and password endpoints 2026-09-28 20:06:27 -04:00
problem.go fix(api): record the full client IP, challenge presented tokens and mark token responses no-store 2026-09-28 20:06:28 -04:00
problem_test.go fix(api): record the full client IP, challenge presented tokens and mark token responses no-store 2026-09-28 20:06:28 -04:00
reference.go feat(api): enforce API v1 security from the spec and harden problem responses 2026-09-28 20:06:27 -04:00
server_info.go feat(api): report login methods and add GET /capabilities 2026-09-28 20:06:27 -04:00
server_info_test.go feat(api): report login methods and add GET /capabilities 2026-09-28 20:06:27 -04:00
spec.go feat(api): add the API v1 foundation behind DevAPIv1 (#6227) 2026-09-26 15:27:23 -04:00
spec_test.go feat(api): add the API v1 foundation behind DevAPIv1 (#6227) 2026-09-26 15:27:23 -04:00