privatedomains

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingDomainRecord = errors.New("missing domain record")

ErrMissingDomainRecord is returned when some record is missing in the particular domain.

Functions

This section is empty.

Types

type NNS

type NNS interface {
	// CheckDomainRecord checks whether NNS domain with the specified name exists
	// and has given TXT record. Returns [ErrMissingDomainRecord] if domain exists
	// but has no given record, or any other error encountered prevented the check.
	//
	// Both domain name and record are non-empty.
	CheckDomainRecord(domainName string, record string) error
}

NNS provides services of the NeoFS NNS consumed by Validator to process.

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator validates NNS domains declared by the storage nodes on their attempts to enter the NeoFS network map.

There is an option to specify name of the verified nodes' domain. Such domains allow to combine several nodes into a private group (kind of subnet). Access is controlled using access lists: Validator checks that any incoming node declaring private node domain is presented in the corresponding access list. Access lists are stored in the NeoFS NNS: for each private node group, there is a registered NNS domain. TXT records of each such domain are Neo addresses of the nodes' public keys. To be allowed to use a specific verified domain value, the storage node must have a Neo address from this list. Otherwise, the storage node will be denied access to the network map. Note that if domain exists but has no records, then access is forbidden for anyone.

func New

func New(nns NNS) *Validator

New returns new Validator that uses provided NNS as a source of node access records.

func (*Validator) Verify

func (x *Validator) Verify(info netmap.NodeInfo) error

VerifyAndUpdate checks allowance of the storage node represented by the given descriptor to enter the private node group (if any). Returns an error if on access denial or the check cannot be done at the moment.

VerifyAndUpdate does not mutate the argument.

Jump to

Keyboard shortcuts

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