From 62da287c77585c367dcefb0e1895b2c64db66aec Mon Sep 17 00:00:00 2001 From: Alain Jobart Date: Tue, 1 Sep 2015 08:42:08 -0700 Subject: [PATCH] Not authorizing any bson protocol by default. --- go/cmd/vtctld/vtctld.go | 1 - go/cmd/vtgate/vtgate.go | 2 -- go/cmd/vtocc/vtocc.go | 1 - go/cmd/vttablet/vttablet.go | 3 --- go/vt/servenv/service_map.go | 9 --------- test/gorpc_protocols_flavor.py | 9 +++++++-- test/grpc_protocols_flavor.py | 4 ++-- 7 files changed, 9 insertions(+), 20 deletions(-) diff --git a/go/cmd/vtctld/vtctld.go b/go/cmd/vtctld/vtctld.go index f9f5e70509..f39cc6c22e 100644 --- a/go/cmd/vtctld/vtctld.go +++ b/go/cmd/vtctld/vtctld.go @@ -36,7 +36,6 @@ var ( func init() { servenv.RegisterDefaultFlags() - servenv.InitServiceMapForBsonRpcService("vtctl") } func httpErrorf(w http.ResponseWriter, r *http.Request, format string, args ...interface{}) { diff --git a/go/cmd/vtgate/vtgate.go b/go/cmd/vtgate/vtgate.go index 5e9f7ff0c4..c9d05fcfb1 100644 --- a/go/cmd/vtgate/vtgate.go +++ b/go/cmd/vtgate/vtgate.go @@ -35,8 +35,6 @@ var initFakeZK func() func init() { servenv.RegisterDefaultFlags() - servenv.InitServiceMapForBsonRpcService("toporeader") - servenv.InitServiceMapForBsonRpcService("vtgateservice") } func main() { diff --git a/go/cmd/vtocc/vtocc.go b/go/cmd/vtocc/vtocc.go index 67d4aa9715..819f70505f 100644 --- a/go/cmd/vtocc/vtocc.go +++ b/go/cmd/vtocc/vtocc.go @@ -38,7 +38,6 @@ var schemaOverrides []tabletserver.SchemaOverride func init() { servenv.RegisterDefaultFlags() - servenv.InitServiceMapForBsonRpcService("queryservice") } func main() { diff --git a/go/cmd/vttablet/vttablet.go b/go/cmd/vttablet/vttablet.go index bfe4994082..82c477808f 100644 --- a/go/cmd/vttablet/vttablet.go +++ b/go/cmd/vttablet/vttablet.go @@ -42,9 +42,6 @@ var ( func init() { servenv.RegisterDefaultFlags() - servenv.InitServiceMapForBsonRpcService("tabletmanager") - servenv.InitServiceMapForBsonRpcService("queryservice") - servenv.InitServiceMapForBsonRpcService("updatestream") } func main() { diff --git a/go/vt/servenv/service_map.go b/go/vt/servenv/service_map.go index de97d64c4b..2a80a473e8 100644 --- a/go/vt/servenv/service_map.go +++ b/go/vt/servenv/service_map.go @@ -35,15 +35,6 @@ func InitServiceMap(protocol, name string) { serviceMap[protocol+"-"+name] = true } -// InitServiceMapForBsonRpcService will set the default entries for a -// bson rpc to serve the service. -func InitServiceMapForBsonRpcService(name string) { - serviceMap["bsonrpc-vt-"+name] = true - serviceMap["bsonrpc-auth-vt-"+name] = true - serviceMap["bsonrpc-unix-"+name] = true - serviceMap["bsonrpc-auth-unix-"+name] = true -} - // updateServiceMap takes the command line parameter, and updates the // ServiceMap accordingly func updateServiceMap() { diff --git a/test/gorpc_protocols_flavor.py b/test/gorpc_protocols_flavor.py index 43adbf71bb..0d441c671f 100644 --- a/test/gorpc_protocols_flavor.py +++ b/test/gorpc_protocols_flavor.py @@ -43,10 +43,15 @@ class GoRpcProtocolsFlavor(protocols_flavor.ProtocolsFlavor): def service_map(self): return [ + 'bsonrpc-auth-vt-queryservice', + 'bsonrpc-vt-queryservice', + 'bsonrpc-vt-tabletmanager', + 'bsonrpc-vt-toporeader', + 'bsonrpc-vt-updatestream', + 'bsonrpc-vt-vtctl', + 'bsonrpc-vt-vtgateservice', 'grpc-vtworker', 'grpc-queryservice', - # enabled for vtgate_python_protocol - 'bsonrpc-vt-vtgateservice', ] protocols_flavor.register_flavor('gorpc', GoRpcProtocolsFlavor) diff --git a/test/grpc_protocols_flavor.py b/test/grpc_protocols_flavor.py index 09375f58c3..7ff3b327bd 100644 --- a/test/grpc_protocols_flavor.py +++ b/test/grpc_protocols_flavor.py @@ -41,14 +41,14 @@ class GRpcProtocolsFlavor(protocols_flavor.ProtocolsFlavor): def service_map(self): return [ + 'bsonrpc-vt-toporeader', + 'bsonrpc-vt-vtgateservice', 'grpc-queryservice', 'grpc-updatestream', 'grpc-vtctl', 'grpc-vtworker', 'grpc-tabletmanager', 'grpc-vtgateservice', - # enabled for vtgate_python_protocol - 'bsonrpc-vt-vtgateservice', ]