Commit 2f73601
authored
fix: convert app_id to string before login_as_app_installation call (#340)
Fixes #333
## What
Wrapped `gh_app_id` with `str()` in the `login_as_app_installation` call in
auth.py, and added a targeted test for integer app_id inputs. Existing tests
were also tightened to assert on exact call arguments.
## Why
When `gh_app_id` is passed as an integer, PyJWT raises a TypeError on the
`iss` claim during JWT encoding because it expects a string. This surfaces
at runtime when the environment variable is parsed as an int rather than str.
## Notes
- Only `gh_app_id` is converted; `gh_app_installation_id` is left as-is since `login_as_app_installation` accepts it in its original form — reviewers should verify this is intentional
- The existing tests previously used `assert_called_once()` without argument checks, so bugs like this were invisible; the tightened assertions now catch argument type mismatches
Signed-off-by: jmeridth <jmeridth@gmail.com>1 parent 56fce7d commit 2f73601
2 files changed
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
74 | 88 | | |
75 | 89 | | |
76 | 90 | | |
| |||
0 commit comments