httpserver

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Overview

Package httpserver contains the DANS HTTP trust-boundary and lifecycle.

Index

Constants

View Source
const RateLimitBucketHeader = "X-DANS-RateLimit-Bucket"

RateLimitBucketHeader names every bucket that refused a request.

Variables

This section is empty.

Functions

func AccessLog

func AccessLog(logger *slog.Logger) func(http.Handler) http.Handler

AccessLog emits exactly one structured access record after each request.

func ActorFromContext

func ActorFromContext(ctx context.Context) (database.Actor, bool)

ActorFromContext returns the actor established by Authentication.

func Authentication

func Authentication(authenticator Authenticator) func(http.Handler) http.Handler

Authentication accepts exactly one header token or browser credential. Session creation/deletion handlers establish or clear their own credentials.

func Chain

func Chain(handler http.Handler, middleware ...Middleware) http.Handler

Chain applies middleware in the order listed.

func ContractOperationIDs

func ContractOperationIDs() (map[string]struct{}, error)

ContractOperationIDs returns the canonical operation IDs of the embedded combined contract, as recorded in RouteInfo.

func GracefulShutdown

func GracefulShutdown(parent context.Context, server shutdownServer, health *Health, timeout time.Duration) error

GracefulShutdown marks the instance unready, drains within a fixed deadline, and force-closes any connection left after that deadline.

func ListenAndServe

func ListenAndServe(ctx context.Context, server *http.Server, health *Health, shutdownTimeout time.Duration) error

ListenAndServe binds the configured address before entering Serve, avoiding a cancellation race between listener creation and graceful shutdown.

func NewApplicationHandler

func NewApplicationHandler(config ApplicationConfig) (http.Handler, error)

NewApplicationHandler assembles the production middleware and generated router from the exact embedded public contract.

func NewGeneratedServer

func NewGeneratedServer(strict api.StrictServerInterface) api.ServerInterface

NewGeneratedServer adapts strict generated handlers with secret-safe errors.

func NewHTTPServer

func NewHTTPServer(config ServerConfig, handler http.Handler) (*http.Server, error)

NewHTTPServer creates a server without opening a listener.

func NewJSONLogger

func NewJSONLogger(output io.Writer, level slog.Leveler) *slog.Logger

NewJSONLogger returns the sole production log encoding.

func NewRootHandler

func NewRootHandler(health *Health, contractJSON []byte, API http.Handler) (http.Handler, error)

NewRootHandler registers the three operations whose OpenAPI server override places them outside the global /api/v1 compatibility base.

func RequestIDFromContext

func RequestIDFromContext(ctx context.Context) string

RequestIDFromContext returns the current request identifier, if assigned.

func Serve

func Serve(ctx context.Context, server *http.Server, health *Health, listener net.Listener, shutdownTimeout time.Duration) error

Serve handles requests on an already-bound listener and drains after cancellation. Cancellation remains in the returned error for CLI exit 130.

func WithRequestID

func WithRequestID(ctx context.Context, requestID string) context.Context

WithRequestID adds a generated opaque request identifier to request context.

Types

type AccessMetadata

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

AccessMetadata is populated by routing, authorization, and forwarding code. It intentionally has no free-form field or request/response payload field.

func AccessMetadataFromContext

func AccessMetadataFromContext(ctx context.Context) *AccessMetadata

AccessMetadataFromContext returns the request's bounded access-log fields.

func (*AccessMetadata) SetActorID

func (metadata *AccessMetadata) SetActorID(actorID string)

func (*AccessMetadata) SetOpaqueIDs

func (metadata *AccessMetadata) SetOpaqueIDs(actorID, resourceID, operationID string)

func (*AccessMetadata) SetOperationID

func (metadata *AccessMetadata) SetOperationID(operationID string)

func (*AccessMetadata) SetRateLimit

func (metadata *AccessMetadata) SetRateLimit(decision ratelimit.Decision)

SetRateLimit records a metered request's rate-limit decision.

func (*AccessMetadata) SetResourceID

func (metadata *AccessMetadata) SetResourceID(resourceID string)

func (*AccessMetadata) SetRoute

func (metadata *AccessMetadata) SetRoute(template, apiOperationID string)

func (*AccessMetadata) SetUpstreamOutcome

func (metadata *AccessMetadata) SetUpstreamOutcome(outcome string)

type ApplicationConfig

