Documentation
¶
Overview ¶
Package provider exposes storage-neutral datasource construction and lookup.
Concrete LDAP and SQL implementations remain service-owned. This package is deliberately a narrow bridge to the library's authoritative datasource validators and immutable in-memory snapshot.
Index ¶
- Constants
- func NewError(code ErrorCode) error
- func ValidateDomainSelector(domain, selector string, algorithm Algorithm) error
- type Algorithm
- type Binding
- type Compatibility
- type Credential
- func (c Credential) Algorithm() Algorithm
- func (Credential) Format(state fmt.State, _ rune)
- func (Credential) GoString() string
- func (c Credential) KeyHandleIDEqual(value string) bool
- func (Credential) MarshalJSON() ([]byte, error)
- func (c Credential) PublicKeySPKIDER() []byte
- func (c Credential) Selector() string
- func (Credential) String() string
- func (c Credential) Valid() bool
- type Dataset
- func (d *Dataset) Equivalent(other *Dataset) bool
- func (*Dataset) Format(state fmt.State, _ rune)
- func (d *Dataset) Generation() uint64
- func (*Dataset) GoString() string
- func (*Dataset) MarshalJSON() ([]byte, error)
- func (d *Dataset) NewSigningResolver(bindings []Binding, at time.Time) (*SigningResolver, error)
- func (d *Dataset) ResolvePolicy(ctx context.Context, tenant string, domain string, use ProfileUse, ...) (Policy, Profile, error)
- func (d *Dataset) ResolveProfile(ctx context.Context, profileID string, use ProfileUse, at time.Time) (Profile, error)
- func (*Dataset) String() string
- func (d *Dataset) Valid() bool
- type ErrorCode
- type Limits
- type Policy
- type Profile
- func (p Profile) Credentials() []Credential
- func (Profile) Format(state fmt.State, _ rune)
- func (Profile) GoString() string
- func (p Profile) IDMatches(value string) bool
- func (Profile) MarshalJSON() ([]byte, error)
- func (p Profile) SigningDomain() string
- func (p Profile) Status() RecordStatus
- func (Profile) String() string
- func (p Profile) Valid() bool
- func (p Profile) ValidityWindow() (time.Time, time.Time, bool)
- type ProfileUse
- type RecordStatus
- type Rollout
- type SigningResolver
- func (r *SigningResolver) Close(ctx context.Context) error
- func (*SigningResolver) Format(state fmt.State, _ rune)
- func (*SigningResolver) GoString() string
- func (*SigningResolver) MarshalJSON() ([]byte, error)
- func (r *SigningResolver) ResolvePolicy(ctx context.Context, tenant string, domain string, use ProfileUse, ...) (dkim2.SigningProfile, error)
- func (*SigningResolver) String() string
Constants ¶
const ( // ErrorCodeInvalidRequest classifies invalid or incomplete input. ErrorCodeInvalidRequest = datasource.ErrorCodeInvalidRequest // ErrorCodeNotFound classifies an absent exact record. ErrorCodeNotFound = datasource.ErrorCodeNotFound // ErrorCodeAmbiguous classifies duplicate exact records. ErrorCodeAmbiguous = datasource.ErrorCodeAmbiguous // ErrorCodeInactive classifies an administratively inactive record. ErrorCodeInactive = datasource.ErrorCodeInactive // ErrorCodeMalformedData classifies invalid persisted data. ErrorCodeMalformedData = datasource.ErrorCodeMalformedData // ErrorCodeLimitExceeded classifies an exceeded resource bound. ErrorCodeLimitExceeded = datasource.ErrorCodeLimitExceeded ErrorCodeUnavailable = datasource.ErrorCodeUnavailable // ErrorCodeUnsupportedPlatform classifies a missing required platform primitive. ErrorCodeUnsupportedPlatform = datasource.ErrorCodeUnsupportedPlatform // ErrorCodeCancelled classifies caller cancellation. ErrorCodeCancelled = datasource.ErrorCodeCancelled // ErrorCodeDeadlineExceeded classifies an elapsed caller deadline. ErrorCodeDeadlineExceeded = datasource.ErrorCodeDeadlineExceeded // ErrorCodeInternalInvariant classifies an impossible provider outcome. ErrorCodeInternalInvariant = datasource.ErrorCodeInternalInvariant )
const ( // AlgorithmRSASHA256 identifies RSA-SHA256 credentials. AlgorithmRSASHA256 = datasource.AlgorithmRSASHA256 // AlgorithmEd25519SHA256 identifies Ed25519-SHA256 credentials. AlgorithmEd25519SHA256 = datasource.AlgorithmEd25519SHA256 // AlgorithmMLDSA44 identifies pure ML-DSA-44 credentials. AlgorithmMLDSA44 = datasource.AlgorithmMLDSA44 )
const ( // ProfileUseOriginator selects an originator profile. ProfileUseOriginator = datasource.ProfileUseOriginator // ProfileUseOrdinaryTransit selects an ordinary-transit profile. ProfileUseOrdinaryTransit = datasource.ProfileUseOrdinaryTransit // ProfileUseNextDomainTransit selects a next-domain profile. ProfileUseNextDomainTransit = datasource.ProfileUseNextDomainTransit // ProfileUseDeliveryStatus selects a delivery-status profile. ProfileUseDeliveryStatus = datasource.ProfileUseDeliveryStatus )
const ( // RecordStatusActive permits an otherwise authorized record. RecordStatusActive = datasource.RecordStatusActive // RecordStatusDisabled closes an administrative record. RecordStatusDisabled = datasource.RecordStatusDisabled )
const ( // RolloutEnforce permits signing after all other checks. RolloutEnforce = datasource.RolloutEnforce // RolloutObserve resolves without permitting signing. RolloutObserve = datasource.RolloutObserve // RolloutOff disables the administrative binding. RolloutOff = datasource.RolloutOff )
const ( // CompatibilityStrict requires the exact provider contract. CompatibilityStrict = datasource.CompatibilityStrict )
Variables ¶
This section is empty.
Functions ¶
func ValidateDomainSelector ¶
ValidateDomainSelector validates one canonical DNS signing identity.
Types ¶
type Algorithm ¶
type Algorithm = datasource.Algorithm
Algorithm identifies one supported signing credential algorithm.
func ParseAlgorithm ¶
ParseAlgorithm accepts exactly one signable credential algorithm token. It is the single owner of algorithm admission for stored credentials.
func SigningAlgorithms ¶
func SigningAlgorithms() []Algorithm
SigningAlgorithms returns the signable credential algorithms in canonical signing order: rsa-sha256, ed25519-sha256, then mldsa44.
type Binding ¶
type Binding struct {
// contains filtered or unexported fields
}
Binding is one opaque datasource-credential to private-signer declaration.
func NewBinding ¶
func NewBinding( tenant string, domain string, use ProfileUse, handleID string, handle dkim2.PrivateKeyHandle, algorithm Algorithm, publicDigest [sha256.Size]byte, ) (Binding, error)
NewBinding validates one exact storage-neutral signing projection binding.
func (Binding) Equivalent ¶
Equivalent reports whether two valid bindings contain the exact same protected projection facts without exposing them.
func (Binding) MarshalJSON ¶
MarshalJSON emits an empty object without binding facts.
type Compatibility ¶
type Compatibility = datasource.Compatibility
Compatibility identifies one closed compatibility policy.
func ParseCompatibility ¶
func ParseCompatibility(value string) (Compatibility, error)
ParseCompatibility parses one exact closed compatibility value.
type Credential ¶
type Credential struct {
// contains filtered or unexported fields
}
Credential contains one immutable public signing credential and opaque handle.
func NewCredential ¶
func NewCredential( selector string, algorithm Algorithm, publicKeySPKI []byte, handleID string, limits Limits, ) (Credential, error)
NewCredential validates and detaches one storage-neutral credential.
func (Credential) Algorithm ¶
func (c Credential) Algorithm() Algorithm
Algorithm returns the credential algorithm.
func (Credential) Format ¶
func (Credential) Format(state fmt.State, _ rune)
Format prevents formatting verbs from exposing credential facts.
func (Credential) GoString ¶
func (Credential) GoString() string
GoString returns a constant protected credential representation.
func (Credential) KeyHandleIDEqual ¶
func (c Credential) KeyHandleIDEqual(value string) bool
KeyHandleIDEqual reports whether the credential owns the exact opaque ID.
func (Credential) MarshalJSON ¶
func (Credential) MarshalJSON() ([]byte, error)
MarshalJSON emits an empty object without credential facts.
func (Credential) PublicKeySPKIDER ¶
func (c Credential) PublicKeySPKIDER() []byte
PublicKeySPKIDER returns detached canonical public SPKI DER.
func (Credential) Selector ¶
func (c Credential) Selector() string
Selector returns the canonical selector.
func (Credential) String ¶
func (Credential) String() string
String returns a constant protected credential summary.
func (Credential) Valid ¶
func (c Credential) Valid() bool
Valid reports whether the credential remains complete.
type Dataset ¶
type Dataset struct {
// contains filtered or unexported fields
}
Dataset is one complete immutable storage-neutral datasource generation.
func NewDataset ¶
func NewDataset( generation uint64, handleIDs []string, profiles []Profile, policies []Policy, limits Limits, ) (*Dataset, error)
NewDataset validates and owns one complete immutable generation.
func (*Dataset) Equivalent ¶
Equivalent reports whether two valid datasets contain the exact same immutable generation facts without exposing those facts.
func (*Dataset) Generation ¶
Generation returns the exact immutable generation number.
func (*Dataset) MarshalJSON ¶
MarshalJSON emits an empty object without dataset facts.
func (*Dataset) NewSigningResolver ¶
NewSigningResolver validates all private registry bindings against this dataset.
func (*Dataset) ResolvePolicy ¶
func (d *Dataset) ResolvePolicy( ctx context.Context, tenant string, domain string, use ProfileUse, at time.Time, ) (Policy, Profile, error)
ResolvePolicy resolves one exact policy and embedded profile without backend I/O.
func (*Dataset) ResolveProfile ¶
func (d *Dataset) ResolveProfile( ctx context.Context, profileID string, use ProfileUse, at time.Time, ) (Profile, error)
ResolveProfile resolves one exact profile without backend I/O.
type ErrorCode ¶
type ErrorCode = datasource.ErrorCode
ErrorCode is one stable storage-neutral datasource failure class.
func ErrorCodeOf ¶
ErrorCodeOf returns the stable direct class for one storage-neutral provider error.
type Limits ¶
type Limits = datasource.Limits
Limits bounds datasource construction and loading work.
func DefaultLimits ¶
func DefaultLimits() Limits
DefaultLimits returns the restrictive default datasource limits.
func HardLimits ¶
func HardLimits() Limits
HardLimits returns every non-widenable datasource maximum.
func ProductionLimits ¶
func ProductionLimits() Limits
ProductionLimits returns the finite large-installation datasource profile.
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
Policy contains one immutable exact administrative profile binding.
func NewPolicy ¶
func NewPolicy( tenant string, domain string, use ProfileUse, profileID string, status RecordStatus, rollout Rollout, compatibility Compatibility, feedbackRouteID string, limits Limits, ) (Policy, error)
NewPolicy validates one exact storage-neutral policy binding.
func (Policy) MarshalJSON ¶
MarshalJSON emits an empty object without policy facts.
func (Policy) SigningDomain ¶
SigningDomain returns the canonical policy signing domain.
type Profile ¶
type Profile struct {
// contains filtered or unexported fields
}
Profile contains one immutable complete datasource signing profile.
func NewProfile ¶
func NewProfile( id string, domain string, status RecordStatus, credentials []Credential, notBefore time.Time, notAfter time.Time, limits Limits, ) (Profile, error)
NewProfile validates and detaches one complete storage-neutral profile.
func (Profile) Credentials ¶
func (p Profile) Credentials() []Credential
Credentials returns detached profile credentials.
func (Profile) MarshalJSON ¶
MarshalJSON emits an empty object without profile facts.
func (Profile) SigningDomain ¶
SigningDomain returns the canonical signing domain.
func (Profile) Status ¶
func (p Profile) Status() RecordStatus
Status returns the closed administrative profile state.
type ProfileUse ¶
type ProfileUse = datasource.ProfileUse
ProfileUse identifies one administrative profile-selection purpose.
func ParseProfileUse ¶
func ParseProfileUse(value string) (ProfileUse, error)
ParseProfileUse parses one exact closed profile-use value.
type RecordStatus ¶
type RecordStatus = datasource.RecordStatus
RecordStatus identifies one administrative record state.
func ParseRecordStatus ¶
func ParseRecordStatus(value string) (RecordStatus, error)
ParseRecordStatus parses one exact closed record status.
type Rollout ¶
type Rollout = datasource.Rollout
Rollout identifies one closed administrative rollout state.
func ParseRollout ¶
ParseRollout parses one exact closed rollout value.
type SigningResolver ¶
type SigningResolver struct {
// contains filtered or unexported fields
}
SigningResolver owns one immutable dataset and its exact signer projection.
func (*SigningResolver) Close ¶
func (r *SigningResolver) Close(ctx context.Context) error
Close releases the immutable signing projection.
func (*SigningResolver) Format ¶
func (*SigningResolver) Format(state fmt.State, _ rune)
Format prevents formatting verbs from exposing resolver facts.
func (*SigningResolver) GoString ¶
func (*SigningResolver) GoString() string
GoString returns a constant protected signing-resolver representation.
func (*SigningResolver) MarshalJSON ¶
func (*SigningResolver) MarshalJSON() ([]byte, error)
MarshalJSON emits an empty object without resolver facts.
func (*SigningResolver) ResolvePolicy ¶
func (r *SigningResolver) ResolvePolicy( ctx context.Context, tenant string, domain string, use ProfileUse, at time.Time, ) (dkim2.SigningProfile, error)
ResolvePolicy resolves one exact policy into the public signing profile.
func (*SigningResolver) String ¶
func (*SigningResolver) String() string
String returns a constant protected signing-resolver summary.