Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PositiveIsRecognizedCachePeriod is the time period the cache maintains // the positive result of the last `IsRecognized` checks. // We use the cache to minimize calls to the on-chain client. PositiveIsRecognizedCachePeriod = 12 * time.Hour // NegativeIsRecognizedCachePeriod is the time period the cache maintains // the negative result of the last `IsRecognized` checks. // We use the cache to minimize calls to the on-chain client. NegativeIsRecognizedCachePeriod = 1 * time.Hour )
Variables ¶
View Source
var Disabled = &noFirewall{}
Disabled is an empty Firewall implementation enforcing no rules on the connection.
View Source
var EmptyAllowList = NewAllowList([]*operator.PublicKey{})
EmptyAllowList represents an empty firewall allowlist.
Functions ¶
func AnyApplicationPolicy ¶ added in v1.21.0
func AnyApplicationPolicy( applications []Application, allowList *AllowList, ) net.Firewall
Types ¶
type AllowList ¶ added in v1.21.0
type AllowList struct {
// contains filtered or unexported fields
}
AllowList represents a list of operator public keys that are not checked against the firewall rules and are always valid peers.
func NewAllowList ¶ added in v1.21.0
NewAllowList creates a new firewall's allowlist based on the given public key list.
type Application ¶ added in v1.21.0
type Application interface { // IsRecognized returns true if the application recognizes the operator // as one participating in the application. IsRecognized(operatorPublicKey *operator.PublicKey) (bool, error) }
Application defines functionalities for operator verification in the firewall.
Click to show internal directories.
Click to hide internal directories.