Documentation
¶
Overview ¶
Package upstream connects DANS to its single PowerDNS API upstream.
Index ¶
- Constants
- Variables
- func LoadKey(sources KeySources) (httpapi.Secret, error)
- func NewHTTPClient(config TransportConfig) (*http.Client, *url.URL, error)
- func Relay(destination http.ResponseWriter, response *http.Response, requestID string) error
- type Client
- type KeySources
- type Operation
- type TransportConfig
Constants ¶
const MaxBrowseRRsetBytes = 8 << 20
MaxBrowseRRsetBytes bounds a single complete RRset, independently of zone size.
const (
MaxKeyBytes = 4096
)
const MaxProbeBytes = 64 << 10
Variables ¶
var ( ErrUpstreamAuthentication = errors.New("powerdns authentication failed") ErrUpstreamProbe = errors.New("powerdns probe failed") ErrIncompatibleVersion = errors.New("incompatible powerdns version") )
var ErrBrowseZoneAbsent = errors.New("upstream browse zone absent")
ErrBrowseZoneAbsent reports an authoritative 404, not a missing RRset.
Functions ¶
func LoadKey ¶
func LoadKey(sources KeySources) (httpapi.Secret, error)
LoadKey reads exactly one key source once and returns a redacting wrapper.
func NewHTTPClient ¶
NewHTTPClient constructs a bounded, non-redirecting PowerDNS client.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the generated PowerDNS client plus DANS compatibility checks.
func New ¶
func New(config TransportConfig, key httpapi.Secret) (*Client, error)
New constructs a client which replaces any caller-supplied PowerDNS key.
func (*Client) Forward ¶
Forward executes one typed generated-client operation without retries. Genuine upstream HTTP responses, including errors, are returned untouched.
func (*Client) Probe ¶
Probe authenticates to the authoritative server and enforces the supported version window.
func (*Client) StreamZoneRRsets ¶
func (client *Client) StreamZoneRRsets(ctx context.Context, zoneID, name, recordType string, yield func(json.RawMessage) error) error
StreamZoneRRsets streams complete API RRsets, retaining at most one set. A filtered read returning no sets is an authoritative RRset deletion.
type KeySources ¶
KeySources selects exactly one approved plaintext PowerDNS-key source.