mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Decode jwt bytes object in Python 3 (#633)
This commit is contained in:
committed by
Jason White
parent
15cdc2f8fd
commit
84b43da76c
@@ -23,6 +23,8 @@
|
||||
################################################################################
|
||||
|
||||
*.pyc
|
||||
.eggs/
|
||||
.python-version
|
||||
|
||||
/GithubCredentials.py
|
||||
/scripts/TwitterCredentials.py
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
language: python
|
||||
python:
|
||||
- '2.7'
|
||||
- '2.6'
|
||||
- '2.7'
|
||||
- '3.2'
|
||||
- '3.3'
|
||||
- '3.4'
|
||||
|
||||
+7
-2
@@ -633,12 +633,17 @@ class GithubIntegration(object):
|
||||
"exp": now + 60,
|
||||
"iss": self.integration_id
|
||||
}
|
||||
return jwt.encode(
|
||||
encrypted = jwt.encode(
|
||||
payload,
|
||||
key=self.private_key,
|
||||
algorithm="RS256"
|
||||
)
|
||||
|
||||
if atLeastPython3:
|
||||
encrypted = encrypted.decode('utf-8')
|
||||
|
||||
return encrypted
|
||||
|
||||
def get_access_token(self, installation_id, user_id=None):
|
||||
"""
|
||||
Get an access token for the given installation id.
|
||||
@@ -689,4 +694,4 @@ class GithubIntegration(object):
|
||||
raise GithubException.GithubException(
|
||||
status=response.status,
|
||||
data=response_text
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user