Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Webcam restrictions. NoVideoRule = Rule("novideo") // Can not use video features at all NoBroadcastRule = Rule("nobroadcast") // They can not share their webcam NoImageRule = Rule("noimage") // Can not upload or see images RedCamRule = Rule("redcam") // Their camera is force marked NSFW )
Available Rules your site can include in the JWT token: to enforce moderator rules on the user logging into chat.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct { // Custom claims. IsAdmin bool `json:"op,omitempty"` VIP bool `json:"vip,omitempty"` Avatar string `json:"img,omitempty"` ProfileURL string `json:"url,omitempty"` Nick string `json:"nick,omitempty"` Emoji string `json:"emoji,omitempty"` Gender string `json:"gender,omitempty"` Rules Rules `json:"rules,omitempty"` // Standard claims. Notes: // subject = username jwt.RegisteredClaims }
Custom JWT Claims.
func ParseAndValidate ¶
ParseAndValidate returns the Claims, a boolean authOK, and any errors.
type Rule ¶
type Rule string
Rule options for the JWT custom key.
Safely check its settings with the Is() functions which handle superset rules which imply other rules, for example novideo > nobroadcast.
func (Rule) IsNoBroadcastRule ¶
func (Rule) IsNoImageRule ¶
func (Rule) IsNoVideoRule ¶
func (Rule) IsRedCamRule ¶
Click to show internal directories.
Click to hide internal directories.