diff options
author | Nick Thomas <nick@gitlab.com> | 2019-09-18 17:42:19 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-09-20 11:41:38 +0100 |
commit | 9237ac094a060dbb31c1ee4d37ad7ef38e17e878 (patch) | |
tree | 78f94a4db3f94f95d17974845b37aca984227a20 /go/internal/command/command.go | |
parent | 996b2e1d44cc671cc60fd4ddacd2c5750b72a025 (diff) | |
download | gitlab-shell-9237ac094a060dbb31c1ee4d37ad7ef38e17e878.tar.gz |
Remove feature flags and the fallback command
Diffstat (limited to 'go/internal/command/command.go')
-rw-r--r-- | go/internal/command/command.go | 16 |
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} } |