From 812fa60a76c6330b2b46b6c6b545abfc8cce7eb9 Mon Sep 17 00:00:00 2001 From: Simon Stone Date: Fri, 25 Sep 2020 08:46:14 +0100 Subject: [PATCH] Add MSP ID to certificate authority information (resolves #60) (#61) Signed-off-by: Simon Stone --- internal/pkg/console/console.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/pkg/console/console.go b/internal/pkg/console/console.go index 61e6998..f64f0c1 100644 --- a/internal/pkg/console/console.go +++ b/internal/pkg/console/console.go @@ -55,6 +55,19 @@ type jsonOrderer struct { Identity string `json:"identity"` } +type jsonCA struct { + ID string `json:"id"` + DisplayName string `json:"display_name"` + Type string `json:"type"` + APIURL string `json:"api_url"` + APIOptions *jsonOptions `json:"api_options"` + OperationsURL string `json:"operations_url"` + OperationsOptions *jsonOptions `json:"operations_options"` + MSPID string `json:"msp_id"` + Wallet string `json:"wallet"` + Identity string `json:"identity"` +} + type jsonIdentity struct { ID string `json:"id"` DisplayName string `json:"display_name"` @@ -301,7 +314,7 @@ func (c *Console) getDynamicComponents(req *http.Request) components { orgName := ca.Organization().Name() lowerOrgName := strings.ToLower(orgName) id := fmt.Sprintf("%sca", lowerOrgName) - dynamicComponents[id] = &jsonPeer{ + dynamicComponents[id] = &jsonCA{ ID: id, DisplayName: fmt.Sprintf("%s CA", orgName), Type: "fabric-ca", @@ -317,6 +330,7 @@ func (c *Console) getDynamicComponents(req *http.Request) components { SSLTargetNameOverride: ca.OperationsHost(false), RequestTimeout: 300 * 1000, }, + MSPID: ca.Organization().MSPID(), Identity: ca.Organization().CAAdmin().Name(), Wallet: ca.Organization().Name(), }