Skip to content

Commit b5f26a0

Browse files
author
Srinivasan Muralidharan
committed
[FAB-5150] remove bin data from install error
Authorization error contains bin data (package) which is useless for error reporting and would get in the way of SDKs and other tools's reporting. This CR removes the bin data. Further we don't want to peek into the data on auth. failure and so will _not_ attempt to read the package to enhance the reported error. . patch 2 fixed lscc unit test to look for right error string Change-Id: Ic55eba8d890aa2489488fdbd54d4ccc3a8483fed Signed-off-by: Srinivasan Muralidharan <muralisr@us.ibm.com>
1 parent bdd4a96 commit b5f26a0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/scc/lscc/lscc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ func (lscc *LifeCycleSysCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response
721721

722722
// 2. check local MSP Admins policy
723723
if err = lscc.policyChecker.CheckPolicyNoChannel(mgmt.Admins, sp); err != nil {
724-
return shim.Error(fmt.Sprintf("Authorization for INSTALL on %s has been denied with error %s", args[1], err))
724+
return shim.Error(fmt.Sprintf("Authorization for INSTALL has been denied (error-%s)", err))
725725
}
726726

727727
depSpec := args[1]

core/scc/lscc/lscc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func TestInstall(t *testing.T) {
8686
testInstall(t, "example02.go", "0", path, InvalidChaincodeNameErr("example02.go").Error(), "Alice")
8787
testInstall(t, "", "0", path, EmptyChaincodeNameErr("").Error(), "Alice")
8888
testInstall(t, "example02", "1{}0", path, InvalidVersionErr("1{}0").Error(), "Alice")
89-
testInstall(t, "example02", "0", path, "Authorization for INSTALL on", "Bob")
89+
testInstall(t, "example02", "0", path, "Authorization for INSTALL has been denied", "Bob")
9090
}
9191

9292
func testInstall(t *testing.T, ccname string, version string, path string, expectedErrorMsg string, caller string) {

0 commit comments

Comments
 (0)