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:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user