cmd/keyserver-gcp: remove test user flags

There's no need for the test user flags in the GCP version of keyserver.
They should not have been included in the first place.

Change-Id: I4e16767ce4b3af730bc6d8bbba79b0cd9c08a503
Reviewed-on: https://upspin-review.googlesource.com/11520
Reviewed-by: Rob Pike <r@golang.org>
diff --git a/cmd/keyserver-gcp/main.go b/cmd/keyserver-gcp/main.go
index a449452..814e787 100644
--- a/cmd/keyserver-gcp/main.go
+++ b/cmd/keyserver-gcp/main.go
@@ -8,15 +8,11 @@
 
 import (
 	"flag"
-	"net"
 
 	cloudLog "gcp.upspin.io/cloud/log"
-	"upspin.io/factotum"
-	"upspin.io/flags"
 	"upspin.io/log"
 	"upspin.io/metric"
 	"upspin.io/serverutil/keyserver"
-	"upspin.io/upspin"
 
 	"gcp.upspin.io/cloud/gcpmetric"
 	"gcp.upspin.io/cloud/https"
@@ -41,15 +37,10 @@
 	metricMaxQPS = 5
 )
 
-var (
-	testUser    = flag.String("test_user", "", "initialize a test `user` (localhost, inprocess only)")
-	testSecrets = flag.String("test_secrets", "", "initialize test user with the secrets in this `directory`")
-)
-
 func main() {
 	project := flag.String("project", "", "GCP `project` name")
 
-	keyserver.Main(setupTestUser)
+	keyserver.Main(nil)
 
 	if *project != "" {
 		cloudLog.Connect(*project, serverName)
@@ -65,53 +56,3 @@
 
 	https.ListenAndServe(nil, serverName)
 }
-
-// isLocal returns true if the name only resolves to loopback addresses.
-func isLocal(addr string) bool {
-	host, _, err := net.SplitHostPort(addr)
-	if err != nil {
-		return false
-	}
-	ips, err := net.LookupIP(host)
-	if err != nil {
-		return false
-	}
-	for _, ip := range ips {
-		if !ip.IsLoopback() {
-			return false
-		}
-	}
-	return true
-}
-
-// setupTestUser uses the -test_user and -test_secrets flags to bootstrap the
-// inprocess key server with an initial user.
-func setupTestUser(key upspin.KeyServer) {
-	if *testUser == "" {
-		return
-	}
-	if *testSecrets == "" {
-		log.Fatalf("cannot set up a test user without specifying -test_secrets")
-	}
-
-	// Sanity checks to make sure we're not doing this in production.
-	if key.Endpoint().Transport != upspin.InProcess {
-		log.Fatalf("cannot use testuser for endpoint %q", key.Endpoint())
-	}
-	if !isLocal(flags.HTTPSAddr) {
-		log.Fatal("cannot use -testuser flag except on localhost:port")
-	}
-
-	f, err := factotum.NewFromDir(*testSecrets)
-	if err != nil {
-		log.Fatalf("unable to initialize factotum for %q: %v", *testUser, err)
-	}
-	userStruct := &upspin.User{
-		Name:      upspin.UserName(*testUser),
-		PublicKey: f.PublicKey(),
-	}
-	err = key.Put(userStruct)
-	if err != nil {
-		log.Fatalf("Put %q failed: %v", *testUser, err)
-	}
-}