diff options
author | Taylan Develioglu <taylan.develioglu@booking.com> | 2020-07-06 14:09:55 +0200 |
---|---|---|
committer | Taylan Develioglu <taylan.develioglu@booking.com> | 2020-08-17 17:16:06 +0200 |
commit | b8d66d7923150402f54f13d793d3051efab3a832 (patch) | |
tree | dd67dbef7c4c06e3a1ac5cf981be9ee37d355a03 /internal/command/commandargs/shell.go | |
parent | 4b1ee791a1bdc927becee37ae84f7ba226d17791 (diff) | |
download | gitlab-shell-b8d66d7923150402f54f13d793d3051efab3a832.tar.gz |
Add support obtaining personal access tokens via SSH
Implements the feature requested in gitlab-org/gitlab#19672
This requires the internal api counterpart in gitlab-org/gitlab!36302 to
be merged first.
It can be used as follows:
```
censored@censored-VirtualBox:~/git/gitlab$ ssh git@gitlab-2004 personal_access_token
remote:
remote: ========================================================================
remote:
remote: Usage: personal_access_token <name> <scope1[,scope2,...]> [ttl_days]
remote:
remote: ========================================================================
remote:
censored@censored-VirtualBox:~/git/gitlab$ ssh git@gitlab-2004 personal_access_token newtoken read_api,read_repository 30
Token: aAY1G3YPeemECgUvxuXY
Scopes: read_api,read_repository
Expires: 2020-08-07
```
Diffstat (limited to 'internal/command/commandargs/shell.go')
-rw-r--r-- | internal/command/commandargs/shell.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/internal/command/commandargs/shell.go b/internal/command/commandargs/shell.go index 1fe59fb..4632cff 100644 --- a/internal/command/commandargs/shell.go +++ b/internal/command/commandargs/shell.go @@ -9,12 +9,13 @@ import ( ) const ( - Discover CommandType = "discover" - TwoFactorRecover CommandType = "2fa_recovery_codes" - LfsAuthenticate CommandType = "git-lfs-authenticate" - ReceivePack CommandType = "git-receive-pack" - UploadPack CommandType = "git-upload-pack" - UploadArchive CommandType = "git-upload-archive" + Discover CommandType = "discover" + TwoFactorRecover CommandType = "2fa_recovery_codes" + LfsAuthenticate CommandType = "git-lfs-authenticate" + ReceivePack CommandType = "git-receive-pack" + UploadPack CommandType = "git-upload-pack" + UploadArchive CommandType = "git-upload-archive" + PersonalAccessToken CommandType = "personal_access_token" GitProtocolEnv = "GIT_PROTOCOL" ) |