overrides

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

Registration Server Overrides

This package contains implementations for different ways that the registration server can overrides the parameters sent by clients. In bidirectional registrations this allows / can allow us to do things like selecting a phantom using a different algorithm, assign phantoms from a non-public set, change transport parameters to optimize client connections, etc.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotPrefixTransport  = errors.New("registration does not use Prefix transport")
	ErrMissingRegistration = errors.New("no registration to modify")
)

Functions

func NewPrefixTransportOverride

func NewPrefixTransportOverride(prefixesPath string) (interfaces.RegOverride, error)

NewPrefixTransportOverride returns an object that implements the Override trait specific to when the Prefix transport it used. If no path is provided, then a nil Override object will be returned along with a nil error as this is expected behavior.

Types

type FixedPrefixOverride

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

FixedPrefixOverride allows the registration server to override the prefix chosen by the client when they register using the Prefix transport with `disable_registration_overrides` enabled.

func NewFixedPrefixOverride

func NewFixedPrefixOverride(p prefix.Prefix) *FixedPrefixOverride

NewFixedPrefixOverride returns an object that implements the Override trait specific to when the Prefix transport it used. This is primarily for testing to ensure that the override system works in practice.

func (*FixedPrefixOverride) Override

func (fpo *FixedPrefixOverride) Override(reg *pb.C2SWrapper, randReader io.Reader) error

Override implements the RegOverride interface.

type PrefixOverride

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

PrefixOverride allows the registration server to override the prefix chosen by the client when they register using the Prefix transport with `allow_registration_overrides` enabled.

func ParsePrefixes

func ParsePrefixes(conf io.Reader) (*PrefixOverride, error)

ParsePrefixes allows prefix overrides to be parsed from an io.Reader

func (*PrefixOverride) Override

func (po *PrefixOverride) Override(reg *pb.C2SWrapper, randReader io.Reader) error

Override implements the RegOverride interface.

type RandPrefixOverride

type RandPrefixOverride struct{}

RandPrefixOverride allows the registration server to override the prefix chosen by the client when they register using the Prefix transport with `disable_registration_overrides` enabled.

func NewRandPrefixOverride

func NewRandPrefixOverride() *RandPrefixOverride

NewRandPrefixOverride returns an object that implements the Override trait specific to when the Prefix transport it used. This is primarily for testing to ensure that the override system works in practice.

func (*RandPrefixOverride) Override

func (rpo *RandPrefixOverride) Override(reg *pb.C2SWrapper, randReader io.Reader) error

Override implements the RegOverride interface.

Jump to

Keyboard shortcuts

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