grimoirelab
grimoirelab copied to clipboard
How to use multiple tokens for multiple different git repository backends?
How can we use multiple tokens for different git backends?
Lets say that i have repositories remotely on github and i set a github api token using..
[github]
api-token = thisisadummytoken
This works nicely.. but if I also want to integrate repositories from local gitlab for example how can i add an additional token and get the different projects aware on what token to use??
// projects.json
{
"dummy": {
"git": [
# how can i make sure that this project uses the github token?
"https://github.com/foo",
# and this projects the gitlab token??
"https://mylocal.gitlab.com/bar"
]
}
}
Hi @mpas , private repos are not directly supported by GrimoireLab. For these cases, you should pass the credentials directly in the projects.json
"git": [
"https://<user>:<key>@github.com/myprofile/Testgit123"
],
Similar issues have been addressed in the past, please have a look at them:
- https://github.com/chaoss/grimoirelab/issues/216
- https://github.com/chaoss/grimoirelab/issues/205
- https://github.com/chaoss/grimoirelab/issues/209
Don't hesitate to ping us in case the issues above don't answer your question or feel free to close this issue.
Thanks, Valerio
@valeriocos Is there any chance that the projects file is being pre-processed or that tokens are also read via environment variables? I am looking for a way to inject the tokens via environment variables so i do need to expose them directly in the file. So something like "https://foo-user:[email protected]/myprofile/Testgit123"
I can create my own container with for example envsubst in it or do a custom pre-process step using sed but maybe there is already a mechanism in place?
It sounds like a nice feature to have. I'd say there is no mechanism in place for this at the moment, @sanacl @jgbarah any thoughts?
There is not way to do that right now. Reading secrets from env. variables would be a nice improvement for sure.