summaryrefslogtreecommitdiff
path: root/internal/gitlabnet
Commit message (Collapse)AuthorAgeFilesLines
* tests: Replace assert with requirezj-remove-testify-assertZeger-Jan van de Weg2020-10-153-25/+22
| | | | | | | | | Testify features sub packages `assert` and `require`. The difference is subtle, and lost on novice Golang developers that don't read the docs. To create a more consistent code base `assert` will no longer be used. This change was generated by a running a sed command on all `_test.go` files, followed by `goimports -w`.
* Make it possible to propagate correlation ID across processesStan Hu2020-09-2014-43/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, gitlab-shell did not pass a context through the application. Correlation IDs were generated down the call stack instead of passed around from the start execution. This has several potential downsides: 1. It's easier for programming mistakes to be made in future that lead to multiple correlation IDs being generated for a single request. 2. Correlation IDs cannot be passed in from upstream requests 3. Other advantages of context passing, such as distributed tracing is not possible. This commit changes the behavior: 1. Extract the correlation ID from the environment at the start of the application. 2. If no correlation ID exists, generate a random one. 3. Pass the correlation ID to the GitLabNet API requests. This change also enables other clients of GitLabNet (e.g. Gitaly) to pass along the correlation ID in the internal API requests (https://gitlab.com/gitlab-org/gitaly/-/issues/2725). Fixes https://gitlab.com/gitlab-org/gitlab-shell/-/issues/474
* Add support obtaining personal access tokens via SSHTaylan Develioglu2020-08-172-0/+270
| | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* Generate and log correlation IDsStan Hu2020-07-311-0/+3
| | | | | This will make it easier to tie an SSH access request to Rails API and Gitaly requests.
* Log SSH key detailsStan Hu2020-07-231-0/+2
| | | | | | | | | | | | | | | | | | | | | Right now when a client such as gitlab-shell calls the `/api/v4/internal/allowed` API, the response only tells the client what user has been granted access, and it's impossible to tell which deploy key/token was used in the authentication request. This commit adds logs for the following when available: 1. `gl_key_type` (e.g. `deploy_key` or `key`) 2. `gl_key_id` These fields make it possible for admins to identify the exact record that was used to authenticate the user. API changes in the `/internal/allowed` endpoint in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37289 are needed to support this. Relates to https://gitlab.com/gitlab-org/gitlab-shell/-/issues/203
* Ensure we are passing the parsed secretDJ Mountney2020-05-061-1/+1
| | | | | | | | Rather than the secret file. The parsing of the file was already done in the gitlab-shell config. This fixes an issue where a recent refactor of the gitlabnet client passed the wrong value.
* Move gitlabnet client to client packagejc-refactor-gitlabnet-clientJohn Cai2020-05-0418-778/+33
|
* Geo Pull custom action supportAsh McKenzie2020-04-171-1/+25
|
* Allow allowedPayloadPath to be providedAsh McKenzie2020-04-171-7/+11
|
* Rename Geo Push custom action testAsh McKenzie2020-04-171-1/+1
|
* Rename action to be more accurateAsh McKenzie2020-04-171-5/+5
|
* Rename allowed payload JSON for accuracyAsh McKenzie2020-04-171-1/+1
|
* Log internal HTTP requestsStan Hu2020-03-102-0/+41
| | | | | | | This restores the previous behavior of logging the success and failures of internal HTTP requests. Part of https://gitlab.com/gitlab-org/gitlab/issues/207916
* Remove support for Custom data.info_message210-remove-action-custom-inform_client-once-12-3-has-been-releasedAsh McKenzie2019-12-242-2/+0
|
* Use correct LFS download or upload operation namesAsh McKenzie2019-12-032-26/+44
|
* Merge branch 'pass-ff-to-gitaly' into 'master'Ash McKenzie2019-10-292-10/+19
| | | | | Add support for Gitaly feature flags See merge request gitlab-org/gitlab-shell!351
* Rename import pathsNick Thomas2019-10-1817-49/+49
|
* Move go code up one levelNick Thomas2019-10-1818-0/+1966