3
3
4
4
5
5
class IpMessagingGrant (object ):
6
+ """ Grant to access Twilio IP Messaging """
6
7
def __init__ (self , service_sid = None , endpoint_id = None ,
7
8
role_sid = None , credential_sid = None ):
8
9
self .service_sid = service_sid
@@ -29,6 +30,7 @@ def to_payload(self):
29
30
30
31
31
32
class ConversationsGrant (object ):
33
+ """ Grant to access Twilio Conversations """
32
34
def __init__ (self , configuration_profile_sid = None ):
33
35
self .configuration_profile_sid = configuration_profile_sid
34
36
@@ -45,6 +47,7 @@ def to_payload(self):
45
47
46
48
47
49
class AccessToken (object ):
50
+ """ Access Token used to access Twilio Resources """
48
51
def __init__ (self , account_sid , signing_key_sid , secret ,
49
52
identity = None , ttl = 3600 ):
50
53
self .account_sid = account_sid
@@ -81,7 +84,8 @@ def to_jwt(self, algorithm='HS256'):
81
84
"grants" : grants
82
85
}
83
86
84
- return jwt .encode (payload , self .secret , headers = headers )
87
+ return jwt .encode (payload , self .secret , headers = headers ,
88
+ algorithm = algorithm )
85
89
86
90
def __str__ (self ):
87
91
return self .to_jwt ().decode ('utf-8' )
0 commit comments