Skip to content

[Feat]: Accept Multiple GITHUB_TOKEN #6199

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

Closed
rlizzo opened this issue May 9, 2023 · 4 comments
Closed

[Feat]: Accept Multiple GITHUB_TOKEN #6199

rlizzo opened this issue May 9, 2023 · 4 comments
Labels
enhancement Some improvement that isn't a feature upstream:vscode Needs to be fixed upstream in VSCode

Comments

@rlizzo
Copy link

rlizzo commented May 9, 2023

What is your suggestion?

I would like to be able to pass multiple tokens via the GITHUB_TOKEN environment variable.

Why do you want this feature?

GitHub tokens need to match the expected scopes for a package to authenticate to it. While the code server GITHUB_TOKEN env var allows us to inject a single token, if we have multiple packages we want to authenticate, but which require different token scopes, we can't inject multiple tokens via this method.

Are there any workarounds to get this functionality today?

Not that I am aware of. It would be good to create a mapping of all scopes (not just order of permissions, but inclusion of permissions) -> a single token which grants such scopes.

Are you interested in submitting a PR for this?

Yes.

@rlizzo rlizzo added the enhancement Some improvement that isn't a feature label May 9, 2023
@code-asher
Copy link
Member

Makes sense to me, we can make --github-auth take a string array and delimit GITHUB_TOKEN with semicolons or something.

@rlizzo
Copy link
Author

rlizzo commented May 11, 2023

any pointers on where to get started @code-asher? I assume src/node/cli.ts and patches/github-auth.diff? any other areas i might need to pay attention to?

@code-asher
Copy link
Member

Yup exactly. You would have to update the tests in test/unit/node/cli.test.ts as well but I think those are all the files you would need to touch.

One interesting question is what to do if both GITHUB_TOKEN and --github-auth are set. We could merge them although I think having the CLI flag override the env var is probably more in keeping with how the other flags work.

@code-asher
Copy link
Member

Closing for now, as this will require patching VS Code and it probably makes more sense to make the change there directly.

@code-asher code-asher closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2024
@code-asher code-asher added the upstream:vscode Needs to be fixed upstream in VSCode label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature upstream:vscode Needs to be fixed upstream in VSCode
Projects
None yet
Development

No branches or pull requests

2 participants