Skip to content

slskd: ask for an administrator API key when slskd hides its download folder - #89

Open
TheMightyTRex wants to merge 1 commit into
logabell:mainfrom
TheMightyTRex:contrib/slskd-administrator-key
Open

TheMightyTRex wants to merge 1 commit into
logabell:mainfrom
TheMightyTRex:contrib/slskd-administrator-key

Conversation

@TheMightyTRex

Copy link
Copy Markdown

Problem

With slskd 0.26, testing the Soulseek connection with a read-write API key fails with "slskd refused this call; use a read-write key on the main slskd process", although the key already is read-write.

The test reads GET /api/v0/options to find slskd's download folder. slskd 0.26 only shows its options to keys with the administrator role, so a read-write key gets 403 Forbidden there. /api/v0/application and /api/v0/application/version work with either key, which is why the API key itself looks fine with curl.

Reported against both Dewarr and a fork in https://github.com/TheMightyTRex/storyarr/issues/1.

Change

  • SlskdClient.test() reads /options before checking the Soulseek session, so a key problem is reported before "Soulseek is not connected".
  • A 403 there now says: "slskd only shares its download folder with an administrator API key. In slskd, give this key the administrator role, then test again."
  • The Soulseek settings help and placeholder ask for an administrator key.
  • docs/DOWNLOAD-CLIENTS.md explains the role, with a slskd.yml example.
  • New unit test: a key that gets 403 on /options produces the administrator message.

No database or API changes.

Testing

  • Against a real slskd/slskd:0.26.2 container: a read-write key gets the new message; an administrator key passes the key check (and reports "Soulseek is not connected" only because the test instance was not logged in to Soulseek).
  • tests/unit/test_slskd.py and tests/integration/test_slskd_connection.py: 21 passed.
  • ruff check and format, prettier: clean.

🤖 Generated with Claude Code

… folder

slskd 0.26 answers GET /api/v0/options with 403 for read-write API keys, and Dewarr reads the
download folder there, so the connection test failed with "use a read-write key on the main
slskd process" even though the key was read-write. Check the key before the Soulseek session
and explain the administrator role in the error, the settings help and the download clients
guide. Reproduced against slskd 0.26.2 with read-write and administrator keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant