Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultAlgorithm = jwt.HS256
DefaultAlgorithm is your preferred signing algorithm
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken struct { Identity string // Generated here: https://www.twilio.com/user/account/video/profiles // contains filtered or unexported fields }
AccessToken is a JWT that grants access to Twilio services
func New ¶
func New(accountSid, apiKey, apiSecret string) *AccessToken
New creates a new AccessToken. TTL is set to default and grants are defaulted to an empty slice of Grant.
func (*AccessToken) AddGrant ¶
func (t *AccessToken) AddGrant(grant Grant)
AddGrant adds a grant to this AccessToken
func (*AccessToken) ToJWT ¶
func (t *AccessToken) ToJWT(algorithm string) (string, error)
ToJWT returns this token as a signed JWT using the specified hash algorithm Returns the signed JWT or an error Ported from: https://github.com/twilio/twilio-python/blob/master/twilio/access_token.py
type ConversationsGrant ¶
type ConversationsGrant struct {
// contains filtered or unexported fields
}
ConversationsGrant is for Twilio Programmable Video access
func NewConversationsGrant ¶
func NewConversationsGrant(sid string) *ConversationsGrant
NewConversationsGrant for Twilio Programmable Video access
type Grant ¶
type Grant interface {
// contains filtered or unexported methods
}
Grant is a Twilio SID resource that can be added to an AccessToken for extra services.
func NewVideoGrant ¶
type IPMessageGrant ¶
type IPMessageGrant struct {
// contains filtered or unexported fields
}
IPMessageGrant is a grant for accessing Twilio IP Messaging
func NewIPMessageGrant ¶
func NewIPMessageGrant(serviceSid, endpointID, deploymentRoleSid, pushCredentialSid string) *IPMessageGrant
NewIPMessageGrant for Twilio IP Message service