Documentation
¶
Overview ¶
Package authhdr parses client authentication headers without exposing tokens in URLs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMalformed = errors.New("malformed authorization header")
Functions ¶
func Bearer ¶
Bearer extracts an Authorization bearer credential. An empty or malformed value is rejected, and the credential is never accepted from a URL.
func MediaBrowser ¶
MediaBrowser parses the case-sensitive key/value parameters of a MediaBrowser or Emby authorization value. Quoted values may contain commas and backslash-escaped quotes. Values are form-decoded after parsing ("+" is a space, as Jellyfin's WebUtility.UrlDecode does): the Jellyfin Kotlin SDK sends "+" where the web client sends "%20", and both must name the same device so a token issued to one is accepted from the other.
func MediaBrowserCredentialSupplied ¶
MediaBrowserCredentialSupplied reports whether the request carries any MediaBrowser-style credential at all: a token header, an authorization header, or an ApiKey query parameter. It stays true for a malformed or foreign credential so callers can distinguish "no credential" (eligible for anonymous handling) from "a credential that failed" (always rejected).
func MediaBrowserToken ¶
MediaBrowserToken returns legacy header credentials before an ApiKey query parameter. It does not interpret a query credential as Plex auth.
Types ¶
This section is empty.