mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Decode jwt bytes object in Python 3 (#633)
This commit is contained in:
committed by
Jason White
parent
15cdc2f8fd
commit
84b43da76c
+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