quintodrome/server/subsonic
Deluan Quintão a84f092d00
fix(subsonic): require admin access for Subsonic management endpoints (#5510)
* fix: require admin for radio mutations

Subsonic internet radio station mutation endpoints are admin-only in the Subsonic and OpenSubsonic specs, but the router only required an authenticated player. Add a reusable Subsonic admin middleware and apply it to create, update, and delete radio routes while leaving the list endpoint available to authenticated users. Cover the middleware and router behavior with unit and e2e tests.

* fix: streamline admin-only routes for internet radio station management

Signed-off-by: Deluan <deluan@navidrome.org>

* fix: use admin-only middleware for starting scans

Signed-off-by: Deluan <deluan@navidrome.org>

* test: align start scan authorization coverage

StartScan authorization now lives in the shared Subsonic admin middleware instead of the handler. Remove the obsolete direct handler unit assertion so the package tests reflect the route-level guard covered by middleware and e2e tests.

* fix: require admin for getUsers

The Subsonic getUsers endpoint exposes user-list semantics and should use the same shared admin middleware as other admin-only management endpoints. Apply the route-level guard while leaving getUser unchanged, and update the multi-user e2e coverage to expect regular users to receive an authorization failure.

* test: cover admin-only Subsonic access

Add e2e coverage that admins can still call getUsers after the route-level guard and that regular authenticated users can still list internet radio stations. These cases capture the access boundaries raised during PR review.

---------

Signed-off-by: Deluan <deluan@navidrome.org>
2026-05-19 14:23:38 -03:00
..
filter fix(subsonic): only use genre tag when searching by genre (#4361) 2025-07-19 21:52:29 -04:00
responses feat(subsonic): add groupings field to OpenSubsonic Child response 2026-05-10 18:35:13 -03:00
album_lists.go feat(plugins): add PlaybackReport to scrobbler capability (#5452) 2026-05-02 16:14:53 -04:00
album_lists_test.go feat(subsonic): add sonicSimilarity extension as plugin capability (#5419) 2026-04-27 17:50:09 -04:00
api.go fix(subsonic): require admin access for Subsonic management endpoints (#5510) 2026-05-19 14:23:38 -03:00
api_suite_test.go feat:(server): support reading lyrics from filesystem (#2897) 2025-04-30 08:10:19 -04:00
api_test.go chore(lint): upgrade golangci-lint, fix/ignore new errors 2026-05-01 14:22:51 -04:00
bookmarks.go fix(subsonic): always return required playqueue fields (#5172) 2026-03-12 08:29:37 -04:00
browsing.go feat(subsonic): append album version to names in Subsonic API (#5111) 2026-02-26 10:50:12 -05:00
browsing_test.go feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
helpers.go feat(subsonic): add groupings field to OpenSubsonic Child response 2026-05-10 18:35:13 -03:00
helpers_test.go fix(subsonic): always emit required created field on AlbumID3 (#5340) 2026-04-10 19:29:20 -04:00
jukebox.go refactor: small improvements and clean up (#3423) 2024-10-22 22:54:31 -04:00
library_scanning.go fix(subsonic): require admin access for Subsonic management endpoints (#5510) 2026-05-19 14:23:38 -03:00
library_scanning_test.go fix(subsonic): require admin access for Subsonic management endpoints (#5510) 2026-05-19 14:23:38 -03:00
media_annotation.go feat(subsonic): implement playbackReport OpenSubsonic extension (#5442) 2026-04-30 23:04:05 -04:00
media_annotation_test.go feat(plugins): add PlaybackReport to scrobbler capability (#5452) 2026-05-02 16:14:53 -04:00
media_retrieval.go chore(lint): upgrade golangci-lint, fix/ignore new errors 2026-05-01 14:22:51 -04:00
media_retrieval_test.go fix(server): prevent artwork throttle token starvation on slow clients (#5472) 2026-05-06 00:12:50 -04:00
middlewares.go fix(subsonic): require admin access for Subsonic management endpoints (#5510) 2026-05-19 14:23:38 -03:00
middlewares_test.go fix(subsonic): require admin access for Subsonic management endpoints (#5510) 2026-05-19 14:23:38 -03:00
opensubsonic.go feat(subsonic): implement playbackReport OpenSubsonic extension (#5442) 2026-04-30 23:04:05 -04:00
opensubsonic_test.go feat(subsonic): implement playbackReport OpenSubsonic extension (#5442) 2026-04-30 23:04:05 -04:00
playlists.go fix(subsonic): strip OpenSubsonic extensions from playlists for legacy clients 2026-04-02 16:37:52 -04:00
playlists_test.go feat(subsonic): add sonicSimilarity extension as plugin capability (#5419) 2026-04-27 17:50:09 -04:00
radio.go fix(subsonic): return proper artwork ID format in getInternetRadioStations 2026-04-02 15:44:20 -04:00
radio_test.go fix(subsonic): return proper artwork ID format in getInternetRadioStations 2026-04-02 15:44:20 -04:00
searching.go feat(subsonic): sort search3 results by relevance (#5086) 2026-02-23 08:51:54 -05:00
searching_test.go feat(subsonic): add sonicSimilarity extension as plugin capability (#5419) 2026-04-27 17:50:09 -04:00
sharing.go fix(subsonic): make Share's lastVisited optional 2025-01-09 16:10:53 -05:00
sonic_similarity.go feat(subsonic): add sonicSimilarity extension as plugin capability (#5419) 2026-04-27 17:50:09 -04:00
stream.go fix(server): improve transcoding failure diagnostics and error responses (#5227) 2026-03-18 12:39:03 -04:00
system.go Some cleanup, adding missing context handling 2022-12-06 19:57:47 -05:00
transcode.go fix(server): improve transcoding failure diagnostics and error responses (#5227) 2026-03-18 12:39:03 -04:00
transcode_test.go feat(subsonic): add sonicSimilarity extension as plugin capability (#5419) 2026-04-27 17:50:09 -04:00
users.go refactor: rename EnableCoverArtUpload to EnableArtworkUpload 2026-03-27 19:33:46 -04:00
users_test.go refactor: rename EnableCoverArtUpload to EnableArtworkUpload 2026-03-27 19:33:46 -04:00