proxy

package
v0.0.0-...-64b876b Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	Pattern Pattern
	Token   string
}

ACL defines a pattern and the corresponding auth key

func (*ACL) CheckAuth

func (a *ACL) CheckAuth(token string) bool

CheckAuth validate a given token against the ACL token

type ACLs

type ACLs []ACL

ACLs is a list of ACLs

func NewACLsFromConfig

func NewACLsFromConfig(cfg []config.ACL) (ACLs, error)

NewACLsFromConfig creates ACLs from configuration

func (ACLs) Search

func (a ACLs) Search(fqdn string) (ACL, error)

Search for a access rule by FQDN

type Pattern

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

Pattern is a glob-like string for ACL

func CompilePattern

func CompilePattern(source string) (Pattern, error)

CompilePattern creates a Pattern form a given string

func MustCompilePattern

func MustCompilePattern(source string) Pattern

MustCompilePattern creates a Pattern form a given string. Panics in case of an error

func (*Pattern) Match

func (p *Pattern) Match(s string) bool

Match the pattern with a given string

func (*Pattern) String

func (p *Pattern) String() string

String returns the pattern as string

type Proxy

type Proxy struct {
	Log      *logrus.Logger
	Provider dns.Provider
	ACLs     ACLs
}

Proxy handles incoming request and calls the DNS provider API.

func (*Proxy) Handle

func (p *Proxy) Handle(ctx context.Context, req *Request) error

Handle validates and authenticates a request. If everything is fine, the configured DNS provider API gets called.

type Remote

type Remote struct {
	Address string // Address is the address of the client
	Name    string // Name is the name of the client. This depends on the client and can be for example go/lego for lego
}

Remote holds information about the remote client.

type Request

type Request struct {
	Action    string        // Action for the current request. Can be present or cleanup
	AuthToken string        // AuthToken for the current request
	Challenge dns.Challenge // Challenge for the current request
	Remote    Remote        // Remote information for the current request
}

Request holds information about the request.

Jump to

Keyboard shortcuts

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