question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for private GitHub Enterprise installations

See original GitHub issue

The base GitHub API URLs are hard-coded inside the GithubAPIv3Config class:

case class GithubAPIv3Config(
    baseUrl: String = "https://api.github.com/",
    authorizeUrl: String =
      "https://github.com/login/oauth/authorize?client_id=%s&redirect_uri=%s&scope=%s&state=%s",
    accessTokenUrl: String = "https://github.com/login/oauth/access_token"
)

which makes impossible to leverage github4s in those companies which use their private GitHub installations and obviously different base API URLs.

Currently it seems there’s no way to override these URLs.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
BenFradetcommented, Mar 19, 2020

yes I think it needs renaming, maybe something like:


final case class GithubConfig(
  baseUrl: String = "https://api.github.com/",
  authorizeUrl: String = "https://github.com/login/oauth/authorize?client_id=%s&redirect_uri=%s&scope=%s&state=%s",
  accessTokenUrl: String = "https://github.com/login/oauth/access_token"
)

object GithubConfig {  
  implicit val default: GithubConfig = GithubConfig()
}

and then have:

class Github[F[_]: Sync](
    client: Client[F],
    accessToken: Option[String]
)(implicit ghConfig: GithubConfig)

👍

0reactions
satorgcommented, Mar 22, 2020

@BenFradet, I submitted a PR #384, could you take a look please?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing GitHub Apps
Once you create a private GitHub App, you can install it on one of your org or user repositories. For more information, see...
Read more >
Enabling private mode - GitHub Enterprise Server 3.3 Docs
In private mode, GitHub Enterprise Server requires every user to sign in to access the installation. You must enable private mode if your...
Read more >
Installing GitHub Apps - GitHub Enterprise Server 3.3 Docs
Once you create a private GitHub App, you can install it on one of your org or user repositories. For more information, see...
Read more >
Installing GitHub Apps - GitHub Enterprise Server 3.4 Docs
Installing your private GitHub App on your repository · From the GitHub Apps settings page, select your app. · In the left sidebar,...
Read more >
Making a GitHub App public or private
Private installation flows allow only the owner of a GitHub App to install it. Limited information about the GitHub App will still exist...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found