type ApplicationConfig struct {
	Boundary          BoundaryConfig
	Logger            *slog.Logger
	Authenticator     Authenticator
	BrowserSessions   *BrowserSessions
	Schema            Probe
	PowerDNSReady     func() bool
	Health            *Health
	Upstream          *upstream.Client
	DANS              DANSOperations
	Mutations         RRsetMutationStore
	Lifecycle         ZoneLifecycleStore
	Denials           AuthorizationDenialAuditor
	AuditFailures     AuditFailureReporter
	LifecycleFailures LifecycleFailureReporter
	UpstreamID        string
	MutationTimeout   time.Duration
	// RateLimiter is optional; nil leaves rate limiting out of the chain.
	RateLimiter RateLimiter
}

ApplicationConfig contains the immutable dependencies of the HTTP trust boundary. DANS supplies the management operations; PowerDNSProxy overrides every upstream operation.

type AuditFailureReporter

type AuditFailureReporter interface {
	ReportAuditFailure()
}

AuditFailureReporter makes an instance unready after a terminal audit write fails, without changing an already-observed upstream response.

type AuditHandler

type AuditHandler struct {
	api.StrictServerInterface
	// contains filtered or unexported fields
}

AuditHandler overrides audit operations and delegates the rest of the generated strict interface.

func NewAuditHandler

func NewAuditHandler(store AuditStore, next api.StrictServerInterface) (*AuditHandler, error)

func (*AuditHandler) ListAuditEvents

type AuditHealth

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

AuditHealth latches a failed terminal audit write and clears it only after a real persistence probe succeeds.

func NewAuditHealth

func NewAuditHealth(recovery Probe) (*AuditHealth, error)

func (*AuditHealth) Failed

func (health *AuditHealth) Failed() bool

func (*AuditHealth) Probe

func (health *AuditHealth) Probe(ctx context.Context) error

func (*AuditHealth) ReportAuditFailure

func (health *AuditHealth) ReportAuditFailure()

func (*AuditHealth) ReportLifecycleFailure

func (health *AuditHealth) ReportLifecycleFailure()

ReportLifecycleFailure latches an upstream-success/local-binding failure. Unlike a transient audit failure, it needs explicit reconciliation and must not be cleared by a successful audit persistence probe.

type AuditStore

type AuditStore interface {
	ListAuditEvents(context.Context, database.Actor, database.AuditListOptions) (database.AuditPage, error)
}

AuditStore is the immutable operator audit read surface.

type Authenticator

type Authenticator interface {
	Authenticate(context.Context, string) (database.Actor, error)
}

Authenticator resolves current durable state for one API token or browser secret.

type AuthorizationDenialAuditor

type AuthorizationDenialAuditor interface {
	RecordAuthorizationDenial(context.Context, database.Actor, database.AuthorizationDenialInput) error
}

type BoundaryConfig

type BoundaryConfig struct {
	MaxBodyBytes   int64
	RequestTimeout time.Duration
	MaxConcurrent  int
	NewRequestID   func() (string, error)
}

BoundaryConfig bounds resources before contract validation or authentication.

type BrowseHandler

type BrowseHandler struct {
	api.StrictServerInterface
	// contains filtered or unexported fields
}

func NewBrowseHandler

func NewBrowseHandler(store BrowseStore, upstreamID string, next api.StrictServerInterface) (*BrowseHandler, error)

type BrowseStore

type BrowseStore interface {
	BrowseRRsets(context.Context, database.Actor, string, string, database.BrowseOptions, bool) (database.BrowsePage, error)
}

BrowseStore serves only API-observed DNS data, independently of write grants.

type BrowserSessionStore

type BrowserSessionStore interface {
	CreateBrowserSession(context.Context, string, string) (database.CreatedBrowserSession, error)
	DeleteBrowserSession(context.Context, string) error
}

BrowserSessionStore persists opaque session digests against current API tokens.

type BrowserSessions

type BrowserSessions struct {
	Store           BrowserSessionStore
	DevelopmentHTTP bool
}

BrowserSessions handles cookie transport separately from generated JSON bodies.

func (*BrowserSessions) Authentication

func (sessions *BrowserSessions) Authentication(authenticator Authenticator) func(http.Handler) http.Handler

Authentication applies the configured cookie transport without changing token validation or cross-origin protection. A nil receiver uses secure cookies.

