SystemRootToken was missing in the test
[arvados.git] / lib / controller / localdb / login.go
index 61bad465ff2b6efb7653b952338772c3eff15af4..ed7938296d0e4c04524135c26e5cafb2abe127ce 100644 (file)
@@ -142,6 +142,10 @@ func noopLogout(cluster *arvados.Cluster, opts arvados.LogoutOptions) (arvados.L
 }
 
 func (conn *Conn) CreateAPIClientAuthorization(ctx context.Context, rootToken string, authinfo rpc.UserSessionAuthInfo) (resp arvados.APIClientAuthorization, err error) {
+       // rootToken is "" then complain!
+       if rootToken == "" {
+               return arvados.APIClientAuthorization{}, errors.New("In CreateAPIClientAuthorization() rootToken can't be empty string")
+       }
        ctxRoot := auth.NewContext(ctx, &auth.Credentials{Tokens: []string{rootToken}})
        newsession, err := conn.railsProxy.UserSessionCreate(ctxRoot, rpc.UserSessionCreateOptions{
                // Send a fake ReturnTo value instead of the caller's