| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Build this command when `Executable` name is
`gitlab-shell-authorized-principals-check`. Feature flag is the
same name.
|
|
|
|
|
|
| |
Build this command when `Executable` name is
`gitlab-shell-authorized-keys-check`. Feature flag is the same
name.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Other functions are still expecting for `CommandArgs` instead
of `Shell`. They should be expecting `commandargs.Shell` now
since it has been renamed.
|
|
|
|
|
|
|
|
| |
`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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Credit to https://gitlab.com/ejiek for spotting this one.
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
The reporter struct can be used for passing around and reporting to
the io.Writer of choice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
Adds distributed tracing instrumentation to GitLab-Shell using LabKit
|
| |
|
|
|
|
| |
Done using `govendor fetch -v gitlab.com/gitlab-org/labkit/...@master`
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
When SSH_CONNECTION is not set, we don't fall back to ruby, but
instead fail directly in go writing the error to stderr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Add testify as test helpers
|
| |
|
| |
|
|
|
| |
This reverts merge request !262
|
|
|
|
|
| |
The client now has TLS support. So this gets pulled into this component.
To make it work, we have to upgrade the proto too.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|