package dto import "github.com/golang-jwt/jwt/v5" type MediaClaims struct { Act string `json:"act"` // "publish" or "read" Path string `json:"path"` // e.g. "live/" jwt.RegisteredClaims } // MediaMTX external-auth POST body (exact keys per mediamtx.yml sample) type MediaMTXAuthReq struct { User string `json:"user"` // optional Password string `json:"password"` // optional Token string `json:"token"` // from Authorization: Bearer or query (?token=) IP string `json:"ip"` Action string `json:"action"` // publish|read|playback|api|metrics|pprof Path string `json:"path"` // e.g. "live/" Protocol string `json:"protocol"` // rtsp|rtmp|hls|webrtc|srt ID string `json:"id"` // session id Query string `json:"query"` // raw query string } type MediaMTXAuthResp struct { // empty 200 means allowed; add fields if you want to return JSON // to mediamtx (not required) } // Token minting type PublishTokenReq struct { GUID string `json:"guid" binding:"required,uuid4"` } type PublishTokenResp struct { HLS string `json:"hlsUrl"` // https:///hls/live//index.m3u8?token=... } type ReadTokenReq struct { GUID string `json:"guid" binding:"required,uuid4"` } type ReadTokenResp struct { HLS string `json:"hlsUrl"` // http:///hls/live//index.m3u8?token=... WHEP string `json:"whepUrl"` // http:///webrtc/play/live/?token=... }