Skip to content

Support authenticated Github API requests#278

Merged
tobami merged 1 commit into
tobami:masterfrom
Kami:support_github_auth
Feb 16, 2020
Merged

Support authenticated Github API requests#278
tobami merged 1 commit into
tobami:masterfrom
Kami:support_github_auth

Conversation

@Kami
Copy link
Copy Markdown
Contributor

@Kami Kami commented Feb 13, 2020

This pull request updates the code so it supports oAuth token authenticated requests to the Github API inside the Github repo provider.

Background / Description

Right now Github provider utilizes non-authenticated Github API requests.

Those requests have a low rate limits set which means Github API will start returning 403 rate limit reached in case the rate limits have been hit (e.g. results for larger number commits are submitted in a short time frame).

This comes handy in a lot of scenarios because unauthenticated Github
requests have low rate limits.
# Python 2
from urllib import urlopen
from urllib2 import urlopen
from urllib2 import Request
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to introduce additional dependency (requests), so I just followed the existing approach.

Copy link
Copy Markdown
Owner

@tobami tobami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition!

@tobami
Copy link
Copy Markdown
Owner

tobami commented Feb 16, 2020

We need to start documenting this at least in the readme...

@tobami tobami merged commit b362022 into tobami:master Feb 16, 2020
@Kami
Copy link
Copy Markdown
Contributor Author

Kami commented Feb 16, 2020

@tobami - I agree, where should I add those docs?

Should I add it to REAME under "provider" / backend specific settings section / similar? Or to the wiki?

Talking about the "backend specific settings" - I didn't want to go overboard since currently there really isn't any other provider specific setting so I just used a plain string value (I didn't want to introduce some kind of dict with per provider / backend options or similar).

@tobami
Copy link
Copy Markdown
Owner

tobami commented Feb 17, 2020

Cool. As a first iteration the same "provider" docs could be added to both the readme and wiki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants