@@ -18,7 +18,7 @@ def compute_signature(self, uri, params):
18
18
:param params: post vars that Twilio sent with the request
19
19
:param auth: tuple with (account_sid, token)
20
20
21
- Returns the computed signature
21
+ :returns: The computed signature
22
22
"""
23
23
s = uri
24
24
if len (params ) > 0 :
@@ -37,25 +37,25 @@ def validate(self, uri, params, signature):
37
37
:param signature: expexcted signature in HTTP X-Twilio-Signature header
38
38
:param auth: tuple with (account_sid, token)
39
39
40
- returns true if the request passes validation, false if not
40
+ : ret
8000
urns: True if the request passes validation, False if not
41
41
"""
42
42
return self .compute_signature (uri , params ) == signature
43
43
44
44
45
45
class TwilioCapability (object ):
46
46
"""
47
47
A token to control permissions with Twilio Client
48
- """
49
48
50
- def __init__ (self , account_sid , auth_token ):
51
- """Create a new TwilioCapability with zero permissions
49
+ :param string account_sid: the account sid to which this token
50
+ is granted access
51
+ :param string auth_token: the secret key used to sign the token.
52
+ Note, this auth token is not visible to the
53
+ user of the token.
52
54
53
- Arguments:
54
- account_sid -- the account sid to which this token is granted access
55
- auth_token -- the secret key used to sign the token. Note, this auth
56
- token is not visible to the user of the token.
55
+ :returns: A new TwilioCapability with zero permissions
56
+ """
5
8000
7
57
58
- """
58
+ def __init__ ( self , account_sid , auth_token ):
59
59
self .account_sid = account_sid
60
60
self .auth_token = auth_token
61
61
self .capabilities = {}
@@ -71,8 +71,8 @@ def payload(self):
71
71
def generate (self , expires = 3600 ):
72
72
"""Generate a valid JWT token with an expiration date.
73
73
74
- Keyword Arguments:
75
- expires -- The token lifetime, in seconds. Defaults to 1 hour (3600)
74
+ :param int expires: The token lifetime, in seconds. Defaults to
75
+ 1 hour (3600)
76
76
77
77
"""
78
78
payload = self .payload ()
@@ -86,9 +86,8 @@ def allow_client_outgoing(self, application_sid,
86
86
87
87
Keyword arguments are passed to the application.
88
88
89
- Arguments:
90
- application_sid -- Application to contact
91
- client_name -- (Optional) used for caller id in client to client
89
+ :param string application_sid: Application to contact
90
+ :param string client_name: Used for caller id in client to client
92
91
93
92
"""
94
93
scope_params = {
@@ -107,8 +106,7 @@ def allow_client_incoming(self, client_name):
107
106
connections then configure the TwilioCapability through this method and
108
107
specify the client name.
109
108
110
- Arguments:
111
- client_name -- Client name to accept calls from
109
+ :param string client_name: Client name to accept calls from
112
110
113
111
"""
114
112
self .capabilities ["incoming" ] = ScopeURI ("client" , "incoming" , {
0 commit comments