Documentation
¶
Overview ¶
Package streamgrant issues and checks playback-scoped stream grants: capability tokens appended to media URLs in place of account credentials.
Index ¶
Constants ¶
const StreamGrantParam = "X-Ether-Stream-Token"
StreamGrantParam is the scoped media capability used by existing Plex clients. It is independent of account credentials.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateGrant ¶
func AuthenticateGrant(ctx context.Context, method, token string, binding GrantBinding, active func(context.Context, int64) *core.Viewer) (*core.Viewer, bool)
AuthenticateGrant verifies a stream capability and rechecks the viewer on every media request, including cached segments. Callers apply playback policy.
func GrantURL ¶
GrantURL appends a broker-generated stream capability to a media URL. Capabilities passed here must be URL-safe.
func StripAccountCredentials ¶
StripAccountCredentials removes account credentials from a media URL. Relative paths and values without those keys are unchanged.
Types ¶
type GrantBinding ¶
GrantBinding is the playback-scoped capability and its active viewer.