Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using content from NetRC when using GitHub App API #1008

Open
wants to merge 1 commit into
base: master
from

Conversation

@MichaelKlemm
Copy link

@MichaelKlemm MichaelKlemm commented Nov 9, 2020

When using the default authentication handler and not overwriting the auth parameter, the netrc file will be read and will overwrite an existing value that was provided using the headers parameter. As the value in the NetRC is wrong a 401 will happen. Using a custom auth handler will ensure the expected token is beeing used.

Before opening a new issue, please search for a previously filed
issue to ensure you're not creating a duplicate.

Note Bug reports without the following will receive requests for these
details to be provided.

Version Information

Please provide:

  • The version of Python you're using 3.8.5

  • The version of pip you used to install github3.py 20.2.4

  • The version of github3.py, requests, uritemplate, and dateutil installed 1.3.0

Minimum Reproducible Example

  1. Add an invalid entry for GitHub(-server) to your netrc.
  2. Try to authenticate using a GitHub App

Exception information

Login does not work. When using the debugger you can see the authentication header used by requests. It's the value from NetRC.

Michael Klemm
When using the default authentication handler and not overwriting
the auth parameter, the netrc file will be read and will overwrite
an existing value that was provided using the headers parameter.
As the value in the NetRC is wrong a 401 will happen. Using a
custom auth handler will ensure the expected token is beeing used.
@opendev-zuul
Copy link

@opendev-zuul opendev-zuul bot commented Nov 9, 2020

Starting third-party-check jobs.
Warning:
Failed to update check run openstack/third-party-check: 403 Resource not accessible by integration

@opendev-zuul
Copy link

@opendev-zuul opendev-zuul bot commented Nov 9, 2020

Build failed (third-party-check pipeline) integration testing on
OpenDev. For information on how to proceed, see
https://docs.opendev.org/opendev/infra-manual/latest/developers.html#automated-testing

Warning:
Failed to update check run openstack/third-party-check: 403 Resource not accessible by integration
Failed to create check run openstack/third-party-check: 403 Resource not accessible by integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.