Commit 322e81b
committed
fix: cast gh_app_id to string for JWT encoding compatibility
Relates to github-community-projects/evergreen#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 e26b4f3 commit 322e81b
2 files changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
69 | 70 | | |
70 | | - | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
0 commit comments