Repository navigation
Description
Summary
Problem 1: Global API key is ignored during provider validation
I have correctly entered and saved my TheIntroDB API key under the Plugin's "Global Configuration" screen. However, when navigating to the TheIntroDB Provider settings and clicking "Validate", the system throws an error:
rpc error: code = Unknown desc = introdb: stats HTTP 401: {"error":"Invalid or expired token"}
It appears the validation check does not properly fetch or pass the globally configured API key.
Problem 2: API returns HTTP 200 on failed validation
Despite the validation failing with the RPC/401 error mentioned above, the Silo API request (POST /api/v1/admin/markers/providers/plugin:6:introdb/validate) returns an HTTP 200 OK status code in the logs. The API should return a proper 4xx or 5xx status code when a configuration validation fails, rather than wrapping an error inside a 200 success response.
Steps to Reproduce:
Go to Plugins -> Configure silo.theintrodb.
Enter a valid API key and click "Save TheIntroDB account".
Navigate to the TheIntroDB Provider settings page (where "Use for Online Marker Lookup" is toggled).
Click Validate.
Observe the 401 error in the UI.
Check the server logs and observe that the request returned "status": "200".
Expected:
The "Validate" button should successfully use the API key stored in the Global Configuration.
The API should return an appropriate error status code (not 200) when an action fails.
Reply digest
The marker-provider Validate endpoint (POST /api/v1/admin/markers/providers/plugin:6:introdb/validate) returns HTTP 200 even when validation fails. A failing provider call (e.g. introdb: stats HTTP 401: Invalid or expired token) is wrapped as {"valid": false, "error": ...} under a 200 OK instead of a 4xx/5xx, so clients can't distinguish success from failure by status code.
Repro: Plugins -> Configure silo.theintrodb, save an API key, open the TheIntroDB Provider settings, click Validate with a bad/expired key; the UI shows the 401 error but the API request logs status 200.
Note: the original thread also reported a "global API key ignored during validation" problem, but the reporter later found that was their own mistake (they'd pasted the IntroDB key instead of the TheIntroDB key), so only the 200-on-error status behavior is filed here.
Code references
Verified not fixed as of 2026-07-07 against origin/main; the handler blob is unchanged and merged-PR search surfaced only #57 (the original IntroDB integration that introduced this code), no status-code fix. The validation-failure path is the only branch in the handler that returns 200 for an error; every other branch uses writeError() with proper codes, and no test covers the error status.
- internal/api/handlers/admin_marker_providers.go: HandleValidateProvider — on FetchUserStats error it calls writeJSON(w, http.StatusOK, {"valid": false, "error": err.Error()}) and returns, sending 200 for a failed validation instead of a 4xx/5xx (every other branch uses writeError with proper codes)
Attachments
Note: Discord CDN links may expire.
Source
Imported from Discord:
Activity