Documentation
¶
Overview ¶
Package hba provides utilities for handling PostgreSQL Host-Based Authentication (pg_hba.conf) rules, including validation and expansion of descriptor references such as pod selectors.
Index ¶
Constants ¶
const PodSelectorReference = "podselector"
PodSelectorReference is the type of references to a Pod selector.
Variables ¶
This section is empty.
Functions ¶
func ExpandLine ¶
ExpandLine expands descriptor references in an HBA line. Only the first descriptor reference is expanded; lines with multiple references should be rejected by ValidateLine before reaching this point. Returns one line per expanded value. If the line has no descriptor reference, returns a slice containing just the original line. If an error occurs, the line is returned as a comment with the error message appended. This function is also registered as a Go template FuncMap entry ("expandRule") for inline expansion in the pg_hba.conf template.
Types ¶
type ErrMultiplePodSelectorReferences ¶
type ErrMultiplePodSelectorReferences struct {
Count int
}
ErrMultiplePodSelectorReferences is returned when an HBA line contains more than one podselector reference.
func (*ErrMultiplePodSelectorReferences) Error ¶
func (e *ErrMultiplePodSelectorReferences) Error() string
type ErrPodSelectorNotFound ¶
type ErrPodSelectorNotFound struct {
SelectorName string
}
ErrPodSelectorNotFound is returned when an HBA line references a pod selector that is not present in the provided map.
func (*ErrPodSelectorNotFound) Error ¶
func (e *ErrPodSelectorNotFound) Error() string
type ErrUnknownDescriptorType ¶
type ErrUnknownDescriptorType struct {
DescriptorType string
}
ErrUnknownDescriptorType is returned when an HBA line contains a descriptor reference with an unknown type.
func (*ErrUnknownDescriptorType) Error ¶
func (e *ErrUnknownDescriptorType) Error() string