Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasRequiredClaims ¶
HasRequiredClaims returns false if the Token is missing any required elements
Types ¶
type Token ¶
type Token struct {
// BookingID represents the booking id/name that the token has been generated
// for, so that connections can be dropped / denied if a booked session
// is cancelled
BookingID string `json:"booking_id"`
// Topic identifies the communication channel;
// think of it as a session_id, or room (webrtc)
// Don't reuse standard claim Subject as that is for a
// usually for a user and is reserved for later usage.
Topic string `json:"topic"`
// Determines the type of communication channel
// and hence required scopes + hub/client implementation
// e.g. "session" or "shell"
ConnectionType string `json:"prefix"`
// Scopes controlling access to relay;
// either ["read"],["write"], or ["read","write"] for session, or ["host"]/["client"] for shell
Scopes []string `json:"scopes"`
jwt.RegisteredClaims `yaml:",omitempty"`
}
Token represents a JWT token
func (*Token) SetBookingID ¶ added in v0.3.0
SetBookingID sets the bookingID (so that connections can be cancelled if a booking is cancelled)
Click to show internal directories.
Click to hide internal directories.