Commit 0ab8d82
committed
fix: cast gh_app_id to string for JWT encoding compatibility
Relates to #508
## What
Cast gh_app_id to str() when passing it to login_as_app_installation,
which internally calls jwt.encode expecting the iss claim to be a string.
Updated tests to pass integer app IDs and assert the string conversion
occurs.
## Why
Since v2.0.0, GitHub App authentication fails with
"TypeError: Issuer (iss) must be a string" because newer versions of
PyJWT enforce that the iss claim is a string, but gh_app_id was being
passed as an integer.
## Notes
- Tests now use assert_called_once_with instead of assert_called_once to verify the exact arguments, preventing this class of regression
- Test inputs changed from strings to integers to mirror real-world usage where env vars are parsed as ints
Signed-off-by: jmeridth <jmeridth@gmail.com>1 parent d2af62b commit 0ab8d82
2 files changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
0 commit comments