Fix some trivial issues.
This commit is contained in:
@@ -1396,7 +1396,7 @@ class SignedJwtAssertionCredentials(AssertionCredentials):
|
|||||||
|
|
||||||
def _generate_assertion(self):
|
def _generate_assertion(self):
|
||||||
"""Generate the assertion that will be used in the request."""
|
"""Generate the assertion that will be used in the request."""
|
||||||
now = long(time.time())
|
now = int(time.time())
|
||||||
payload = {
|
payload = {
|
||||||
'aud': self.token_uri,
|
'aud': self.token_uri,
|
||||||
'scope': self.scope,
|
'scope': self.scope,
|
||||||
|
|||||||
@@ -191,8 +191,10 @@ try:
|
|||||||
Verifier instance.
|
Verifier instance.
|
||||||
"""
|
"""
|
||||||
if is_x509_cert:
|
if is_x509_cert:
|
||||||
pemLines = key_pem.replace(' ', '').split()
|
if isinstance(key_pem, six.text_type):
|
||||||
certDer = _urlsafe_b64decode(''.join(pemLines[1:-1]))
|
key_pem = key_pem.encode('ascii')
|
||||||
|
pemLines = key_pem.replace(b' ', b'').split()
|
||||||
|
certDer = _urlsafe_b64decode(b''.join(pemLines[1:-1]))
|
||||||
certSeq = DerSequence()
|
certSeq = DerSequence()
|
||||||
certSeq.decode(certDer)
|
certSeq.decode(certDer)
|
||||||
tbsSeq = DerSequence()
|
tbsSeq = DerSequence()
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import tempfile
|
|||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from http_mock import HttpMockSequence
|
from .http_mock import HttpMockSequence
|
||||||
from oauth2client import crypt
|
from oauth2client import crypt
|
||||||
from oauth2client.client import Credentials
|
from oauth2client.client import Credentials
|
||||||
from oauth2client.client import SignedJwtAssertionCredentials
|
from oauth2client.client import SignedJwtAssertionCredentials
|
||||||
|
|||||||
Reference in New Issue
Block a user