| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
PyJWT 2.12+ enforces that the 'iss' claim must be a string per RFC 7519
Section 4.1.1 (StringOrURI). Previously self.id (an int) was passed
directly, which worked with older PyJWT but fails with:
TypeError: Issuer (iss) must be a string.
This is safe for all PyJWT versions — older versions accept both int and
str, and GitHub's API matches on value regardless of JSON type.
There was a problem hiding this comment.
This PR updates JWT generation in GitHubApp to ensure the iss (issuer) claim is always a string, maintaining compatibility with PyJWT 2.12+’s stricter claim type enforcement.
Changes:
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/githubapp/core.py | Ensures JWT iss claim is encoded as a string for PyJWT 2.12+ compatibility. |
| tests/test_core.py | Updates JWT payload assertion to match the new iss string type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Addresses review feedback — str(None) would produce 'None' as the issuer, which passes PyJWT's type check but gets rejected by GitHub. Raise GitHubAppError with a clear message instead.
| Back | FazBrowse Home | New Git URL |
Summary
Context
PyJWT 2.12+ enforces that the iss (issuer) claim must be a string, per RFC 7519 Section 4.1.1 (StringOrURI). Previously self.id (an int from github_app_id) was passed directly, which worked with older PyJWT versions but fails with:
Why this is safe
Test plan