Versions in this module Expand all Collapse all v0 v0.0.2 Dec 29, 2024 v0.0.1 Dec 28, 2024 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) AddSIPGrant(grant *SIPGrant) *AccessToken + func (t *AccessToken) GetGrants() *ClaimGrants + func (t *AccessToken) SetAgents(agents ...*wirtual.RoomAgentDispatch) *AccessToken + func (t *AccessToken) SetAttributes(attrs map[string]string) *AccessToken + func (t *AccessToken) SetIdentity(identity string) *AccessToken + func (t *AccessToken) SetKind(kind wirtual.ParticipantInfo_Kind) *AccessToken + func (t *AccessToken) SetMetadata(md string) *AccessToken + func (t *AccessToken) SetName(name string) *AccessToken + func (t *AccessToken) SetRoomConfig(config *wirtual.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 ClaimGrants struct + 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() wirtual.ParticipantInfo_Kind + func (c *ClaimGrants) GetRoomConfiguration() *wirtual.RoomConfiguration + func (c *ClaimGrants) MarshalLogObject(e zapcore.ObjectEncoder) error + func (c *ClaimGrants) SetParticipantKind(kind wirtual.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 wirtual.RoomConfiguration + 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 + 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 wirtual.TrackSource) bool + func (v *VideoGrant) GetCanPublishSources() []wirtual.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 *wirtual.ParticipantPermission) bool + func (v *VideoGrant) SetCanPublish(val bool) + func (v *VideoGrant) SetCanPublishData(val bool) + func (v *VideoGrant) SetCanPublishSources(sources []wirtual.TrackSource) + func (v *VideoGrant) SetCanSubscribe(val bool) + func (v *VideoGrant) SetCanSubscribeMetrics(val bool) + func (v *VideoGrant) SetCanUpdateOwnMetadata(val bool) + func (v *VideoGrant) ToPermission() *wirtual.ParticipantPermission + func (v *VideoGrant) UpdateFromPermission(permission *wirtual.ParticipantPermission)