jupyterhub / binderhub

Run your code in the cloud, with technology so advanced, it feels like magic!
https://binderhub.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.57k stars 390 forks source link

Hide Token from Binder URL #1466

Open oyamin opened 2 years ago

oyamin commented 2 years ago

We have our own Self-hosted gitlab instance running on EKS. The repos are located in private repositories.

In order to clone the repo I have to choose "Git repository", and provide the git URL in the following format:

https://<usename>:<token>@gitlab.example.com/oyamin/binder-test-repo.git

If you omit either username or token, you get the following error:

fatal: could not read Password for 'https://<username or password>@gitlab.exmaple.com': No such device or address

I don't mind proving the usename:token, but the only issue is that when the URL is generated, it contains the username and token in the URL.

https://binderhub.example.com/v2/git/https%3A%2F%2Foyamin%3Atoken%40gitlab.example.cloud%2Foyamin%2Fbinder-test-repo/main

I tried to add to secrets.yaml:

config:
  GitRepoProvider:
    git_credentials: <token>

But that didn't work either.

Please let me know if there is any way to hide the token from the BinderHub URL.