Documentation ¶
Index ¶
- Variables
- func And(lhs, rhs *cb.SignaturePolicy) *cb.SignaturePolicy
- func Envelope(policy *cb.SignaturePolicy, identities [][]byte) *cb.SignaturePolicyEnvelope
- func FromString(policy string) (*common.SignaturePolicyEnvelope, error)
- func NOutOf(n int32, policies []*cb.SignaturePolicy) *cb.SignaturePolicy
- func NewPolicyProvider(deserializer msp.IdentityDeserializer) policies.Provider
- func Or(lhs, rhs *cb.SignaturePolicy) *cb.SignaturePolicy
- func SignedBy(index int32) *cb.SignaturePolicy
- func SignedByMspAdmin(mspId string) *cb.SignaturePolicyEnvelope
- func SignedByMspMember(mspId string) *cb.SignaturePolicyEnvelope
- func TemplatePolicy(key string, sigPolicyEnv *cb.SignaturePolicyEnvelope) *cb.ConfigGroup
Constants ¶
This section is empty.
Variables ¶
var AcceptAllPolicy *cb.SignaturePolicyEnvelope
AcceptAllPolicy always evaluates to true
var MarshaledAcceptAllPolicy []byte
MarshaledAcceptAllPolicy is the Marshaled version of AcceptAllPolicy
var MarshaledRejectAllPolicy []byte
MarshaledRejectAllPolicy is the Marshaled version of RejectAllPolicy
var RejectAllPolicy *cb.SignaturePolicyEnvelope
RejectAllPolicy always evaluates to false
Functions ¶
func And ¶ added in v1.0.0
func And(lhs, rhs *cb.SignaturePolicy) *cb.SignaturePolicy
And is a convenience method which utilizes NOutOf to produce And equivalent behavior
func Envelope ¶ added in v1.0.0
func Envelope(policy *cb.SignaturePolicy, identities [][]byte) *cb.SignaturePolicyEnvelope
Envelope builds an envelope message embedding a SignaturePolicy
func FromString ¶ added in v1.0.0
func FromString(policy string) (*common.SignaturePolicyEnvelope, error)
FromString takes a string representation of the policy, parses it and returns a SignaturePolicyEnvelope that implements that policy. The supported language is as follows
GATE(P[, P])
where
- GATE is either "and" or "or"
- P is either a principal or another nested call to GATE
a principal is defined as
ORG.ROLE ¶
where
- ORG is a string (representing the MSP identifier)
- ROLE is either the string "member" or the string "admin" representing the required role
func NOutOf ¶ added in v1.0.0
func NOutOf(n int32, policies []*cb.SignaturePolicy) *cb.SignaturePolicy
NOutOf creates a policy which requires N out of the slice of policies to evaluate to true
func NewPolicyProvider ¶
func NewPolicyProvider(deserializer msp.IdentityDeserializer) policies.Provider
NewProviderImpl provides a policy generator for cauthdsl type policies
func Or ¶ added in v1.0.0
func Or(lhs, rhs *cb.SignaturePolicy) *cb.SignaturePolicy
Or is a convenience method which utilizes NOutOf to produce Or equivalent behavior
func SignedBy ¶ added in v1.0.0
func SignedBy(index int32) *cb.SignaturePolicy
SignedBy creates a SignaturePolicy requiring a given signer's signature
func SignedByMspAdmin ¶ added in v1.0.0
func SignedByMspAdmin(mspId string) *cb.SignaturePolicyEnvelope
SignedByMspAdmin creates a SignaturePolicyEnvelope requiring 1 signature from any admin of the specified MSP
func SignedByMspMember ¶ added in v1.0.0
func SignedByMspMember(mspId string) *cb.SignaturePolicyEnvelope
SignedByMspMember creates a SignaturePolicyEnvelope requiring 1 signature from any member of the specified MSP
func TemplatePolicy ¶ added in v1.0.0
func TemplatePolicy(key string, sigPolicyEnv *cb.SignaturePolicyEnvelope) *cb.ConfigGroup
TemplatePolicy creates a headerless configuration item representing a policy for a given key
Types ¶
This section is empty.