func (*BrowserSessions) CreateBrowserSession

func (h *BrowserSessions) CreateBrowserSession(w http.ResponseWriter, r *http.Request)

func (*BrowserSessions) DeleteBrowserSession

func (h *BrowserSessions) DeleteBrowserSession(w http.ResponseWriter, r *http.Request)

type CompatibilityConfig

type CompatibilityConfig struct {
	Schema             Probe
	PowerDNSCompatible func() bool
}

type DANSOperations

type DANSOperations interface {
	BrowseRRsets(http.ResponseWriter, *http.Request, string, string, api.BrowseRRsetsParams)
	RefreshRRsets(http.ResponseWriter, *http.Request, string, string)
	GetAPIDocument(http.ResponseWriter, *http.Request)
	ListAuditEvents(http.ResponseWriter, *http.Request, api.ListAuditEventsParams)
	ExportAuditEvents(http.ResponseWriter, *http.Request, api.ExportAuditEventsParams)
	ListDelegations(http.ResponseWriter, *http.Request, api.ListDelegationsParams)
	CreateDelegation(http.ResponseWriter, *http.Request)
	RevokeDelegation(http.ResponseWriter, *http.Request, api.DelegationID)
	GetDelegation(http.ResponseWriter, *http.Request, api.DelegationID)
	ListGroups(http.ResponseWriter, *http.Request, api.ListGroupsParams)
	CreateGroup(http.ResponseWriter, *http.Request)
	GetGroup(http.ResponseWriter, *http.Request, api.GroupID)
	UpdateGroup(http.ResponseWriter, *http.Request, api.GroupID)
	ListGroupMembers(http.ResponseWriter, *http.Request, api.GroupID, api.ListGroupMembersParams)
	RemoveGroupMember(http.ResponseWriter, *http.Request, api.GroupID, api.IdentityID)
	AddGroupMember(http.ResponseWriter, *http.Request, api.GroupID, api.IdentityID)
	ListIdentities(http.ResponseWriter, *http.Request, api.ListIdentitiesParams)
	CreateIdentity(http.ResponseWriter, *http.Request)
	GetIdentity(http.ResponseWriter, *http.Request, api.IdentityID)
	UpdateIdentity(http.ResponseWriter, *http.Request, api.IdentityID)
	ListIdentityTokens(http.ResponseWriter, *http.Request, api.IdentityID, api.ListIdentityTokensParams)
	CreateIdentityToken(http.ResponseWriter, *http.Request, api.IdentityID)
	RevokeIdentityToken(http.ResponseWriter, *http.Request, api.IdentityID, api.TokenID)
	GetCurrentIdentity(http.ResponseWriter, *http.Request)
	GetCurrentCredential(http.ResponseWriter, *http.Request)
	ListIdentityGroups(http.ResponseWriter, *http.Request, api.IdentityID, api.ListIdentityGroupsParams)
	ListIdentityDelegations(http.ResponseWriter, *http.Request, api.IdentityID, api.ListIdentityDelegationsParams)
	ListIdentityAssignments(http.ResponseWriter, *http.Request, api.IdentityID, api.ListIdentityAssignmentsParams)
	ListCurrentIdentityDelegations(http.ResponseWriter, *http.Request, api.ListCurrentIdentityDelegationsParams)
	ListCurrentIdentityGroups(http.ResponseWriter, *http.Request, api.ListCurrentIdentityGroupsParams)
	ListCurrentIdentityTokens(http.ResponseWriter, *http.Request, api.ListCurrentIdentityTokensParams)
	CreateCurrentIdentityToken(http.ResponseWriter, *http.Request)
	RevokeCurrentIdentityToken(http.ResponseWriter, *http.Request, api.TokenID)
	ListZoneBindings(http.ResponseWriter, *http.Request, api.ListZoneBindingsParams)
	CreateZoneBinding(http.ResponseWriter, *http.Request)
	GetZoneBinding(http.ResponseWriter, *http.Request, api.ZoneBindingID)
	ConfirmZoneBindingAbsent(http.ResponseWriter, *http.Request, api.ZoneBindingID)
	ObserveZoneBinding(http.ResponseWriter, *http.Request, api.ZoneBindingID)
	RebindZoneBinding(http.ResponseWriter, *http.Request, api.ZoneBindingID)
	RetryZoneBindingDeletion(http.ResponseWriter, *http.Request, api.ZoneBindingID)
	GetLiveness(http.ResponseWriter, *http.Request)
	GetReadiness(http.ResponseWriter, *http.Request)
}

