github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/core/handlers/validation/api/policies/policies.go (about)

     1  /*
     2  Copyright hechain. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package validation
     8  
     9  import (
    10  	validation "github.com/hechain20/hechain/core/handlers/validation/api"
    11  	"github.com/hechain20/hechain/protoutil"
    12  )
    13  
    14  // PolicyEvaluator evaluates policies
    15  type PolicyEvaluator interface {
    16  	validation.Dependency
    17  
    18  	// Evaluate takes a set of SignedData and evaluates whether this set of signatures satisfies
    19  	// the policy with the given bytes
    20  	Evaluate(policyBytes []byte, signatureSet []*protoutil.SignedData) error
    21  }
    22  
    23  // SerializedPolicy defines a serialized policy
    24  type SerializedPolicy interface {
    25  	validation.ContextDatum
    26  
    27  	// Bytes returns the bytes of the SerializedPolicy
    28  	Bytes() []byte
    29  }