Phase 3: OpenSubsonic core (response envelope, error codes 42-44, getOpenSubsonicExtensions) and apiKeyAuthentication extension with tokenInfo, web API key management

This commit is contained in:
2026-08-23 08:04:01 -05:00
parent 3b4883780b
commit e38d31d384
17 changed files with 763 additions and 37 deletions
+15
View File
@@ -0,0 +1,15 @@
package subsonic
func init() {
registerExtension("apiKeyAuthentication", 1)
register("tokenInfo", handleTokenInfo)
}
// handleTokenInfo confirms which user an API key (or any other
// credential) resolves to — primarily useful for a client that just
// received a key and wants to confirm it works before storing it.
func handleTokenInfo(rc *Context) *apiError {
rc.Response = newResponse()
rc.Response.TokenInfo = &TokenInfo{Username: rc.User.Username}
return nil
}