DANSOperations is the non-PowerDNS portion of the generated server. Keeping this interface narrow makes the compiler prove that PowerDNSProxy explicitly implements every upstream operation rather than inheriting one by accident.

func NewDANSOperations

func NewDANSOperations(config GeneratedConfig) (DANSOperations, error)

NewDANSOperations builds the complete generated DANS management chain. The returned standard server is embedded by PowerDNSProxy, which owns every compatibility operation explicitly.

type DelegationHandler

type DelegationHandler struct {
	api.StrictServerInterface
	// contains filtered or unexported fields
}

DelegationHandler overrides delegation operations and delegates every other generated strict operation to the next handler.

func NewDelegationHandler

func NewDelegationHandler(store DelegationStore, next api.StrictServerInterface) (*DelegationHandler, error)

func (*DelegationHandler) CreateDelegation

func (*DelegationHandler) GetDelegation

func (*DelegationHandler) ListDelegations

func (*DelegationHandler) ListIdentityAssignments

func (*DelegationHandler) ListIdentityDelegations

func (*DelegationHandler) RevokeDelegation

type Dependencies

type Dependencies struct {
	Database Probe
	Schema   Probe
	Audit    Probe
	PowerDNS Probe
}

Dependencies are the four independent readiness requirements.

type GeneratedConfig

type GeneratedConfig struct {
	Store           *database.Store
	Upstream        *upstream.Client
	UpstreamID      string
	MutationTimeout time.Duration
	AuditFailures   AuditFailureReporter
}

GeneratedConfig contains the concrete runtime services shared by every DANS strict handler.

type Health

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

Health separates process liveness from current dependency readiness.

func NewHealth

func NewHealth(dependencies Dependencies, timeout time.Duration) (*Health, error)

NewHealth builds an immutable, bounded readiness checker.

func (*Health) BeginDrain

func (health *Health) BeginDrain()

BeginDrain irreversibly makes the instance unready before listener shutdown.

func (*Health) Draining

func (health *Health) Draining() bool

Draining reports whether graceful shutdown has begun.

func (*Health) Livez

func (*Health) Livez(w http.ResponseWriter, _ *http.Request)

Livez reports process HTTP liveness without dependency detail.

func (*Health) Ready

func (health *Health) Ready(parent context.Context) bool

Ready evaluates current readiness under one shared deadline.

func (*Health) Readyz

func (health *Health) Readyz(w http.ResponseWriter, request *http.Request)

Readyz checks current dependencies without caching and returns no detail.

type IAMHandler

type IAMHandler struct {
	api.StrictServerInterface
	// contains filtered or unexported fields
}

IAMHandler overrides IAM operations and delegates every other generated strict operation to the next handler.

func NewIAMHandler

func NewIAMHandler(store IAMStore, next api.StrictServerInterface) (*IAMHandler, error)

func (*IAMHandler) AddGroupMember

func (*IAMHandler) CreateGroup

func (*IAMHandler) CreateIdentity

func (*IAMHandler) CreateIdentityToken

func (*IAMHandler) GetGroup

func (*IAMHandler) GetIdentity

func (*IAMHandler) ListGroupMembers

func (*IAMHandler) ListGroups

func (*IAMHandler) ListIdentities

func (*IAMHandler) ListIdentityGroups

func (*IAMHandler) ListIdentityTokens

func (*IAMHandler) RemoveGroupMember

func (*IAMHandler) RevokeIdentityToken

func (*IAMHandler) UpdateGroup

func (*IAMHandler) UpdateIdentity

type IAMStore

