Commit d8b88f5
committed
fix: convert app_id to string before login_as_app_installation call
### 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 1cdbda1 commit d8b88f5
4 files changed
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
75 | 89 | | |
76 | 90 | | |
77 | 91 | | |
| |||
0 commit comments