firewall

package
v1.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 5 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func NewAllowList(operatorPublicKeys []*operator.PublicKey) *AllowList

NewAllowList creates a new firewall's allowlist based on the given public key list.

func (*AllowList) Contains added in v1.21.0

func (al *AllowList) Contains(operatorPublicKey *operator.PublicKey) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL