Documentation
¶
Index ¶
- Variables
- type APIKeyTokenVerifier
- type AccessToken
- func (t *AccessToken) AddGrant(grant *VideoGrant) *AccessToken
- func (t *AccessToken) SetIdentity(identity string) *AccessToken
- func (t *AccessToken) SetMetadata(md map[string]interface{}) *AccessToken
- func (t *AccessToken) SetValidFor(duration time.Duration) *AccessToken
- func (t *AccessToken) ToJWT() (string, error)
- type ClaimGrants
- type FileBasedKeyProvider
- type KeyProvider
- type TokenVerifier
- type VideoGrant
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrKeysMissing = errors.New("missing API key or secret key")
)
Functions ¶
This section is empty.
Types ¶
type APIKeyTokenVerifier ¶
type APIKeyTokenVerifier struct {
// contains filtered or unexported fields
}
func ParseAPIToken ¶
func ParseAPIToken(raw string) (*APIKeyTokenVerifier, error)
func (*APIKeyTokenVerifier) APIKey ¶
func (v *APIKeyTokenVerifier) APIKey() string
Returns the API key this token was signed with
func (*APIKeyTokenVerifier) Identity ¶
func (v *APIKeyTokenVerifier) Identity() string
func (*APIKeyTokenVerifier) Verify ¶
func (v *APIKeyTokenVerifier) Verify(key interface{}) (*ClaimGrants, error)
type AccessToken ¶
type AccessToken struct {
// contains filtered or unexported fields
}
Signer that produces token signed with API key and secret
func NewAccessToken ¶
func NewAccessToken(key string, secret string) *AccessToken
func (*AccessToken) AddGrant ¶
func (t *AccessToken) AddGrant(grant *VideoGrant) *AccessToken
func (*AccessToken) SetIdentity ¶
func (t *AccessToken) SetIdentity(identity string) *AccessToken
func (*AccessToken) SetMetadata ¶
func (t *AccessToken) SetMetadata(md map[string]interface{}) *AccessToken
func (*AccessToken) SetValidFor ¶
func (t *AccessToken) SetValidFor(duration time.Duration) *AccessToken
func (*AccessToken) ToJWT ¶
func (t *AccessToken) ToJWT() (string, error)
type ClaimGrants ¶
type ClaimGrants struct {
Identity string `json:"-"`
Video *VideoGrant `json:"video,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
type FileBasedKeyProvider ¶
type FileBasedKeyProvider struct {
// contains filtered or unexported fields
}
func NewFileBasedKeyProviderFromMap ¶
func NewFileBasedKeyProviderFromMap(keys map[string]string) *FileBasedKeyProvider
func NewFileBasedKeyProviderFromReader ¶
func NewFileBasedKeyProviderFromReader(r io.Reader) (p *FileBasedKeyProvider, err error)
func (*FileBasedKeyProvider) GetSecret ¶
func (p *FileBasedKeyProvider) GetSecret(key string) string
func (*FileBasedKeyProvider) NumKeys ¶
func (p *FileBasedKeyProvider) NumKeys() int
type KeyProvider ¶
type TokenVerifier ¶
type TokenVerifier interface {
Identity() string
Verify(key interface{}) (*ClaimGrants, error)
}
type VideoGrant ¶
Click to show internal directories.
Click to hide internal directories.