Versions in this module Expand all Collapse all v1 v1.5.1 May 26, 2023 Changes in this version + var ErrKeysMissing = errors.New("missing API key or secret key") + 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) SetIdentity(identity string) *AccessToken + func (t *AccessToken) SetMetadata(md string) *AccessToken + func (t *AccessToken) SetName(name string) *AccessToken + func (t *AccessToken) SetSha256(sha string) *AccessToken + func (t *AccessToken) SetValidFor(duration time.Duration) *AccessToken + func (t *AccessToken) ToJWT() (string, error) + type ClaimGrants struct + Identity string + Metadata string + Name string + Sha256 string + Video *VideoGrant + func (c *ClaimGrants) Clone() *ClaimGrants + 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 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 + CanPublish *bool + CanPublishData *bool + CanPublishSources []string + CanSubscribe *bool + CanUpdateOwnMetadata *bool + 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) GetCanUpdateOwnMetadata() bool + 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) SetCanUpdateOwnMetadata(val bool) + func (v *VideoGrant) ToPermission() *livekit.ParticipantPermission + func (v *VideoGrant) UpdateFromPermission(permission *livekit.ParticipantPermission)