Skip to content

Add quick example of syntax transport "auth" parameter expects (e.g when using GitHub personal access token)? #175

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

Closed
bdklahn opened this issue Nov 28, 2020 · 1 comment
Labels
type: question or discussion Issue discussing or asking a question about gql

Comments

@bdklahn
Copy link

bdklahn commented Nov 28, 2020

Might you provide documentation of that parameter?
Here is what I see, now.

:param auth: Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth
(Default: None).

What might that expect for, say, using a GitHub personal access token (which I've already created)?

tuple(<user>, <token>) ?
tuple('Bearer', '<user>:<token>') ?
tuple('Authorization', <user>, <token>) ?

I guess this must be passed off to requests, and dependent on https standards and/or attributes the service expects/defines.

So "tuple" seems to imply there is a specific number and order of arguments, we must already know about. If it were a dict, I guess that could give more clues about what types of information are expected.
Maybe just provide a link to that standard or documentation in the requests module, or whatever?
Thanks.

@bdklahn bdklahn changed the title Add quick example of syntax transport "auth" parameter expects when using GitHub personal access token? Add quick example of syntax transport "auth" parameter expects (e.g when using GitHub personal access token)? Nov 28, 2020
@leszekhanusz
Copy link
Collaborator

You don't need to use the auth parameter for the GitHub API, you should instead send an http header Authorization with value "bearer YOUR_TOKEN".
See issue #149 for an example.

@leszekhanusz leszekhanusz added the type: question or discussion Issue discussing or asking a question about gql label Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about gql
Projects
None yet
Development

No branches or pull requests

2 participants