type IAMStore interface {
	CreateIdentity(context.Context, database.Actor, database.IdentityCreate) (database.Identity, error)
	GetIdentity(context.Context, database.Actor, string) (database.Identity, error)
	ListIdentities(context.Context, database.Actor, database.IdentityListOptions) (database.IdentityPage, error)
	PatchIdentity(context.Context, database.Actor, string, database.IdentityPatch) (database.Identity, error)
	CreateGroup(context.Context, database.Actor, database.GroupCreate) (database.Group, error)
	GetGroup(context.Context, database.Actor, string) (database.Group, error)
	ListGroups(context.Context, database.Actor, database.GroupListOptions) (database.GroupPage, error)
	PatchGroup(context.Context, database.Actor, string, database.GroupPatch) (database.Group, error)
	AddGroupMember(context.Context, database.Actor, string, string) (database.GroupMembership, error)
	RemoveGroupMember(context.Context, database.Actor, string, string) error
	ListGroupMembers(context.Context, database.Actor, string, database.IdentityListOptions) (database.IdentityPage, error)
	ListIdentityGroups(context.Context, database.Actor, string, database.GroupListOptions) (database.GroupPage, error)
	ListCurrentIdentityGroups(context.Context, database.Actor, database.GroupListOptions) (database.GroupPage, error)
	GetCurrentIdentity(context.Context, database.Actor) (database.Identity, error)
	CreateToken(context.Context, database.Actor, string, database.TokenCreate) (database.CreatedToken, error)
	ListTokens(context.Context, database.Actor, string, database.TokenListOptions) (database.TokenPage, error)
	RevokeToken(context.Context, database.Actor, string, string) error
}

IAMStore is the stable identity, group, membership, and token application service consumed by the generated HTTP handlers.

type LifecycleFailureReporter

type LifecycleFailureReporter interface {
	ReportLifecycleFailure()
}

LifecycleFailureReporter latches an upstream-success/local-binding failure until an operator reconciles it and restarts the affected instance.

type Middleware

type Middleware func(http.Handler) http.Handler

Middleware is one ordered HTTP trust-boundary stage.

func Authorization

func Authorization(auditor AuthorizationDenialAuditor, failures AuditFailureReporter) Middleware

Authorization enforces route-wide classes. A non-operator delegated write continues to its handler, which authorizes the complete decoded RRset batch.

func Compatibility

func Compatibility(config CompatibilityConfig) Middleware

Compatibility prevents authenticated traffic and sign-in from reaching handlers while the database/schema is unusable, and prevents compatibility requests from reaching an upstream outside the pinned PowerDNS surface.

func NewBoundary

func NewBoundary(config BoundaryConfig) (Middleware, error)

NewBoundary constructs the outer request-ID, recovery, body, deadline, and concurrency stage.

func NewContractValidation

func NewContractValidation(document *openapi3.T) (Middleware, error)

NewContractValidation rejects undeclared or contract-invalid requests before authentication and records the matched operation for later authorization.

func RateLimit

func RateLimit(limiter RateLimiter) Middleware

RateLimit meters authenticated requests after authentication and before compatibility, authorization, audit, and forwarding. Anonymous requests pass through. Admitted and unmetered requests gain no headers.

type PowerDNSCompatibility

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

PowerDNSCompatibility records only the latest bounded compatibility probe. It starts fail-closed until the first successful probe.

func (*PowerDNSCompatibility) Compatible

func (state *PowerDNSCompatibility) Compatible() bool

func (*PowerDNSCompatibility) Record

func (state *PowerDNSCompatibility) Record(err error)

type PowerDNSProxy

type PowerDNSProxy struct {
	DANSOperations
	BrowserSessions   *BrowserSessions
	Upstream          *upstream.Client
	Mutations         RRsetMutationStore
	Lifecycle         ZoneLifecycleStore
	AuditFailures     AuditFailureReporter
	LifecycleFailures LifecycleFailureReporter
	UpstreamID        string
	MutationTimeout   time.Duration
}

PowerDNSProxy implements every PowerDNS operation through the generated client. The embedded handler supplies only the DANS and root operations.

func (*PowerDNSProxy) AddToView

func (proxy *PowerDNSProxy) AddToView(w http.ResponseWriter, request *http.Request, serverID api.ServerId, view api.View)

func (*PowerDNSProxy) AxfrExportZone

func (proxy *PowerDNSProxy) AxfrExportZone(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) AxfrRetrieveZone

func (proxy *PowerDNSProxy) AxfrRetrieveZone(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) CacheFlushByName

func (proxy *PowerDNSProxy) CacheFlushByName(w http.ResponseWriter, request *http.Request, serverID api.ServerId, params api.CacheFlushByNameParams)

func (*PowerDNSProxy) CreateAutoprimary

func (proxy *PowerDNSProxy) CreateAutoprimary(w http.ResponseWriter, request *http.Request, serverID api.ServerId)

func (*PowerDNSProxy) CreateBrowserSession

