diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-08-09 01:14:28 +0000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2019-08-09 01:14:28 +0000 |
commit | 4812f6478771a6d261eb4a5c3aa4b450333fbf00 (patch) | |
tree | dc01da9252c0acd37966fb53f10a1adbf5e0adf6 /go/internal/command/command.go | |
parent | c577eb9ed8bd0336870f7a83302f70821d510169 (diff) | |
parent | 570ad65f9f4567428ee5214a470a1f97146d58c8 (diff) | |
download | gitlab-shell-4812f6478771a6d261eb4a5c3aa4b450333fbf00.tar.gz |
Merge branch '181-authorized-keys-check-go' into 'master'
Implement AuthorizedKeys command
See merge request gitlab-org/gitlab-shell!321
Diffstat (limited to 'go/internal/command/command.go')
-rw-r--r-- | go/internal/command/command.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/go/internal/command/command.go b/go/internal/command/command.go index 27378aa..d6b96f1 100644 --- a/go/internal/command/command.go +++ b/go/internal/command/command.go @@ -1,6 +1,7 @@ package command import ( + "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/authorizedkeys" "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/commandargs" "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/discover" "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/fallback" @@ -35,6 +36,8 @@ func buildCommand(e *executable.Executable, args commandargs.CommandArgs, config switch e.Name { case executable.GitlabShell: return buildShellCommand(args.(*commandargs.Shell), config, readWriter) + case executable.AuthorizedKeysCheck: + return buildAuthorizedKeysCommand(args.(*commandargs.AuthorizedKeys), config, readWriter) } return nil @@ -62,3 +65,11 @@ func buildShellCommand(args *commandargs.Shell, config *config.Config, readWrite return nil } + +func buildAuthorizedKeysCommand(args *commandargs.AuthorizedKeys, config *config.Config, readWriter *readwriter.ReadWriter) Command { + if !config.FeatureEnabled(executable.AuthorizedKeysCheck) { + return nil + } + + return &authorizedkeys.Command{Config: config, Args: args, ReadWriter: readWriter} +} |