Skip to content

Commit 975245c

Browse files
committed
Cast GitHub app_id as string before using as iss
The pyjwt library expects the issuer to be of type `str` and enforces it with jpadilla/pyjwt#1040. Using an integer as done before will result in `TypeError: Issuer (iss) must be a string.`. Signed-off-by: Jonas Brand (8R0WNI3) <j.brand@sap.com>
1 parent 880e6c2 commit 975245c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/github3/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def create_token(private_key_pem, app_id, expire_in=TEN_MINUTES_AS_SECONDS):
174174
raise ValueError('"private_key_pem" parameter must be byte-string')
175175
now = int(time.time())
176176
token = jwt.encode(
177-
payload={"iat": now, "exp": now + expire_in, "iss": app_id},
177+
payload={"iat": now, "exp": now + expire_in, "iss": str(app_id)},
178178
key=private_key_pem,
179179
algorithm="RS256",
180180
)

0 commit comments

Comments
 (0)