func (proxy *PowerDNSProxy) CreateBrowserSession(w http.ResponseWriter, r *http.Request)

CreateBrowserSession handles the local sign-in operation, never upstream.

func (*PowerDNSProxy) CreateCryptokey

func (proxy *PowerDNSProxy) CreateCryptokey(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) CreateMetadata

func (proxy *PowerDNSProxy) CreateMetadata(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) CreateTSIGKey

func (proxy *PowerDNSProxy) CreateTSIGKey(w http.ResponseWriter, request *http.Request, serverID api.ServerId)

func (*PowerDNSProxy) CreateZone

func (proxy *PowerDNSProxy) CreateZone(w http.ResponseWriter, request *http.Request, serverID api.ServerId, params api.CreateZoneParams)

func (*PowerDNSProxy) DeleteAutoprimary

func (proxy *PowerDNSProxy) DeleteAutoprimary(w http.ResponseWriter, request *http.Request, serverID api.ServerId, ip, nameserver string)

func (*PowerDNSProxy) DeleteBrowserSession

func (proxy *PowerDNSProxy) DeleteBrowserSession(w http.ResponseWriter, r *http.Request)

DeleteBrowserSession handles the local sign-out operation, never upstream.

func (*PowerDNSProxy) DeleteCryptokey

func (proxy *PowerDNSProxy) DeleteCryptokey(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId, keyID string)

func (*PowerDNSProxy) DeleteFromView

func (proxy *PowerDNSProxy) DeleteFromView(w http.ResponseWriter, request *http.Request, serverID api.ServerId, view api.View, id string)

func (*PowerDNSProxy) DeleteMetadata

func (proxy *PowerDNSProxy) DeleteMetadata(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId, kind string)

func (*PowerDNSProxy) DeleteTSIGKey

func (proxy *PowerDNSProxy) DeleteTSIGKey(w http.ResponseWriter, request *http.Request, serverID api.ServerId, keyID string)

func (*PowerDNSProxy) DeleteZone

func (proxy *PowerDNSProxy) DeleteZone(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) GetAutoprimaries

func (proxy *PowerDNSProxy) GetAutoprimaries(w http.ResponseWriter, request *http.Request, serverID api.ServerId)

func (*PowerDNSProxy) GetConfig

func (proxy *PowerDNSProxy) GetConfig(w http.ResponseWriter, request *http.Request, serverID api.ServerId)

func (*PowerDNSProxy) GetConfigSetting

func (proxy *PowerDNSProxy) GetConfigSetting(w http.ResponseWriter, request *http.Request, serverID api.ServerId, name string)

func (*PowerDNSProxy) GetCryptokey

func (proxy *PowerDNSProxy) GetCryptokey(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId, keyID string)

func (*PowerDNSProxy) GetMetadata

func (proxy *PowerDNSProxy) GetMetadata(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId, kind string)

func (*PowerDNSProxy) GetNetwork

func (proxy *PowerDNSProxy) GetNetwork(w http.ResponseWriter, request *http.Request, serverID api.ServerId, ip, prefixLength string)

func (*PowerDNSProxy) GetStats

func (proxy *PowerDNSProxy) GetStats(w http.ResponseWriter, request *http.Request, serverID api.ServerId, params api.GetStatsParams)

func (*PowerDNSProxy) GetTSIGKey

func (proxy *PowerDNSProxy) GetTSIGKey(w http.ResponseWriter, request *http.Request, serverID api.ServerId, keyID string)

func (*PowerDNSProxy) ListCryptokeys

func (proxy *PowerDNSProxy) ListCryptokeys(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) ListMetadata

func (proxy *PowerDNSProxy) ListMetadata(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) ListNetworks

func (proxy *PowerDNSProxy) ListNetworks(w http.ResponseWriter, request *http.Request, serverID api.ServerId)

func (*PowerDNSProxy) ListServer

func (proxy *PowerDNSProxy) ListServer(w http.ResponseWriter, request *http.Request, serverID api.ServerId)

func (*PowerDNSProxy) ListServers

func (proxy *PowerDNSProxy) ListServers(w http.ResponseWriter, request *http.Request)

func (*PowerDNSProxy) ListTSIGKeys

func (proxy *PowerDNSProxy) ListTSIGKeys(w http.ResponseWriter, request *http.Request, serverID api.ServerId)

func (*PowerDNSProxy) ListView

