https://github.com/discourse/onebox/pull/238
Onebox when using the github api to fetch information about a commit or a pull request
is currently using unauthenticated request.
While I was developing and testing new pull request functionality. I quickly reached the 60 requests limit per hour.
So I implemented authentication for github api requests.
the method and credentials can be passed using the Onebox.options
Two authentication methods are supported
- oauth token
- username and password (not recommended)
Onebox.options ={:GithubPullRequestOnebox => {
:github_auth_token => "<token>",
:github_auth_user => "<user>",
:github_auth_pass => "<pass>",
:github_auth_method =>:oauth, # :basic | :oauth | nil
:get_build_status => true
}
}
Two authentication methods are supported
- oauth token
- username and password (not recommended)
###Generating a github oauth token for an application
oauth is the recommended way since you do not expose your password, and full privileges.and you can generate one without any scopes. if you only use it for public repositories
https://github.com/settings/tokens/new
Show pull status and build status,
When this is activated in the box options it will make an additional request to get the build status.