Skip to content

Allow to use custom HttpConnector when only OAuth token is given#124

Merged
kohsuke merged 2 commits into
hub4j:masterfrom
ohtake:connector
Sep 4, 2014
Merged

Allow to use custom HttpConnector when only OAuth token is given#124
kohsuke merged 2 commits into
hub4j:masterfrom
ohtake:connector

Conversation

@ohtake
Copy link
Copy Markdown
Contributor

@ohtake ohtake commented Sep 4, 2014

The old pull request is #120.

If you use GitHub.connectUsingOAuth(String oauthAccessToken) or GitHub.connectUsingOAuth(String githubServer, String oauthAccessToken), the constructor of GitHub calls #getMyself.
Because there is no way to call #setConnector before the construction, #getMyself will fail if the server is behind proxies.
This pull request allows library users to use custom HttpConnector when only OAuth token is given.

Example usage is:

GitHub gh = new GitHubBuilder()
    .withEndpoint(serverAPIUrl)
    .withOAuthToken(accessToken)
    .withConnector(new HttpConnectorWithJenkinsProxy())
    .build();

@buildhive
Copy link
Copy Markdown

Kohsuke Kawaguchi » github-api #225 SUCCESS
This pull request looks good
(what's this?)

ohtake added a commit to ohtake/ghprb-plugin that referenced this pull request Sep 4, 2014
kohsuke added a commit that referenced this pull request Sep 4, 2014
Allow to use custom HttpConnector when only OAuth token is given
@kohsuke kohsuke merged commit 95fbf92 into hub4j:master Sep 4, 2014
@ohtake ohtake deleted the connector branch September 5, 2014 02:17
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.

3 participants