veyron2/security: Make ThirdPartyRequirements a VDL type.

Motivation: For inter-language interoperability, the wire representation
of a ThirdPartyCaveat and a Discharge need to be specified in VDL. This requires
that ThirdPartyRequirements (a component of ThirdPartyCaveat) be specified in VDL.

While at it, also changed DischargeImpetus to report the blessings held by
the server, as seen by the client, instead of shipping the whole PublicID
(i.e., blessings with cryptographic proof). This saves space and also allows
the discharger to see the server blessings from the client's perspective.

Change-Id: I7797b97d824e64f27bdcbcb260a44a7a4dbf6a18
diff --git a/runtimes/google/ipc/discharges.go b/runtimes/google/ipc/discharges.go
index eac483e..469af65 100644
--- a/runtimes/google/ipc/discharges.go
+++ b/runtimes/google/ipc/discharges.go
@@ -162,7 +162,11 @@
 
 func impetus(r security.ThirdPartyRequirements, server security.PublicID, method string, args []interface{}) (impetus security.DischargeImpetus) {
 	if r.ReportServer {
-		impetus.Server = server
+		names := server.Names()
+		impetus.Server = make([]security.BlessingPattern, len(names))
+		for i, n := range names {
+			impetus.Server[i] = security.BlessingPattern(n)
+		}
 	}
 	if r.ReportMethod {
 		impetus.Method = method
diff --git a/runtimes/google/ipc/full_test.go b/runtimes/google/ipc/full_test.go
index 05e94ea..8440189 100644
--- a/runtimes/google/ipc/full_test.go
+++ b/runtimes/google/ipc/full_test.go
@@ -592,6 +592,14 @@
 	return nil, fmt.Errorf("discharges not issued")
 }
 
+func names2patterns(names []string) []security.BlessingPattern {
+	ret := make([]security.BlessingPattern, len(names))
+	for idx, n := range names {
+		ret[idx] = security.BlessingPattern(n)
+	}
+	return ret
+}
+
 func TestDischargeImpetus(t *testing.T) {
 	var (
 		// The Discharge service can be run by anyone, but in these tests it is the same as the server.
@@ -632,7 +640,7 @@
 		},
 		{ // Require everything
 			Requirements: security.ThirdPartyRequirements{ReportServer: true, ReportMethod: true, ReportArguments: true},
-			Impetus:      security.DischargeImpetus{Server: vdlutil.Any(serverID.PublicID()), Method: "Method", Arguments: []vdlutil.Any{vdlutil.Any("argument")}},
+			Impetus:      security.DischargeImpetus{Server: names2patterns(serverID.PublicID().Names()), Method: "Method", Arguments: []vdlutil.Any{vdlutil.Any("argument")}},
 		},
 		{ // Require only the method name
 			Requirements: security.ThirdPartyRequirements{ReportMethod: true},