func (proxy *PowerDNSProxy) ListView(w http.ResponseWriter, request *http.Request, serverID api.ServerId, view api.View)

func (*PowerDNSProxy) ListViews

func (proxy *PowerDNSProxy) ListViews(w http.ResponseWriter, request *http.Request, serverID api.ServerId)

func (*PowerDNSProxy) ListZone

func (proxy *PowerDNSProxy) ListZone(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId, params api.ListZoneParams)

func (*PowerDNSProxy) ListZones

func (proxy *PowerDNSProxy) ListZones(w http.ResponseWriter, request *http.Request, serverID api.ServerId, params api.ListZonesParams)

func (*PowerDNSProxy) ModifyCryptokey

func (proxy *PowerDNSProxy) ModifyCryptokey(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId, keyID string)

func (*PowerDNSProxy) ModifyMetadata

func (proxy *PowerDNSProxy) ModifyMetadata(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId, kind string)

func (*PowerDNSProxy) NotifyZone

func (proxy *PowerDNSProxy) NotifyZone(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) PatchZone

func (proxy *PowerDNSProxy) PatchZone(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) PowerDNSError

func (proxy *PowerDNSProxy) PowerDNSError(w http.ResponseWriter, request *http.Request)

func (*PowerDNSProxy) PutTSIGKey

func (proxy *PowerDNSProxy) PutTSIGKey(w http.ResponseWriter, request *http.Request, serverID api.ServerId, keyID string)

func (*PowerDNSProxy) PutZone

func (proxy *PowerDNSProxy) PutZone(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) RectifyZone

func (proxy *PowerDNSProxy) RectifyZone(w http.ResponseWriter, request *http.Request, serverID api.ServerId, zoneID api.ZoneId)

func (*PowerDNSProxy) SearchData

func (proxy *PowerDNSProxy) SearchData(w http.ResponseWriter, request *http.Request, serverID api.ServerId, params api.SearchDataParams)

func (*PowerDNSProxy) SetNetwork

func (proxy *PowerDNSProxy) SetNetwork(w http.ResponseWriter, request *http.Request, serverID api.ServerId, ip, prefixLength string)

type Probe

type Probe func(context.Context) error

Probe checks one readiness dependency without exposing its error to callers.

type RRsetMutationStore

RRsetMutationStore is the durable decision and audit boundary for a zone patch. The upstream request cannot begin before both authorization and intent persistence succeed.

type RateLimiter

type RateLimiter interface {
	Admit(context.Context, ratelimit.Request) ratelimit.Decision
}

RateLimiter meters one authenticated request. It never fails: backend errors produce an unmetered decision.

type RouteInfo

type RouteInfo struct {
	Template       string
	OperationID    string
	AccessClass    contract.AccessClass
	PathParameters map[string]string
}

RouteInfo is the reviewed contract identity of the current request.

func RouteInfoFromContext

func RouteInfoFromContext(ctx context.Context) (RouteInfo, bool)

RouteInfoFromContext returns the operation matched by contract validation.

type ServerConfig

type ServerConfig struct {
	Address           string
	MaxHeaderBytes    int
	ReadHeaderTimeout time.Duration
	ReadTimeout       time.Duration
	WriteTimeout      time.Duration
	IdleTimeout       time.Duration
}

ServerConfig fixes the net/http connection-level resource limits.

type ZoneHandler

type ZoneHandler struct {
	api.StrictServerInterface
	// contains filtered or unexported fields
}

ZoneHandler overrides zone-binding and reconciliation operations and delegates the rest of the generated strict interface.

func NewZoneHandler

func NewZoneHandler(store ZoneManagementStore, client *upstream.Client, upstreamID string, timeout time.Duration, auditFailures AuditFailureReporter, next api.StrictServerInterface) (*ZoneHandler, error)

func (*ZoneHandler) CreateZoneBinding

func (*ZoneHandler) GetZoneBinding

func (*ZoneHandler) ListZoneBindings

func (*ZoneHandler) ObserveZoneBinding

func (*ZoneHandler) RebindZoneBinding

type ZoneLifecycleStore

ZoneLifecycleStore owns the generation changes which must bracket upstream zone creation and deletion.

type ZoneManagementStore

ZoneManagementStore is the persistence boundary for generation-aware zone binding and explicit deletion reconciliation.

Jump to

Keyboard shortcuts

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