summaryrefslogtreecommitdiff
path: root/go
Commit message (Collapse)AuthorAgeFilesLines
* Replace symlinks with actual binariesPatrick Bajao2019-08-155-5/+97
| | | | | | | | | | | | | | | | | | | We had `gitlab-shell-authorized-keys-check` and `gitlab-shell-authorized-principals-check` as symlinks to `gitlab-shell` before. We determine the `Command` and `CommandArgs` that we build based on the `Name` of the `Executable`. We also use that to know which fallback ruby executable should we fallback to. We use `os.Executable()` to do that. `os.Executable()` behaves differently depending on OS. It may return the symlink or the target's name. That can result to a buggy behavior. The fix is to create binaries for each instead of using a symlink. That way we don't need to rely on `os.Executable()` to get the name. We pass the `Name` of the executable instead.
* Implement AuthorizedPrincipals command181-authorized-principals-check-goPatrick Bajao2019-08-099-4/+235
| | | | | | Build this command when `Executable` name is `gitlab-shell-authorized-principals-check`. Feature flag is the same name.
* Implement AuthorizedKeys command181-authorized-keys-check-goPatrick Bajao2019-08-0812-2/+532
| | | | | | Build this command when `Executable` name is `gitlab-shell-authorized-keys-check`. Feature flag is the same name.
* Add Executable struct181-migrate-gitlab-shell-checks-fallbackPatrick Bajao2019-08-0212-176/+356
| | | | | | | | | | This struct is responsible for determining the name and root dir of the executable. The `RootDir` property will be used to find the config. The `Name` property will be used to determine what `Command` and `CommandArgs` to be built.
* Rename CommandArgs to ShellPatrick Bajao2019-07-3125-58/+58
| | | | | | Other functions are still expecting for `CommandArgs` instead of `Shell`. They should be expecting `commandargs.Shell` now since it has been renamed.
* Support different CommandArgs typePatrick Bajao2019-07-318-156/+238
| | | | | | | | `CommandArgs` has been renamed to `Shell`. An interface has been added that includes `Executable()` and `Arguments()` method. The `BaseArgs` implement this methods and should be embeeded in each type.
* Support falling back to ruby version of checkersPatrick Bajao2019-07-297-57/+101
| | | | | | | | | | | | | | Rename the ruby scripts to have `-ruby` suffix and add a symlink for both to `./gitlab-shell`. The executable name will be used to determine how args will be parsed. For now, we only parse the arguments for gitlab-shell commands. If the executable is `gitlab-shell-authorized-keys-check` or `gitlab-shell-authorized-principals-check`, it'll always fallback to the ruby version. Ruby specs test the ruby script, the fallback from go to ruby and go implementation of both (still pending).
* Go implementation for LFS authenticateIgor2019-06-068-0/+464
|
* Go implementation for git-upload-archiveIgor2019-06-059-0/+171
|
* Respect GITLAB_SHELL_DIR in the Go versionNick Thomas2019-06-041-0/+4
|
* Go implementation for git-upload-packIgor2019-06-0316-48/+213
|
* Return Fallback cmd if feature is enabled, but unimplementedIgor2019-06-032-11/+20
|
* Go implementation for git-receive-packIgor2019-05-3136-102/+1554
|
* Introduce gitlabnet.ParseJSON to DRYIgor Drozdov2019-05-224-60/+48
|
* Pass readWriter to Command constructorIgor Drozdov2019-05-209-40/+52
|
* Support calling internal API using HTTPSIgor2019-05-0110-16/+263
|
* Support calling internal api using HTTPIgor2019-04-2415-140/+348
|
* Pass the root directory into the fallback commandNick Thomas2019-04-124-12/+99
|
* Correctly determine the root directory for gitlab-shellNick Thomas2019-04-121-11/+24
| | | | Credit to https://gitlab.com/ejiek for spotting this one.
* Provide go implementation for 2fa_recovery_codes commandIgor2019-03-2117-46/+622
|
* Better testing for JSON deserialisationan-improve-test-coverageAndrew Newdigate2019-03-183-0/+177
| | | | | | | | Adds tests to ensure that JSON deserialisation from program arguments takes place. This was a testing blind spot, which led to a brief regression: https://gitlab.com/gitlab-org/gitlab-shell/merge_requests/280
* Wrap Stderr & Stdout in a reporter structBob Van Landuyt2019-03-158-37/+96
| | | | | The reporter struct can be used for passing around and reporting to the io.Writer of choice.
* Detect user based on key, username or idBob Van Landuyt2019-03-148-1/+634
| | | | | | | | | | | | | | | | | | This allows gitlab-shell to be called with an argument of the format `key-123` or `username-name`. When called in this way, `gitlab-shell` will call the GitLab internal API. If the API responds with user information, it will print a welcome message including the username. If the API responds with a successful but empty response, gitlab-shell will print a welcome message for an anonymous user. If the API response includes an error message in JSON, this message will be printed to stderr. If the API call fails, an error message including the status code will be printed to stderr.
* Get secret from configBob Van Landuyt2019-03-138-87/+182
| | | | | | | | | | | This adds parsing if the `secret_file` from YAML. And reads the contents of the configured file. If no file is configured, we fall back to the `.gitlab_shell_secret` in the root dir of the configuration. If the configured path does not start with a `/` we start looking for the file relative to the root dir of the configuration.
* Vendor otiai10/copyBob Van Landuyt2019-03-136-0/+161
|
* Fix unmarshalling JSON from the command lineNick Thomas2019-03-063-3/+3
|
* Adds distributed tracing instrumentation to GitLab-Shellan-distributed-tracingAndrew Newdigate2019-03-0111-223/+322
| | | | Adds distributed tracing instrumentation to GitLab-Shell using LabKit
* Add testify/require to vendored packagesAndrew Newdigate2019-02-268-0/+2274
|
* Vendor LabKit into GitLab-ShellAndrew Newdigate2019-02-25120-0/+16304
| | | | Done using `govendor fetch -v gitlab.com/gitlab-org/labkit/...@master`
* Bump gitaly-proto to v1.10.0sh-bump-gitaly-protoStan Hu2019-02-128-539/+1009
| | | | | This is done to ensure we don't run into unknown fields as we saw in https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/364.
* Don't fall back to ruby for non SSH connectionsbvl-feature-flag-commandsBob Van Landuyt2019-01-152-7/+6
| | | | | When SSH_CONNECTION is not set, we don't fall back to ruby, but instead fail directly in go writing the error to stderr.
* Allow enabling gitlab-shell "discover"-featureBob Van Landuyt2019-01-1510-17/+425
| | | | | | | | | | | | | | | | | | | This adds the possibility to enable features for GitLab shell. The first feature being recognized is "Discover": It's the command that is executed when running `ssh git@gitlab.example.com` and is called without a command. The gitlab key id or username is already parsed from the command line arguments. Currently we only support communicating with GitLab-rails using unix sockets. So features will not be enabled if the GitLab-url is using a different protocol. The url for this read from the config yaml. Pending ruby-specs have been added for the gitlab-shell command. Refactor to have separate command packages
* Vendor testifyBob Van Landuyt2019-01-1448-0/+11112
| | | | Add testify as test helpers
* Remove unused vendored coderemove-gitaly-proto-helperJacob Vosmaer2018-12-173-84/+0
|
* Vendor updatesAndrew Newdigate2018-12-11373-33426/+81807
|
* Revert "Merge branch 'zj-rename-gitalypb' into 'master'"revert-0662bdd1Zeger-Jan van de Weg2018-12-0741-2530/+2243
| | | This reverts merge request !262
* Upgrade gitaly Client dependencyZeger-Jan van de Weg2018-12-0641-2243/+2530
| | | | | The client now has TLS support. So this gets pulled into this component. To make it work, we have to upgrade the proto too.
* Use Gitaly's v2 auth schemegitaly-auth-v2Alejandro Rodríguez2018-10-0926-6/+1954
|
* Allow the config directory to be specifiedNick Thomas2018-09-283-17/+31
|
* Specify a richer scheme to run the migration withNick Thomas2018-09-283-26/+54
|
* Initial feature-flagged go/ruby switchNick Thomas2018-09-283-6/+49
|
* Pass custom git_config_options to GitalyoRubén Dávila2018-08-077-273/+457
| | | | | The /api/internal/allowed endpoint on GitLab has been updated to return some custom git options that can be used with git commands, we need to pass these received options to Gitaly.
* Update gitaly-proto to 0.109.0James Lopez2018-07-2716-715/+3151
|
* Add script to update vendored go libsJacob Vosmaer (GitLab)2018-07-241-0/+12
|
* Add Gitaly git-upload-archive migrated commandgitaly-upload-archiveAlejandro Rodríguez2018-03-2018-666/+2397
|
* Switch to structured loggingJacob Vosmaer (GitLab)2018-03-193-23/+46
|
* Vendor logrus at v1.0.5add-logrusJacob Vosmaer2018-03-13266-0/+153518
|
* Update gitaly-proto and gitaly libsJacob Vosmaer (GitLab)2018-01-1821-480/+8485
|
* Use grpc-go 1.9.1grpc-go-1.9.1Jacob Vosmaer2018-01-1885-3557/+11819
|
* Bump gitaly-proto to v0.23.0sh-bump-gitaly-proto-23-0Stan Hu2017-07-296-142/+431
|