Skip to content

Commit 29de39d

Browse files
author
Jason Yellick
committed
FAB-11305 Channel v1.3 capability for idemix
Identity mixer needs new principal types and other logic which affects the way that policies are evaluated. Presently, it is gated behind a msp version v1.3, however there is no way to enable it. This CR adds a v1.3 capability and uses it to enable the new MSP functions. Change-Id: I99f5299724c4b55d3b54c6aff90a5afe46205ee6 Signed-off-by: Jason Yellick <jyellick@us.ibm.com> Signed-off-by: David Enyeart <enyeart@us.ibm.com>
1 parent f092df7 commit 29de39d

File tree

6 files changed

+26
-8
lines changed

6 files changed

+26
-8
lines changed

common/capabilities/channel.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,24 @@ const (
1616

1717
// ChannelV1_1 is the capabilties string for standard new non-backwards compatible fabric v1.1 channel capabilities.
1818
ChannelV1_1 = "V1_1"
19+
20+
// ChannelV1_3 is the capabilties string for standard new non-backwards compatible fabric v1.3 channel capabilities.
21+
ChannelV1_3 = "V1_3"
1922
)
2023

2124
// ChannelProvider provides capabilities information for channel level config.
2225
type ChannelProvider struct {
2326
*registry
2427
v11 bool
28+
v13 bool
2529
}
2630

2731
// NewChannelProvider creates a channel capabilities provider.
2832
func NewChannelProvider(capabilities map[string]*cb.Capability) *ChannelProvider {
2933
cp := &ChannelProvider{}
3034
cp.registry = newRegistry(cp, capabilities)
3135
_, cp.v11 = capabilities[ChannelV1_1]
36+
_, cp.v13 = capabilities[ChannelV1_3]
3237
return cp
3338
}
3439

@@ -41,6 +46,8 @@ func (cp *ChannelProvider) Type() string {
4146
func (cp *ChannelProvider) HasCapability(capability string) bool {
4247
switch capability {
4348
// Add new capability names here
49+
case ChannelV1_3:
50+
return true
4451
case ChannelV1_1:
4552
return true
4653
default:
@@ -51,6 +58,8 @@ func (cp *ChannelProvider) HasCapability(capability string) bool {
5158
// MSPVersion returns the level of MSP support required by this channel.
5259
func (cp *ChannelProvider) MSPVersion() msp.MSPVersion {
5360
switch {
61+
case cp.v13:
62+
return msp.MSPv1_3
5463
case cp.v11:
5564
return msp.MSPv1_1
5665
default:

common/capabilities/channel_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@ func TestChannelV11(t *testing.T) {
2828
assert.NoError(t, op.Supported())
2929
assert.True(t, op.MSPVersion() == msp.MSPv1_1)
3030
}
31+
32+
func TestChannelV13(t *testing.T) {
33+
op := NewChannelProvider(map[string]*cb.Capability{
34+
ChannelV1_1: {},
35+
ChannelV1_3: {},
36+
})
37+
assert.NoError(t, op.Supported())
38+
assert.True(t, op.MSPVersion() == msp.MSPv1_3)
39+
}

examples/e2e_cli/configtx.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ Capabilities:
159159
# Channel capabilities apply to both the orderers and the peers and must be
160160
# supported by both. Set the value of the capability to true to require it.
161161
Global: &ChannelCapabilities
162-
# V1.1 for Global is a catchall flag for behavior which has been
163-
# determined to be desired for all orderers and peers running v1.0.x,
162+
# V1.3 for Channel is a catchall flag for behavior which has been
163+
# determined to be desired for all orderers and peers running < v1.3.0,
164164
# but the modification of which would cause incompatibilities. Users
165165
# should leave this flag set to true.
166-
V1_1: true
166+
V1_3: true
167167

168168
# Orderer capabilities apply only to the orderers, and may be safely
169169
# manipulated without concern for upgrading peers. Set the value of the

integration/nwo/configtx_template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Organizations:{{ range .PeerOrgs }}
4747
4848
Channel: &ChannelDefaults
4949
Capabilities:
50-
V1_1: true
50+
V1_3: true
5151
Policies:
5252
Readers:
5353
Type: ImplicitMeta

integration/pvtdata/runner/testdata/configtx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Organizations:
2424

2525
Capabilities:
2626
Global: &ChannelCapabilities
27-
V1_1: true
27+
V1_3: true
2828
Orderer: &OrdererCapabilities
2929
V1_1: true
3030
Application: &ApplicationCapabilities

sampleconfig/configtx.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ Capabilities:
7979
# Channel capabilities apply to both the orderers and the peers and must be
8080
# supported by both. Set the value of the capability to true to require it.
8181
Channel: &ChannelCapabilities
82-
# V1.1 for Channel is a catchall flag for behavior which has been
83-
# determined to be desired for all orderers and peers running v1.0.x,
82+
# V1.3 for Channel is a catchall flag for behavior which has been
83+
# determined to be desired for all orderers and peers running < v1.3.0,
8484
# but the modification of which would cause incompatibilities. Users
8585
# should leave this flag set to true.
86-
V1_1: true
86+
V1_3: true
8787

8888
# Orderer capabilities apply only to the orderers, and may be safely
8989
# manipulated without concern for upgrading peers. Set the value of the

0 commit comments

Comments
 (0)