Documentation
¶
Index ¶
- Variables
- func CreateNamespaceVerifier(pd *applicationpb.PolicyItem, idDeserializer msp.IdentityDeserializer) (*signature.NsVerifier, error)
- func GetUpdatesFromNamespace(nsTx *applicationpb.TxNamespace) *servicepb.VerifierUpdates
- func MakeECDSAThresholdRuleNsPolicy(publicKey []byte) *applicationpb.NamespacePolicy
- func MakePolicy(t *testing.T, ns string, nsPolicy *applicationpb.NamespacePolicy) *applicationpb.PolicyItem
- func MakePolicyAndNsEndorser(t *testing.T, ns string) (*applicationpb.PolicyItem, *testsig.NsEndorser)
- func ParseChannelPolicy(bundle *channelconfig.Bundle, path string) (*signature.NsVerifier, error)
- func UnmarshalNamespacePolicy(policyBytes []byte) (*applicationpb.NamespacePolicy, error)
- func ValidateConfigTx(value []byte) error
- func ValidateNamespaceID(nsID string) error
- type SystemNamespacePolicy
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidNamespaceID is returned when the namespace ID cannot be parsed. ErrInvalidNamespaceID = errors.New("invalid namespace ID") // SystemNamespacePolicies lists every system namespace whose authorization policy is // resolved directly from the config block bundle, rather than from ns__meta. SystemNamespacePolicies = []SystemNamespacePolicy{ {NamespaceID: committerpb.MetaNamespaceID, PolicyPath: "/Channel/Application/LifecycleEndorsement"}, {NamespaceID: committerpb.SnapshotNamespaceID, PolicyPath: "/Channel/Application/SnapshotEndorsement"}, {NamespaceID: committerpb.CheckpointNamespaceID, PolicyPath: "/Channel/Application/CheckpointEndorsement"}, } )
Functions ¶
func CreateNamespaceVerifier ¶ added in v0.1.8
func CreateNamespaceVerifier( pd *applicationpb.PolicyItem, idDeserializer msp.IdentityDeserializer, ) (*signature.NsVerifier, error)
CreateNamespaceVerifier parses policy item to a namespace policy.
func GetUpdatesFromNamespace ¶
func GetUpdatesFromNamespace(nsTx *applicationpb.TxNamespace) *servicepb.VerifierUpdates
GetUpdatesFromNamespace translates a namespace TX to policy updates.
func MakeECDSAThresholdRuleNsPolicy ¶ added in v0.1.8
func MakeECDSAThresholdRuleNsPolicy(publicKey []byte) *applicationpb.NamespacePolicy
MakeECDSAThresholdRuleNsPolicy generates a namespace policy with threshold rule.
func MakePolicy ¶
func MakePolicy( t *testing.T, ns string, nsPolicy *applicationpb.NamespacePolicy, ) *applicationpb.PolicyItem
MakePolicy generates a policy item from a namespace policy.
func MakePolicyAndNsEndorser ¶ added in v0.1.8
func MakePolicyAndNsEndorser( t *testing.T, ns string, ) (*applicationpb.PolicyItem, *testsig.NsEndorser)
MakePolicyAndNsEndorser generates a policyItem and NsEndorser.
func ParseChannelPolicy ¶ added in v1.0.5
func ParseChannelPolicy(bundle *channelconfig.Bundle, path string) (*signature.NsVerifier, error)
ParseChannelPolicy resolves a channel policy at the given PolicyManager path and wraps it as a namespace verifier. The path itself is used to identify the policy in error messages.
func UnmarshalNamespacePolicy ¶ added in v0.1.8
func UnmarshalNamespacePolicy(policyBytes []byte) (*applicationpb.NamespacePolicy, error)
UnmarshalNamespacePolicy unmarshals namespace policy bytes to a applicationpb.NamespacePolicy proto.
func ValidateConfigTx ¶ added in v0.1.9
ValidateConfigTx validates that a config transaction envelope can be parsed into a valid bundle with all the config-block channel policies the verifier depends on (see SystemNamespacePolicies).
func ValidateNamespaceID ¶
ValidateNamespaceID checkes that a given namespace has the required length and allowed characters.
Types ¶
type SystemNamespacePolicy ¶ added in v1.0.5
SystemNamespacePolicy pairs a system namespace ID with the channel policy path that authorizes transactions in that namespace, per the config block.