https://github.com/flix-tech/gitlab-token-injector
his Go project injects JWT tokens into a secret variable of all GitLab projects that the owner of the API token belongs to.
https://github.com/flix-tech/gitlab-token-injector
Last synced: 13 days ago
JSON representation
his Go project injects JWT tokens into a secret variable of all GitLab projects that the owner of the API token belongs to.
- Host: GitHub
- URL: https://github.com/flix-tech/gitlab-token-injector
- Owner: flix-tech
- License: apache-2.0
- Created: 2017-11-28T14:03:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-28T14:44:33.000Z (over 8 years ago)
- Last Synced: 2026-07-28T09:36:45.285Z (13 days ago)
- Language: Go
- Size: 8.79 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## GitLab Token Injector
This tool injects a JWT token into a secret variable of all GitLab projects that the owner of the GitLab API token is a member of.
The GitLab user for API token needs to have the `Master` role for a project to be able to use the secret variables API.
The secret variable has the default name `K8S_TOKEN` and the generated JWT token has a default lifetime of `48h`.
### Build
```
glide install
go build
```
### Usage
```
gitlab-token-injector -host git.example.com -token MyAPIToken -key /path/to/private.key
```
The command line arguments are:
```
Required:
-host="" GitLab instance hostname
-key="" Path to a private key file
-token="" GitLab API token
Optional:
-debug=false Enable debug output
-config="": Path to a config file
-ttl=48h0m0s Token lifetime in hours
-var="KUBE_TOKEN" GitLab secret variable
```
Instead of using arguments, you can also use environment variables (using upppercase argument names) or a ini-style config file.