zokugun / vscode-vsix-manager

Install extensions from your own sources
MIT License
17 stars 4 forks source link

Private github repositories? #13

Open natdm opened 1 year ago

natdm commented 1 year ago

It doesn't look like this code is set to look at private github repos, no spot for an auth token or parsing of an environmental variable for it. Is there a way to do this?

daiyam commented 1 year ago

Yes, the token would need to be given (https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28) But where to stock it? I don't think in settings.json would be good choice... Maybe in an env variable or in a file?? "token": "env:MY_TOKEN" or "token": "file:~/mytoken.txt"?

natdm commented 1 year ago

Agreed, I've got them in env vars now, so a setting to point to an env var would be a good idea. That's probably a pretty common usecase.

GitMensch commented 11 months ago

@daiyam Any idea about an implementation as outlined?

daiyam commented 11 months ago

We will need to add a new source type (GitHub) to have something like

"vsix.sources": {
    "mgh": {
        "type": "github",
        "repository": "<username>",
        "token": "env:MY_TOKEN",
    },
},
"vsix.extensions": [
        "mgh:<project>",
    ],
GitMensch commented 11 months ago

Sounds good, I'd suggest to go with vscode's ${env:MY_TOKEN} and support ${env:name} also in the repository, serviceUrl and path properties