Skip to content
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

Support lib for internal Git servers #64

Open
aksylumoed opened this issue Jul 21, 2024 · 1 comment
Open

Support lib for internal Git servers #64

aksylumoed opened this issue Jul 21, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@aksylumoed
Copy link

Proposed change

The lib defaults to using github.com (ref) as the domain name to look for the authentication, but could be extended to support internal git servers (GH enterprise users) as well.

The default github.com domain cannot find any Github Apps that are created on an internal Git server, so a 404 error is thrown as the client Id cannot be found.

Alternative options

There's no current alternative I could think of; anyone wanting to make changes to repos in internal Git servers via Jhub cannot use this lib as it only supports github.com. We could maintain a forked version of this lib, but IMO it would be difficult to keep track of any future changes.

Who would use this feature?

This feature would be useful for all Gtihub Enterprise users who'd like to use this lib for getting access to internal Git servers.

(Optional): Suggest a solution

(I have tested this solution for our internal Git server to verify)

We can introduce another arg --hostname (or equivalent) to specify the which internal Git domain should be used. If not specified, it can default github.com. Similar to the other args, an env var GH_SCOPED_CREDS_HOSTNAME can be specified to avoid passing this arg every time.

This arg would then be used in all the places where "github.com" is being hardcoded:

  1. https://github.com/jupyterhub/gh-scoped-creds/blob/main/gh_scoped_creds/__init__.py#L22
  2. https://github.com/jupyterhub/gh-scoped-creds/blob/main/gh_scoped_creds/__init__.py#L51
  3. https://github.com/jupyterhub/gh-scoped-creds/blob/main/gh_scoped_creds/__init__.py#L94
  4. https://github.com/jupyterhub/gh-scoped-creds/blob/main/gh_scoped_creds/__init__.py#L103
@aksylumoed aksylumoed added the enhancement New feature or request label Jul 21, 2024
@aksylumoed
Copy link
Author

cc @yuvipanda as you're the top contributor to this repo.

Any concerns if I make a PR for this change? I have the changes already locally, would just need write access to make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant