Repository navigation
Allow OUs - #198
Allow OUs#198
Conversation
7b8295f to
780630f
Compare
tock-ibm
left a comment
There was a problem hiding this comment.
Automated /code-review (max effort) — 4 comment-only findings, most severe first. The key claim was checked empirically (branch built; new test run with and without the channel.go change; channelconfig/capabilities/msp/genesis/configtx/cryptogen suites green).
Headline: the new test passes identically with or without the channel.go floor, so the PR's central production change currently has no regression protection.
| }, | ||
| }, | ||
| }) | ||
| readBundle(t, block) // fails unless the generated config loads into a valid bundle. |
There was a problem hiding this comment.
The new test does not guard the channel.go floor change — the docstring's central guarantee is false.
The docstring (lines 563-564) claims a valid bundle "proves channelconfig enforces OUs regardless of capabilities, since an OU-only MSP … would otherwise be left with no admins." But SampleFabricX declares empty channel capabilities (MSPVersion = MSPv1_0), and at MSPv1_0 setupAdminsPreV142 permits zero admins and NewBundleFromEnvelope loads fine — so readBundle succeeds with or without the floor.
Verified: checking out common/channelconfig/channel.go from main and re-running leaves both subtests green. The test only asserts the bundle loads and inspects the on-disk crypto layout; it never evaluates the org Admins policy against an OU-classified admin identity (as requireSign does at line 267). So the channel.go change is effectively untested here and the claimed proof is vacuous.
Suggest asserting something that actually depends on OU enforcement (e.g. that an OU-classified admin identity satisfies the org Admins policy), so reverting the floor would fail the test.
| // declares no capabilities, while MSPs without NodeOUs keep using admincerts. | ||
| mspVersion := channelCapabilities.MSPVersion() | ||
| if mspVersion < msp.MSPv3_0 { | ||
| mspVersion = msp.MSPv3_0 |
There was a problem hiding this comment.
Flooring the MSP version to MSPv3_0 over-reaches the stated "honor OUs" goal.
NodeOU admin classification requires only MSPv1_4_3 (setupV142 / setupNodeOUsV142 / setupAdminsV142). MSPv3_0 additionally runs setupV3, which sets supportedPublicKeyAlgorithms[x509.Ed25519] = true (mspimplsetup.go:693).
By flooring to MSPv3_0, a channel that declared no capabilities (or V1_1/V1_3/V1_4_3/V2_0) now accepts Ed25519 member certificates it previously rejected — and any node still on an older library version derives MSPv1_0 for the same config block, so the two interpret identity acceptance differently. That is a determinism/fork risk during a rolling upgrade of a consumer (committer/orderer).
The minimal, on-goal change is to floor to msp.MSPv1_4_3 instead of msp.MSPv3_0.
There was a problem hiding this comment.
Put it the issue description the fact that we are never going back to ver < v3 and that we do not have an installed base, thus don't care about upgrades.
| // local MSP version) — an MSP that declares NodeOUs then enforces them even when the channel | ||
| // declares no capabilities, while MSPs without NodeOUs keep using admincerts. | ||
| mspVersion := channelCapabilities.MSPVersion() | ||
| if mspVersion < msp.MSPv3_0 { |
There was a problem hiding this comment.
Bundle-load regression for a sub-V1_4_3 channel whose org MSP has both admincerts and a NodeOUs-enabled config.yaml.
Consider an existing channel with no channel capabilities (previously MSPv1_0) whose org verifying MSP supplies admincerts and a config.yaml with NodeOUs.Enable = true whose admin certificate carries neither the client nor the admin OU.
- Before:
MSPv1_0ignores NodeOUs (setupV1,ouEnforcement = false) and the admincert authorizes admins → bundle loads. - After:
MSPv3_0setsouEnforcement = true, andpostSetupV142(mspimplsetup.go:737-743) runshasOURole(admin, CLIENT/ADMIN)on each admincert identity and returns"admin i is invalid"→NewBundleFromEnvelopenow fails to load a config block that loaded before the upgrade.
Flooring to MSPv1_4_3 (see the comment on the next line) does not remove this exposure on its own, since V1_4_3 also enforces OUs; worth calling out the upgrade-compatibility implication in the PR description.
There was a problem hiding this comment.
Put it the issue description the fact that we are never going back to ver < v3 and that we do not have an installed base, thus don't care about upgrades.
| // local MSP version) — an MSP that declares NodeOUs then enforces them even when the channel | ||
| // declares no capabilities, while MSPs without NodeOUs keep using admincerts. | ||
| mspVersion := channelCapabilities.MSPVersion() | ||
| if mspVersion < msp.MSPv3_0 { |
There was a problem hiding this comment.
Minor (cleanup): the manual floor can use the Go builtin max() (repo is Go 1.27).
mspVersion := max(channelCapabilities.MSPVersion(), msp.MSPv3_0)is equivalent to the three-line if and compiles with the named MSPVersion int type plus the untyped constant. Readability/maintenance only. (If you take the MSPv1_4_3 suggestion above, this becomes max(…, msp.MSPv1_4_3).)
tock-ibm
left a comment
There was a problem hiding this comment.
Eventually we want these capabilities gone in fabric-x
| // EnableNodeOUs turns on node-OU based identity classification for every generated | ||
| // organization: each MSP gets a NodeOUs-enabled config.yaml and admin authority is | ||
| // conveyed by the admin OU instead of by admincerts. Defaults to false. | ||
| EnableNodeOUs bool |
There was a problem hiding this comment.
If we are flooring to v3 that the default should be true; or alternatively, set it to true regardless? since we are never going back to ver < v3
There was a problem hiding this comment.
If we are flooring to v3, we should enable both "admincerts" and "OUs"
| // local MSP version) — an MSP that declares NodeOUs then enforces them even when the channel | ||
| // declares no capabilities, while MSPs without NodeOUs keep using admincerts. | ||
| mspVersion := channelCapabilities.MSPVersion() | ||
| if mspVersion < msp.MSPv3_0 { |
There was a problem hiding this comment.
Put it the issue description the fact that we are never going back to ver < v3 and that we do not have an installed base, thus don't care about upgrades.
| // declares no capabilities, while MSPs without NodeOUs keep using admincerts. | ||
| mspVersion := channelCapabilities.MSPVersion() | ||
| if mspVersion < msp.MSPv3_0 { | ||
| mspVersion = msp.MSPv3_0 |
There was a problem hiding this comment.
Put it the issue description the fact that we are never going back to ver < v3 and that we do not have an installed base, thus don't care about upgrades.
970165b to
278e151
Compare
Signed-off-by: May.Buzaglo <May.Buzaglo@ibm.com>
Signed-off-by: May.Buzaglo <May.Buzaglo@ibm.com>
Type of change
Description
channelconfigfloors the MSP version of every channel org toMSPv3_0, so an MSP that declares NodeOUs enforces them (admins are identified by the admin OU) even when the channel declares no capabilities. MSPs without NodeOUs keep using admincerts.MSPv3_0on purpose, rather than theMSPv1_4_3that NodeOU admin classification strictly needs: Fabric-X is never going back to an MSP version below v3, and we have no installed base, so we do not care about upgrades.cryptogen.ConfigBlockParametersandtestcrypto.ConfigBlockgain anEnableNodeOUsoption (default false) that generates every org with a NodeOUs-enabledconfig.yamland an emptyadmincertsfolder.Related issues
#196