Versions in this module Expand all Collapse all v1 v1.0.0 Jul 3, 2025 Changes in this version + var ErrKeysMissing = errors.New("missing API key or secret key") + var ErrSensitiveCredentials = errors.New("room configuration should not contain sensitive credentials") + type APIKeyTokenVerifier struct + func ParseAPIToken(raw string) (*APIKeyTokenVerifier, error) + func (v *APIKeyTokenVerifier) APIKey() string + func (v *APIKeyTokenVerifier) Identity() string + func (v *APIKeyTokenVerifier) Verify(key interface{}) (*ClaimGrants, error) + type AccessToken struct + func NewAccessToken(key string, secret string) *AccessToken + func (t *AccessToken) AddGrant(grant *VideoGrant) *AccessToken + func (t *AccessToken) AddSIPGrant(grant *SIPGrant) *AccessToken + func (t *AccessToken) GetGrants() *ClaimGrants + func (t *AccessToken) SetAgentGrant(grant *AgentGrant) *AccessToken + func (t *AccessToken) SetAgents(agents ...*livekit.RoomAgentDispatch) *AccessToken + func (t *AccessToken) SetAttributes(attrs map[string]string) *AccessToken + func (t *AccessToken) SetIdentity(identity string) *AccessToken + func (t *AccessToken) SetKind(kind livekit.ParticipantInfo_Kind) *AccessToken + func (t *AccessToken) SetMetadata(md string) *AccessToken + func (t *AccessToken) SetName(name string) *AccessToken + func (t *AccessToken) SetRoomConfig(config *livekit.RoomConfiguration) *AccessToken + func (t *AccessToken) SetRoomPreset(preset string) *AccessToken + func (t *AccessToken) SetSIPGrant(grant *SIPGrant) *AccessToken + func (t *AccessToken) SetSha256(sha string) *AccessToken + func (t *AccessToken) SetValidFor(duration time.Duration) *AccessToken + func (t *AccessToken) SetVideoGrant(grant *VideoGrant) *AccessToken + func (t *AccessToken) ToJWT() (string, error) + type AgentGrant struct + Admin bool + func (s *AgentGrant) Clone() *AgentGrant + func (s *AgentGrant) MarshalLogObject(e zapcore.ObjectEncoder) error + type ClaimGrants struct + Agent *AgentGrant + Attributes map[string]string + Identity string + Kind string + Metadata string + Name string + RoomConfig *RoomConfiguration + RoomPreset string + SIP *SIPGrant + Sha256 string + Video *VideoGrant + func (c *ClaimGrants) Clone() *ClaimGrants + func (c *ClaimGrants) GetParticipantKind() livekit.ParticipantInfo_Kind + func (c *ClaimGrants) GetRoomConfiguration() *livekit.RoomConfiguration + func (c *ClaimGrants) MarshalLogObject(e zapcore.ObjectEncoder) error + func (c *ClaimGrants) SetParticipantKind(kind livekit.ParticipantInfo_Kind) + type FileBasedKeyProvider struct + func NewFileBasedKeyProviderFromMap(keys map[string]string) *FileBasedKeyProvider + func NewFileBasedKeyProviderFromReader(r io.Reader) (p *FileBasedKeyProvider, err error) + func (p *FileBasedKeyProvider) GetSecret(key string) string + func (p *FileBasedKeyProvider) NumKeys() int + type KeyProvider interface + GetSecret func(key string) string + NumKeys func() int + type RoomConfiguration livekit.RoomConfiguration + func (c *RoomConfiguration) CheckCredentials() error + func (c *RoomConfiguration) Clone() *RoomConfiguration + func (c *RoomConfiguration) MarshalJSON() ([]byte, error) + func (c *RoomConfiguration) UnmarshalJSON(data []byte) error + type SIPGrant struct + Admin bool + Call bool + func (s *SIPGrant) Clone() *SIPGrant + func (s *SIPGrant) MarshalLogObject(e zapcore.ObjectEncoder) error + type SimpleKeyProvider struct + func NewSimpleKeyProvider(apiKey, apiSecret string) *SimpleKeyProvider + func (p *SimpleKeyProvider) GetSecret(key string) string + func (p *SimpleKeyProvider) NumKeys() int + type TokenVerifier interface + Identity func() string + Verify func(key interface{}) (*ClaimGrants, error) + type VideoGrant struct + Agent bool + CanPublish *bool + CanPublishData *bool + CanPublishSources []string + CanSubscribe *bool + CanSubscribeMetrics *bool + CanUpdateOwnMetadata *bool + DestinationRoom string + Hidden bool + IngressAdmin bool + Recorder bool + Room string + RoomAdmin bool + RoomCreate bool + RoomJoin bool + RoomList bool + RoomRecord bool + func (v *VideoGrant) Clone() *VideoGrant + func (v *VideoGrant) GetCanPublish() bool + func (v *VideoGrant) GetCanPublishData() bool + func (v *VideoGrant) GetCanPublishSource(source livekit.TrackSource) bool + func (v *VideoGrant) GetCanPublishSources() []livekit.TrackSource + func (v *VideoGrant) GetCanSubscribe() bool + func (v *VideoGrant) GetCanSubscribeMetrics() bool + func (v *VideoGrant) GetCanUpdateOwnMetadata() bool + func (v *VideoGrant) MarshalLogObject(e zapcore.ObjectEncoder) error + func (v *VideoGrant) MatchesPermission(permission *livekit.ParticipantPermission) bool + func (v *VideoGrant) SetCanPublish(val bool) + func (v *VideoGrant) SetCanPublishData(val bool) + func (v *VideoGrant) SetCanPublishSources(sources []livekit.TrackSource) + func (v *VideoGrant) SetCanSubscribe(val bool) + func (v *VideoGrant) SetCanSubscribeMetrics(val bool) + func (v *VideoGrant) SetCanUpdateOwnMetadata(val bool) + func (v *VideoGrant) ToPermission() *livekit.ParticipantPermission + func (v *VideoGrant) UpdateFromPermission(permission *livekit.ParticipantPermission)