Commit 655c8e1
committed
Use AppBearerTokenAuth in login_as_app_installation
Previously, this method used an Authorization header via `headers`
parameter, instead of an AuthBase instance via the `auth` parameter.
But the requests library has this behavior where it will try
to pick up authentication credentials from ~/.netrc if neither
session nor request has an associated AuthBase object. (A sole
Authorization header will not prevent this behavior.)
Since all of github3.py uses AuthBase instances to
authenticate, but login_as_app_installation didn't, this makes
for an incredibly difficult issue to debug, since the latter
is the only place in which the issue can manifest, if a user's
~/.netrc has an entry for api.github.com.
By using AppBearerTokenAuth, this can no longer happen, since
the ~/.netrc path is not hit any more.1 parent 3587d2f commit 655c8e1
2 files changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
1399 | 1400 | | |
1400 | 1401 | | |
1401 | 1402 | | |
1402 | | - | |
1403 | | - | |
1404 | | - | |
| 1403 | + | |
| 1404 | + | |
1405 | 1405 | | |
1406 | 1406 | | |
1407 | 1407 | | |
1408 | 1408 | | |
1409 | | - | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
1410 | 1412 | | |
1411 | 1413 | | |
1412 | 1414 | | |
| |||
0 commit comments