Help us shape the future of Go! Take the 2026 Go Developer Survey

streamgrant

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package streamgrant issues and checks playback-scoped stream grants: capability tokens appended to media URLs in place of account credentials.

Index

Constants

View Source
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

func GrantURL(raw, token string) string

GrantURL appends a broker-generated stream capability to a media URL. Capabilities passed here must be URL-safe.

func StripAccountCredentials

func StripAccountCredentials(raw string) string

StripAccountCredentials removes account credentials from a media URL. Relative paths and values without those keys are unchanged.

Types

type GrantBinding

type GrantBinding struct {
	Token    string
	ViewerID int64
	Started  bool
}

GrantBinding is the playback-scoped capability and its active viewer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL