summaryrefslogtreecommitdiff
path: root/go/internal/command/command.go
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-09-24 15:31:39 +0000
committerNick Thomas <nick@gitlab.com>2019-09-24 15:31:39 +0000
commit659ad7f7cedab56ff48abe4d6fb8eb25a644a2a8 (patch)
tree6b23eff8993050c82e4fd472a846591e1773909c /go/internal/command/command.go
parente9481821f14b894b9d1752161b0c3c4d2679b55e (diff)
parent9237ac094a060dbb31c1ee4d37ad7ef38e17e878 (diff)
downloadgitlab-shell-659ad7f7cedab56ff48abe4d6fb8eb25a644a2a8.tar.gz
Merge branch '173-remove-go-fallback-and-feature-flags' into 'master'
Remove feature flags and the fallback command See merge request gitlab-org/gitlab-shell!336
Diffstat (limited to 'go/internal/command/command.go')
-rw-r--r--go/internal/command/command.go16
1 files changed, 2 insertions, 14 deletions
diff --git a/go/internal/command/command.go b/go/internal/command/command.go
index 071cd1d..40d92e0 100644
--- a/go/internal/command/command.go
+++ b/go/internal/command/command.go
@@ -5,10 +5,10 @@ import (
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/authorizedprincipals"
"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"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/lfsauthenticate"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/receivepack"
+ "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/shared/disallowedcommand"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/twofactorrecover"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/uploadarchive"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/uploadpack"
@@ -30,7 +30,7 @@ func New(e *executable.Executable, arguments []string, config *config.Config, re
return cmd, nil
}
- return &fallback.Command{Executable: e, RootDir: config.RootDir, Args: args}, nil
+ return nil, disallowedcommand.Error
}
func buildCommand(e *executable.Executable, args commandargs.CommandArgs, config *config.Config, readWriter *readwriter.ReadWriter) Command {
@@ -47,10 +47,6 @@ func buildCommand(e *executable.Executable, args commandargs.CommandArgs, config
}
func buildShellCommand(args *commandargs.Shell, config *config.Config, readWriter *readwriter.ReadWriter) Command {
- if !config.FeatureEnabled(string(args.CommandType)) {
- return nil
- }
-
switch args.CommandType {
case commandargs.Discover:
return &discover.Command{Config: config, Args: args, ReadWriter: readWriter}
@@ -70,17 +66,9 @@ func buildShellCommand(args *commandargs.Shell, config *config.Config, readWrite
}
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}
}
func buildAuthorizedPrincipalsCommand(args *commandargs.AuthorizedPrincipals, config *config.Config, readWriter *readwriter.ReadWriter) Command {
- if !config.FeatureEnabled(executable.AuthorizedPrincipalsCheck) {
- return nil
- }
-
return &authorizedprincipals.Command{Config: config, Args: args, ReadWriter: readWriter}
}