#NEWLINE# def to_jwt( self ) : #NEWLINE# #INDENT# now = int ( time . time ( ) ) #NEWLINE# headers = { #NEWLINE# #INDENT# 'cty' : 'twilio-sat;v=1' , #NEWLINE# #UNINDENT# } #NEWLINE# payload = { #NEWLINE# #INDENT# 'jti' : '{}-{}' . format ( self . signing_key_sid , now ) , #NEWLINE# 'iss' : self . signing_key_sid , #NEWLINE# 'sub' : self . account_sid , #NEWLINE# 'nbf' : now , #NEWLINE# 'exp' : ( now + self . ttl ) , #NEWLINE# 'grants' : self . grants , #NEWLINE# #UNINDENT# } #NEWLINE# return jwt . encode ( payload , self . secret , headers = headers )