summaryrefslogtreecommitdiff
path: root/go/internal/command/command.go
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-08-09 01:14:28 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2019-08-09 01:14:28 +0000
commit4812f6478771a6d261eb4a5c3aa4b450333fbf00 (patch)
treedc01da9252c0acd37966fb53f10a1adbf5e0adf6 /go/internal/command/command.go
parentc577eb9ed8bd0336870f7a83302f70821d510169 (diff)
parent570ad65f9f4567428ee5214a470a1f97146d58c8 (diff)
downloadgitlab-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.go11
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}
+}