provider

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

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

View Source
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 classifies an unavailable safe snapshot.
	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
)
View Source
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
)
View Source
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
)
View Source
const (
	// RecordStatusActive permits an otherwise authorized record.
	RecordStatusActive = datasource.RecordStatusActive
	// RecordStatusDisabled closes an administrative record.
	RecordStatusDisabled = datasource.RecordStatusDisabled
)
View Source
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
)
View Source
const (
	// CompatibilityStrict requires the exact provider contract.
	CompatibilityStrict = datasource.CompatibilityStrict
)

Variables

This section is empty.

Functions

func NewError

func NewError(code ErrorCode) error

NewError constructs one content-free storage-neutral provider failure.

func ValidateDomainSelector

func ValidateDomainSelector(domain, selector string, algorithm Algorithm) error

ValidateDomainSelector validates one canonical DNS signing identity.

Types

type Algorithm

type Algorithm = datasource.Algorithm

Algorithm identifies one supported signing credential algorithm.

func ParseAlgorithm

func ParseAlgorithm(value string) (Algorithm, error)

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

func (b Binding) Equivalent(other Binding) bool

Equivalent reports whether two valid bindings contain the exact same protected projection facts without exposing them.

func (Binding) Format

func (Binding) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing binding facts.

func (Binding) GoString

func (Binding) GoString() string

GoString returns a constant protected binding representation.

func (Binding) MarshalJSON

func (Binding) MarshalJSON() ([]byte, error)

MarshalJSON emits an empty object without binding facts.

func (Binding) String

func (Binding) String() string

String returns a constant protected binding summary.

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

func (d *Dataset) Equivalent(other *Dataset) bool

Equivalent reports whether two valid datasets contain the exact same immutable generation facts without exposing those facts.

func (*Dataset) Format

func (*Dataset) Format(state fmt.State, _ rune)

Format prevents formatting verbs from traversing dataset state.

func (*Dataset) Generation

func (d *Dataset) Generation() uint64

Generation returns the exact immutable generation number.

func (*Dataset) GoString

func (*Dataset) GoString() string

GoString returns a constant protected dataset representation.

func (*Dataset) MarshalJSON

func (*Dataset) MarshalJSON() ([]byte, error)

MarshalJSON emits an empty object without dataset facts.

func (*Dataset) NewSigningResolver

func (d *Dataset) NewSigningResolver(
	bindings []Binding,
	at time.Time,
) (*SigningResolver, error)

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.

func (*Dataset) String

func (*Dataset) String() string

String returns a constant protected dataset summary.

func (*Dataset) Valid

func (d *Dataset) Valid() bool

Valid reports whether the dataset owns one complete immutable snapshot.

type ErrorCode

type ErrorCode = datasource.ErrorCode

ErrorCode is one stable storage-neutral datasource failure class.

func ErrorCodeOf

func ErrorCodeOf(err error) (code ErrorCode)

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) Format

func (Policy) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing policy facts.

func (Policy) GoString

func (Policy) GoString() string

GoString returns a constant protected policy representation.

func (Policy) MarshalJSON

func (Policy) MarshalJSON() ([]byte, error)

MarshalJSON emits an empty object without policy facts.

func (Policy) SigningDomain

func (p Policy) SigningDomain() string

SigningDomain returns the canonical policy signing domain.

func (Policy) String

func (Policy) String() string

String returns a constant protected policy summary.

func (Policy) Use

func (p Policy) Use() ProfileUse

Use returns the exact administrative use.

func (Policy) Valid

func (p Policy) Valid() bool

Valid reports whether the policy remains complete.

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) Format

func (Profile) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing profile facts.

func (Profile) GoString

func (Profile) GoString() string

GoString returns a constant protected profile representation.

func (Profile) IDMatches

func (p Profile) IDMatches(value string) bool

IDMatches reports whether the profile has the exact opaque profile ID.

func (Profile) MarshalJSON

func (Profile) MarshalJSON() ([]byte, error)

MarshalJSON emits an empty object without profile facts.

func (Profile) SigningDomain

func (p Profile) SigningDomain() string

SigningDomain returns the canonical signing domain.

func (Profile) Status

func (p Profile) Status() RecordStatus

Status returns the closed administrative profile state.

func (Profile) String

func (Profile) String() string

String returns a constant protected profile summary.

func (Profile) Valid

func (p Profile) Valid() bool

Valid reports whether the profile remains complete.

func (Profile) ValidityWindow

func (p Profile) ValidityWindow() (time.Time, time.Time, bool)

ValidityWindow returns the optional half-open UTC validity window.

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

func ParseRollout(value string) (Rollout, error)

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.

Directories

Path Synopsis
Package flatfile exposes the explicit flat-file signing provider adapter.
Package flatfile exposes the explicit flat-file signing provider adapter.

Jump to

Keyboard shortcuts

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