m/n/core/rpc: provide lower-level gRPC dialing constructs

This replaces the 2x2 cartesian product of ready-made dialing functions
(New{Authenticated,Ephemeral}Client{Test,}) with plain gRPC Dial
Options.

This is partially to reduce the magical aspect of the RPC library (after
all, we are just using gRPC here, no need for these wrappers), but
mostly in preparation for having another dimension added: dynamic
cluster resolving, which will also be just provided as a Dial Option.

Change-Id: Id051ca5204e4b44afcc10164f376ccf08af46120
Reviewed-on: https://review.monogon.dev/c/monogon/+/640
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/test/launch/cluster/cluster.go b/metropolis/test/launch/cluster/cluster.go
index 8cc0a48..cf9cd07 100644
--- a/metropolis/test/launch/cluster/cluster.go
+++ b/metropolis/test/launch/cluster/cluster.go
@@ -405,10 +405,15 @@
 
 	// Dial external service.
 	remote := fmt.Sprintf("localhost:%v", portMap[node.CuratorServicePort])
-	initClient, err := rpc.NewEphemeralClient(remote, InsecurePrivateKey, nil)
+	initCreds, err := rpc.NewEphemeralCredentials(InsecurePrivateKey, nil)
 	if err != nil {
 		ctxC()
-		return nil, fmt.Errorf("NewInitialClient: %w", err)
+		return nil, fmt.Errorf("NewEphemeralCredentials: %w", err)
+	}
+	initClient, err := grpc.Dial(remote, grpc.WithTransportCredentials(initCreds))
+	if err != nil {
+		ctxC()
+		return nil, fmt.Errorf("dialing with ephemeral credentials failed: %w", err)
 	}
 
 	// Retrieve owner certificate - this can take a while because the node is still
@@ -432,10 +437,11 @@
 	log.Printf("Cluster: retrieved owner certificate.")
 
 	// Build authenticated owner client to new node.
-	authClient, err := rpc.NewAuthenticatedClient(remote, *cert, nil)
+	authCreds := rpc.NewAuthenticatedCredentials(*cert, nil)
+	authClient, err := grpc.Dial(remote, grpc.WithTransportCredentials(authCreds))
 	if err != nil {
 		ctxC()
-		return nil, fmt.Errorf("NewAuthenticatedClient: %w", err)
+		return nil, fmt.Errorf("dialing with owner credentials failed: %w", err)
 	}
 	mgmt := apb.NewManagementClient(authClient)