policy

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: 3 Imported by: 0

Documentation

Overview

Package policy owns deterministic local decisions over sealed DKIM2 verification facts. Policy verdicts remain separate from the authoritative PASS, FAIL, PERMERROR, and TEMPERROR verification states.

Strict policy is the default. Permissive and testing modes are explicit, and continue is a non-terminal disposition rather than accept or PASS. Current verifier projections authenticate only the current passing hop. Draft-07 Section 10.10 removed the donotmodify and donotexplode flags; received spellings are inert unknown flags, so authenticated hop flags never produce compliance findings or change the verdict. Authenticated exploded markers are reported as informational findings only.

Feedback is bounded intent only. Feedhere requires an authenticated feedback request at the same or a lower sequence and exposes no route. The DNS key record t= tag is retired by draft-ietf-dkim-dkim2-dns-02 Section 3.4.1 and carries no policy meaning; only the explicitly configured local testing mode relaxes the verdict. Evaluation never reparses messages or public facts, returns exactly one action on success, and exposes no message, identity, key, provider, or route material.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrorCode

func IsErrorCode(err error, code ErrorCode) bool

IsErrorCode reports whether err carries the requested closed code.

Types

type Action

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

Action stores one immutable local disposition.

func (Action) Kind

func (a Action) Kind() ActionKind

Kind returns the closed disposition action kind.

func (Action) Valid

func (a Action) Valid() bool

Valid reports whether the action belongs to the closed vocabulary.

type ActionKind

type ActionKind string

ActionKind identifies the single disposition action matching a verdict.

const (
	// ActionAccept matches an accept verdict.
	ActionAccept ActionKind = "accept"
	// ActionReject matches a reject verdict.
	ActionReject ActionKind = "reject"
	// ActionTempfail matches a temporary-failure verdict.
	ActionTempfail ActionKind = "tempfail"
	// ActionContinue matches a non-terminal continue verdict.
	ActionContinue ActionKind = "continue"
)

func (ActionKind) Known

func (a ActionKind) Known() bool

Known reports whether the action belongs to the closed policy vocabulary.

type Config

type Config struct {
	Mode   Mode
	Limits Limits
}

Config contains immutable evaluator policy and resource limits.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns strict policy with hard-bounded defaults.

func (Config) Validate

func (c Config) Validate() error

Validate rejects unknown mode or unsafe limits.

type Decision

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

Decision stores one immutable local policy outcome separate from verification.

func (Decision) Actions

func (d Decision) Actions() []Action

Actions returns an independent copy containing one disposition action.

func (Decision) FeedbackIntent

func (d Decision) FeedbackIntent() FeedbackIntent

FeedbackIntent returns bounded authenticated feedback intent by value.

func (Decision) Findings

func (d Decision) Findings() []Finding

Findings returns an independent ordered copy of policy findings.

func (Decision) IsZero

func (d Decision) IsZero() bool

IsZero reports whether the decision carries no initialized policy state.

func (Decision) Mode

func (d Decision) Mode() Mode

Mode returns the explicit local policy mode.

func (Decision) PrimaryReason

func (d Decision) PrimaryReason() PolicyReason

PrimaryReason returns the deterministic decision reason.

func (Decision) Protocol

func (d Decision) Protocol() ProtocolClass

Protocol returns the unchanged authoritative verification class.

func (Decision) Valid

func (d Decision) Valid() bool

Valid reports whether decision state satisfies closed base invariants.

func (Decision) Verdict

func (d Decision) Verdict() Verdict

Verdict returns the separate local policy verdict.

type Error

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

Error stores bounded cause-free policy failure metadata.

func (*Error) Code

func (e *Error) Code() ErrorCode

Code returns the closed policy error code.

func (*Error) ConfiguredLimit

func (e *Error) ConfiguredLimit() int

ConfiguredLimit returns the configured limit without input content.

func (*Error) Error

func (e *Error) Error() string

Error returns a stable diagnostic without policy or message input.

func (*Error) Is

func (e *Error) Is(target error) bool

Is supports errors.Is matching by closed error code.

func (*Error) LimitName

func (e *Error) LimitName() string

LimitName returns the allowlisted configured limit name.

func (*Error) ObservedCount

func (e *Error) ObservedCount() int

ObservedCount returns the bounded observed count.

type ErrorCode

type ErrorCode string

ErrorCode identifies one bounded policy API failure.

const (
	// ErrorInvalidConfig reports unknown or unsafe evaluator configuration.
	ErrorInvalidConfig ErrorCode = "invalid_config"
	// ErrorInvalidInput reports unknown or incoherent policy input.
	ErrorInvalidInput ErrorCode = "invalid_input"
	// ErrorLimitExceeded reports a configured policy resource limit.
	ErrorLimitExceeded ErrorCode = "limit_exceeded"
	// ErrorInternalContract reports impossible internal policy state.
	ErrorInternalContract ErrorCode = "internal_contract"
)

func (ErrorCode) Known

func (c ErrorCode) Known() bool

Known reports whether the code belongs to the closed error vocabulary.

type Evaluator

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

Evaluator applies deterministic local policy over sealed verification facts.

func NewEvaluator

func NewEvaluator(config Config) (Evaluator, error)

NewEvaluator validates and constructs one immutable policy evaluator.

func (Evaluator) EvaluateAuthenticationProjection

func (e Evaluator) EvaluateAuthenticationProjection(projection Projection, protocol ProtocolClass) (Decision, error)

EvaluateAuthenticationProjection applies non-overridable replay failure after deriving authenticated policy facts.

func (Evaluator) EvaluateProjection

func (e Evaluator) EvaluateProjection(projection Projection) (Decision, error)

EvaluateProjection applies policy to one service-sealed internal projection.

type FeedbackIntent

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

FeedbackIntent stores bounded authenticated feedback routing intent.

func (FeedbackIntent) HistoryCoverage

func (i FeedbackIntent) HistoryCoverage() HistoryCoverage

HistoryCoverage returns the explicit feedback-history coverage.

func (FeedbackIntent) RelayRequired

func (i FeedbackIntent) RelayRequired() bool

RelayRequired reports whether an authenticated eligible relay exists.

func (FeedbackIntent) RelaySequence

func (i FeedbackIntent) RelaySequence() uint64

RelaySequence returns the highest eligible relay sequence or zero.

func (FeedbackIntent) Requested

func (i FeedbackIntent) Requested() bool

Requested reports whether authenticated feedback was requested.

func (FeedbackIntent) Valid

func (i FeedbackIntent) Valid() bool

Valid reports whether feedback intent is internally coherent.

type Finding

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

Finding records one bounded deterministic policy fact.

func (Finding) Reason

func (f Finding) Reason() PolicyReason

Reason returns the closed finding reason.

func (Finding) Sequence

func (f Finding) Sequence() (uint64, bool)

Sequence returns the optional authenticated sequence and presence flag.

func (Finding) Severity

func (f Finding) Severity() FindingSeverity

Severity returns the frozen severity for the reason.

func (Finding) Valid

func (f Finding) Valid() bool

Valid reports whether finding fields satisfy frozen coherence rules.

type FindingSeverity

type FindingSeverity string

FindingSeverity identifies one bounded policy finding severity.

const (
	// SeverityInfo reports informational authenticated state.
	SeverityInfo FindingSeverity = "info"
	// SeverityWarning reports non-terminal policy concern or override.
	SeverityWarning FindingSeverity = "warning"
	// SeverityPermanent reports a permanent failure or violation.
	SeverityPermanent FindingSeverity = "permanent"
	// SeverityTemporary reports a retryable verification failure.
	SeverityTemporary FindingSeverity = "temporary"
)

func (FindingSeverity) Known

func (s FindingSeverity) Known() bool

Known reports whether the severity belongs to the closed vocabulary.

type HistoryCoverage

type HistoryCoverage string

HistoryCoverage identifies the authenticated history represented by a projection.

const (
	// HistoryNotEvaluated records the current verifier's deliberately unevaluated history.
	HistoryNotEvaluated HistoryCoverage = "not_evaluated"
	// HistoryComplete records exact contiguous authenticated coverage through the target.
	HistoryComplete HistoryCoverage = "complete"
	// HistoryIndeterminate records explicitly partial authenticated coverage.
	HistoryIndeterminate HistoryCoverage = "indeterminate"
)

func (HistoryCoverage) Known

func (h HistoryCoverage) Known() bool

Known reports whether coverage belongs to the closed vocabulary.

type HopFact

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

HopFact stores one authenticated flag and transition fact.

func NewAuthenticatedHopFact

func NewAuthenticatedHopFact(sequence uint64, transition TransitionState, feedback, feedHere, exploded bool) (HopFact, error)

NewAuthenticatedHopFact constructs one authenticated fact for service-owned minting.

func (HopFact) Exploded

func (h HopFact) Exploded() bool

Exploded reports the authenticated exploded marker.

func (HopFact) FeedHere

func (h HopFact) FeedHere() bool

FeedHere reports the authenticated relay preference.

func (HopFact) Feedback

func (h HopFact) Feedback() bool

Feedback reports the authenticated feedback request.

func (HopFact) Sequence

func (h HopFact) Sequence() uint64

Sequence returns the authenticated signature sequence.

func (HopFact) Transition

func (h HopFact) Transition() TransitionState

Transition returns the authenticated transition state.

func (HopFact) Valid

func (h HopFact) Valid() bool

Valid reports whether the authenticated fact is structurally bounded.

type Limits

type Limits struct {
	MaxAuthenticatedHops int
	MaxFindings          int
	MaxActions           int
}

Limits bounds authenticated facts and retained policy output.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns the restrictive policy hard maxima.

func (Limits) Validate

func (l Limits) Validate() error

Validate rejects zero, negative, or widening policy limits.

type Mode

type Mode string

Mode identifies one explicit local policy posture.

const (
	// ModeStrict enforces DKIM2 failure and proven policy violations.
	ModeStrict Mode = "strict"
	// ModePermissive accepts permanent DKIM2 failure while retaining findings.
	ModePermissive Mode = "permissive"
	// ModeTesting observes DKIM2 outcomes without a terminal DKIM2 decision.
	ModeTesting Mode = "testing"
)

func (Mode) Known

func (m Mode) Known() bool

Known reports whether the mode belongs to the closed policy vocabulary.

type PolicyReason

type PolicyReason string

PolicyReason identifies one closed decision, finding, or error reason.

const (
	ReasonInvalidInput                  PolicyReason = "invalid_input"
	ReasonLimitExceeded                 PolicyReason = "limit_exceeded"
	ReasonInternalContract              PolicyReason = "internal_contract"
	ReasonProtocolPass                  PolicyReason = "protocol_pass"
	ReasonProtocolFail                  PolicyReason = "protocol_fail"
	ReasonProtocolPermerror             PolicyReason = "protocol_permerror"
	ReasonProtocolTemperror             PolicyReason = "protocol_temperror"
	ReasonPermissiveOverride            PolicyReason = "permissive_override"
	ReasonTestingModeObserve            PolicyReason = "testing_mode_observe"
	ReasonFeedbackRequested             PolicyReason = "feedback_requested"
	ReasonFeedbackRelaySelected         PolicyReason = "feedback_relay_selected"
	ReasonFeedHereInert                 PolicyReason = "feedhere_inert"
	ReasonExplodedReported              PolicyReason = "exploded_reported"
	ReasonReceivedDSNOuterPolicy        PolicyReason = "received_dsn_outer_policy"
	ReasonReceivedDSNStructureInvalid   PolicyReason = "received_dsn_structure_invalid"
	ReasonReceivedDSNEmbeddedUnverified PolicyReason = "received_dsn_embedded_unverified"
	ReasonReceivedDSNEmbeddedAbsent     PolicyReason = "received_dsn_embedded_absent"
	ReasonReceivedDSNTemporaryFailure   PolicyReason = "received_dsn_temporary_failure"
	ReasonReceivedDSNTenantUnavailable  PolicyReason = "received_dsn_tenant_unavailable"
	ReasonReceivedDSNIdentityMismatch   PolicyReason = "received_dsn_identity_mismatch"
	ReasonReceivedDSNNotLocal           PolicyReason = "received_dsn_not_local"
	ReasonReceivedDSNRecipientUnlinked  PolicyReason = "received_dsn_recipient_unlinked"
	ReasonReceivedDSNLinked             PolicyReason = "received_dsn_linked"
)

Frozen policy reason constants shared by decisions, findings, and errors.

func (PolicyReason) Known

func (r PolicyReason) Known() bool

Known reports whether the reason belongs to the frozen policy vocabulary.

type PreTargetReason

type PreTargetReason string

PreTargetReason identifies why no authoritative target was available.

const (
	// PreTargetLimitExceeded reports a pre-target resource limit.
	PreTargetLimitExceeded PreTargetReason = "limit_exceeded"
	// PreTargetMalformedMessage reports malformed RFC 5322 input.
	PreTargetMalformedMessage PreTargetReason = "malformed_message"
	// PreTargetMalformedProtocol reports malformed DKIM2 input.
	PreTargetMalformedProtocol PreTargetReason = "malformed_protocol"
	// PreTargetDuplicateHashAlgorithm reports a repeated h= algorithm before target selection.
	PreTargetDuplicateHashAlgorithm PreTargetReason = "duplicate_hash_algorithm"
	// PreTargetDuplicateSelector reports a repeated selector before target selection.
	PreTargetDuplicateSelector PreTargetReason = "duplicate_selector"
	// PreTargetMissingProtocol reports absent required DKIM2 state.
	PreTargetMissingProtocol PreTargetReason = "missing_protocol"
	// PreTargetSequenceInvalid reports invalid DKIM2 sequencing.
	PreTargetSequenceInvalid PreTargetReason = "sequence_invalid"
	// PreTargetInternalContract reports an impossible internal state.
	PreTargetInternalContract PreTargetReason = "internal_contract"
)

func (PreTargetReason) Known

func (r PreTargetReason) Known() bool

Known reports whether reason belongs to the closed pre-target vocabulary.

type Projection

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

Projection is an immutable authenticated policy input sealed by verification service code.

func NewChainFailureProjection

func NewChainFailureProjection(reason VerificationReason, target uint64) (Projection, error)

NewChainFailureProjection seals a selected target whose Draft-09 Section 14.4 Chain of Custody check failed before any signature was evaluated. The result is FAIL with custody_mismatch, next_domain_mismatch, or domain_alignment_mismatch; it carries no signature facts and no authenticated hops, so no policy finding can be derived from unverified flags.

func NewGroupedSelectedProjection

func NewGroupedSelectedProjection(protocol ProtocolClass, reason VerificationReason, target uint64, hops []HopFact, signatures []SignatureFact, layout combine.Layout, limits Limits) (Projection, error)

NewGroupedSelectedProjection seals a selected target whose signature facts are in field order under the parsed Draft-09 sig-any/sig-all layout. The layout lets validation recompute the Section 14.6 combination exactly. The target hash combination is recorded as checkable, so an unsupported_algorithm reason must come from the decisive set.

func NewGroupedSelectedTargetProjection

func NewGroupedSelectedTargetProjection(protocol ProtocolClass, reason VerificationReason, target uint64, hops []HopFact, signatures []SignatureFact, layout combine.Layout, hash TargetHash, limits Limits) (Projection, error)

NewGroupedSelectedTargetProjection seals a selected target like NewGroupedSelectedProjection and additionally records the target hash class, the only non-set source of a PERMERROR unsupported_algorithm.

func NewHistoricalProjection

func NewHistoricalProjection(target uint64, coverage HistoryCoverage, hops []HopFact, limits Limits) (Projection, error)

NewHistoricalProjection constructs an authenticated all-hop policy projection.

func NewRevisionFailureProjection

func NewRevisionFailureProjection(protocol ProtocolClass, reason VerificationReason, current Projection, limits Limits) (Projection, error)

NewRevisionFailureProjection seals a selected target whose current signature sets passed before inherited history failed.

func NewSelectedProjection

func NewSelectedProjection(protocol ProtocolClass, reason VerificationReason, target uint64, hops []HopFact, signatures []SignatureFact, limits Limits) (Projection, error)

NewSelectedProjection seals a selected target with aggregate reason provenance whose signature facts form one sig-all group, the layout of an s= value without "|".

func NewUnavailableProjection

func NewUnavailableProjection(reason PreTargetReason) (Projection, error)

NewUnavailableProjection seals one exact pre-target permanent-error projection.

func (Projection) Clone

func (p Projection) Clone() Projection

Clone returns an independent projection value with cloned collections.

func (Projection) CompleteOriginHistory

func (p Projection) CompleteOriginHistory(limits Limits) (Projection, error)

CompleteOriginHistory atomically upgrades authenticated current origin evidence to complete one-hop history.

func (Projection) Form

func (p Projection) Form() TargetForm

Form returns the exact target form.

func (Projection) HistoryCoverage

func (p Projection) HistoryCoverage() HistoryCoverage

HistoryCoverage returns the authenticated history coverage state.

func (Projection) Hops

func (p Projection) Hops() []HopFact

Hops returns an independent authenticated-fact clone.

func (Projection) IsZero

func (p Projection) IsZero() bool

IsZero reports whether the projection is uninitialized.

func (Projection) PreTargetReason

func (p Projection) PreTargetReason() PreTargetReason

PreTargetReason returns the bounded unavailable-target reason.

func (Projection) Protocol

func (p Projection) Protocol() ProtocolClass

Protocol returns the authoritative protocol class.

func (Projection) ReceivedDSN

func (p Projection) ReceivedDSN() (ReceivedDSNFacts, bool)

ReceivedDSN returns the received-DSN facts and whether the projection carries them.

func (Projection) SignatureFacts

func (p Projection) SignatureFacts() []SignatureFact

SignatureFacts returns an independent pre-retention signature-fact clone.

func (Projection) TargetSequence

func (p Projection) TargetSequence() uint64

TargetSequence returns the authoritative target sequence.

func (Projection) Valid

func (p Projection) Valid() bool

Valid reports whether the projection satisfies hard-limit invariants.

func (Projection) VerificationReason

func (p Projection) VerificationReason() VerificationReason

VerificationReason returns the authoritative aggregate reason for selected targets.

func (Projection) WithReceivedDSN

func (p Projection) WithReceivedDSN(facts ReceivedDSNFacts) (Projection, error)

WithReceivedDSN returns a copy of the sealed verification projection that also carries the closed received-DSN facts of the same inbound message, so that one evaluation yields one decision covering both.

type ProtocolClass

type ProtocolClass string

ProtocolClass mirrors one authoritative four-state verification outcome.

const (
	// ProtocolPASS reports successful verification.
	ProtocolPASS ProtocolClass = "PASS"
	// ProtocolFAIL reports a supported integrity mismatch.
	ProtocolFAIL ProtocolClass = "FAIL"
	// ProtocolPERMERROR reports a permanent verification error.
	ProtocolPERMERROR ProtocolClass = "PERMERROR"
	// ProtocolTEMPERROR reports a temporary verification error.
	ProtocolTEMPERROR ProtocolClass = "TEMPERROR"
)

func ProtocolForVerificationReason

func ProtocolForVerificationReason(reason VerificationReason) (ProtocolClass, bool)

ProtocolForVerificationReason is the single owner of the Draft-09 Section 14.1 state of every verification reason. PASS carries only none. FAIL means verification completed and the message is not a Fully Verified DKIM2 Message: hash and signature mismatches (Sections 14.6 and 14.7), timestamp failures (14.3), Chain of Custody failures including the envelope, MAIL FROM and d= alignment, next-domain, custody adjacency, and unmet out-of-band arrangements (14.4 and 13.2), an inauthentic From, and a From whose strict Domain Policy Record forbids subdomain signing (14.8 and 3.8). TEMPERROR is a temporary inability to retrieve a DNS record (14.1): a temporary key-provider failure or an unavailable Domain Policy Record (3.8). Every other reason, including malformed, missing, duplicate, sequence, algorithm, key, Recipe, limit, and internal failures (14.2 and 14.5), multiple Domain Policy Records (3.8), and an invalid Domain Policy Record (local interpretation D1), is PERMERROR; a history whose body cannot be checked below a null Recipe is the Section 14.2 "has a null recipe" PERMERROR.

func (ProtocolClass) Known

func (p ProtocolClass) Known() bool

Known reports whether the class belongs to the closed verification vocabulary.

type ReceivedDSNEmbedded

type ReceivedDSNEmbedded string

ReceivedDSNEmbedded mirrors the closed embedded member of a received-DSN evaluation.

const (
	// ReceivedDSNEmbeddedVerified reports a verified complete embedded original.
	ReceivedDSNEmbeddedVerified ReceivedDSNEmbedded = "verified"
	// ReceivedDSNEmbeddedVerifiedHeadersOnly reports verified header-only embedded evidence.
	ReceivedDSNEmbeddedVerifiedHeadersOnly ReceivedDSNEmbedded = "verified_headers_only"
	// ReceivedDSNEmbeddedUnverified reports permanent embedded verification failure.
	ReceivedDSNEmbeddedUnverified ReceivedDSNEmbedded = "unverified"
	// ReceivedDSNEmbeddedTemperror reports a temporary DNS or key failure.
	ReceivedDSNEmbeddedTemperror ReceivedDSNEmbedded = "temperror"
	// ReceivedDSNEmbeddedAbsent reports an embedded original without any DKIM2-Signature.
	ReceivedDSNEmbeddedAbsent ReceivedDSNEmbedded = "absent"
	// ReceivedDSNEmbeddedNotEvaluated reports that the structure stage stopped
	// the evaluation before any embedded evidence could be assessed.
	ReceivedDSNEmbeddedNotEvaluated ReceivedDSNEmbedded = "not_evaluated"
)

func (ReceivedDSNEmbedded) Known

func (e ReceivedDSNEmbedded) Known() bool

Known reports whether the value belongs to the closed vocabulary.

type ReceivedDSNFacts

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

ReceivedDSNFacts is the immutable, content-free projection of one received-DSN evaluation that the policy engine maps through the received-DSN row table. It carries only the closed stage members; propagation is informational and never a policy input.

func NewReceivedDSNFacts

NewReceivedDSNFacts seals one stage-coherent received-DSN projection.

func (ReceivedDSNFacts) Embedded

Embedded returns the closed embedded member, which is ReceivedDSNEmbeddedNotEvaluated when the structure stage stopped the evaluation.

func (ReceivedDSNFacts) LocalHop

LocalHop returns the closed local_hop member.

func (ReceivedDSNFacts) OuterAlignment

func (f ReceivedDSNFacts) OuterAlignment() ReceivedDSNOuterAlignment

OuterAlignment returns the closed outer_alignment member.

func (ReceivedDSNFacts) RecipientLinkage

func (f ReceivedDSNFacts) RecipientLinkage() ReceivedDSNRecipientLinkage

RecipientLinkage returns the closed recipient_linkage member.

func (ReceivedDSNFacts) Structure

func (f ReceivedDSNFacts) Structure() ReceivedDSNStructure

Structure returns the closed structure member.

func (ReceivedDSNFacts) Valid

func (f ReceivedDSNFacts) Valid() bool

Valid reports whether the members are known and coherent with the stop-at-first-failure stage order of the evaluation.

type ReceivedDSNLocalHop

type ReceivedDSNLocalHop string

ReceivedDSNLocalHop mirrors the closed local_hop member of a received-DSN evaluation.

const (
	// ReceivedDSNLocalHopLocal reports a verified, datasource-local completion signature bound to the outer recipient.
	ReceivedDSNLocalHopLocal ReceivedDSNLocalHop = "local"
	// ReceivedDSNLocalHopNotLocal reports a completion signature under a domain the tenant does not control.
	ReceivedDSNLocalHopNotLocal ReceivedDSNLocalHop = "not_local"
	// ReceivedDSNLocalHopMismatch reports a local domain whose mf= does not bind to the outer recipient or its d=.
	ReceivedDSNLocalHopMismatch ReceivedDSNLocalHop = "mismatch"
	// ReceivedDSNLocalHopTemperror reports a temporary datasource failure.
	ReceivedDSNLocalHopTemperror ReceivedDSNLocalHop = "temperror"
	// ReceivedDSNLocalHopNotEvaluated reports that an earlier stage stopped or that no tenant was available.
	ReceivedDSNLocalHopNotEvaluated ReceivedDSNLocalHop = "not_evaluated"
)

func (ReceivedDSNLocalHop) Known

func (l ReceivedDSNLocalHop) Known() bool

Known reports whether the value belongs to the closed vocabulary.

type ReceivedDSNOuterAlignment

type ReceivedDSNOuterAlignment string

ReceivedDSNOuterAlignment mirrors the closed outer_alignment member of a received-DSN evaluation.

const (
	// ReceivedDSNOuterAlignmentAligned reports that the outer signer relaxed-matches a completion rt= domain.
	ReceivedDSNOuterAlignmentAligned ReceivedDSNOuterAlignment = "aligned"
	// ReceivedDSNOuterAlignmentMisaligned reports that no completion rt= domain relaxed-matches the outer signer.
	ReceivedDSNOuterAlignmentMisaligned ReceivedDSNOuterAlignment = "misaligned"
	// ReceivedDSNOuterAlignmentNotEvaluated reports that an earlier stage stopped the evaluation.
	ReceivedDSNOuterAlignmentNotEvaluated ReceivedDSNOuterAlignment = "not_evaluated"
)

func (ReceivedDSNOuterAlignment) Known

func (a ReceivedDSNOuterAlignment) Known() bool

Known reports whether the value belongs to the closed vocabulary.

type ReceivedDSNRecipientLinkage

type ReceivedDSNRecipientLinkage string

ReceivedDSNRecipientLinkage mirrors the closed recipient_linkage member of a received-DSN evaluation.

const (
	// ReceivedDSNRecipientLinkageLinked reports at least one recipient group naming an authenticated completion rt= path.
	ReceivedDSNRecipientLinkageLinked ReceivedDSNRecipientLinkage = "linked"
	// ReceivedDSNRecipientLinkageUnlinked reports that no recipient group names an authenticated completion rt= path.
	ReceivedDSNRecipientLinkageUnlinked ReceivedDSNRecipientLinkage = "unlinked"
	// ReceivedDSNRecipientLinkageNotEvaluated reports that an earlier stage stopped the evaluation.
	ReceivedDSNRecipientLinkageNotEvaluated ReceivedDSNRecipientLinkage = "not_evaluated"
)

func (ReceivedDSNRecipientLinkage) Known

Known reports whether the value belongs to the closed vocabulary.

type ReceivedDSNStructure

type ReceivedDSNStructure string

ReceivedDSNStructure mirrors the closed structure member of a received-DSN evaluation.

const (
	// ReceivedDSNStructureValid reports exact RFC 6522 framing and a strict RFC 3464 body.
	ReceivedDSNStructureValid ReceivedDSNStructure = "valid"
	// ReceivedDSNStructureMalformed reports framing or delivery-status syntax outside the profile.
	ReceivedDSNStructureMalformed ReceivedDSNStructure = "malformed"
	// ReceivedDSNStructureLimitExceeded reports a DSN parser resource limit violation.
	ReceivedDSNStructureLimitExceeded ReceivedDSNStructure = "limit_exceeded"
)

func (ReceivedDSNStructure) Known

func (s ReceivedDSNStructure) Known() bool

Known reports whether the value belongs to the closed vocabulary.

type SetAlgorithm

type SetAlgorithm string

SetAlgorithm identifies a bounded signature algorithm family.

const (
	// SetAlgorithmRSA identifies RSA-SHA256.
	SetAlgorithmRSA SetAlgorithm = "rsa-sha256"
	// SetAlgorithmEd25519 identifies Ed25519-SHA256.
	SetAlgorithmEd25519 SetAlgorithm = "ed25519-sha256"
	// SetAlgorithmMLDSA44 identifies pure ML-DSA-44.
	SetAlgorithmMLDSA44 SetAlgorithm = "mldsa44"
	// SetAlgorithmUnknown identifies an unknown algorithm.
	SetAlgorithmUnknown SetAlgorithm = "unknown"
)

func (SetAlgorithm) Known

func (a SetAlgorithm) Known() bool

Known reports whether algorithm belongs to the closed vocabulary.

type SetReason

type SetReason string

SetReason identifies a bounded signature-set reason.

const (
	SetReasonNone                 SetReason = "none"
	SetReasonSignatureMismatch    SetReason = "signature_mismatch"
	SetReasonUnsupportedAlgorithm SetReason = "unsupported_algorithm"
	SetReasonMissingKey           SetReason = "missing_key"
	SetReasonInvalidKey           SetReason = "invalid_key"
	SetReasonAmbiguousKey         SetReason = "ambiguous_key"
	SetReasonRevokedKey           SetReason = "revoked_key"
	SetReasonUnsupportedKeyType   SetReason = "unsupported_key_type"
	SetReasonKeyAlgorithmMismatch SetReason = "key_algorithm_mismatch"
	SetReasonProviderTemporary    SetReason = "provider_temporary"
	SetReasonProviderPermanent    SetReason = "provider_permanent"
	SetReasonProviderContract     SetReason = "provider_contract"
	SetReasonInternalContract     SetReason = "internal_contract"
)

Closed signature-set reason constants retained by the policy projection.

func (SetReason) Known

func (r SetReason) Known() bool

Known reports whether reason belongs to the closed signature-set vocabulary.

type SetStatus

type SetStatus string

SetStatus identifies one sealed signature-set outcome.

const (
	// SetStatusPass reports a supported signature pass.
	SetStatusPass SetStatus = "pass"
	// SetStatusFail reports a supported signature mismatch.
	SetStatusFail SetStatus = "fail"
	// SetStatusPermerror reports a permanent set failure.
	SetStatusPermerror SetStatus = "permerror"
	// SetStatusTemperror reports a temporary provider failure.
	SetStatusTemperror SetStatus = "temperror"
)

func (SetStatus) Known

func (s SetStatus) Known() bool

Known reports whether status belongs to the closed vocabulary.

type SignatureFact

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

SignatureFact stores bounded pre-retention signature-set outcome facts.

func NewSignatureFact

func NewSignatureFact(algorithm SetAlgorithm, status SetStatus, reason SetReason) (SignatureFact, error)

NewSignatureFact constructs one coherent sealed signature-set fact.

func (SignatureFact) Algorithm

func (f SignatureFact) Algorithm() SetAlgorithm

Algorithm returns the bounded algorithm family.

func (SignatureFact) Reason

func (f SignatureFact) Reason() SetReason

Reason returns the bounded set reason.

func (SignatureFact) Status

func (f SignatureFact) Status() SetStatus

Status returns the bounded set outcome.

func (SignatureFact) Valid

func (f SignatureFact) Valid() bool

Valid reports whether the fact has coherent closed dimensions.

type TargetForm

type TargetForm string

TargetForm identifies whether verification selected an authoritative target.

const (
	// TargetSelected reports a positive authoritative target sequence.
	TargetSelected TargetForm = "target_selected"
	// TargetUnavailable reports a bounded pre-target permanent result.
	TargetUnavailable TargetForm = "target_unavailable"
)

func (TargetForm) Known

func (t TargetForm) Known() bool

Known reports whether the target form belongs to the closed vocabulary.

type TargetHash

type TargetHash string

TargetHash is the sealed class of the selected target's Draft-09 Section 14.7 hash combination as far as the aggregate reason depends on it.

const (
	// TargetHashCheckable reports a hash combination that is PASS or FAIL.
	TargetHashCheckable TargetHash = "checkable"
	// TargetHashUnsupported reports a PERMERROR hash combination: no
	// hash-all group of implemented algorithms decided it.
	TargetHashUnsupported TargetHash = "unsupported"
)

func (TargetHash) Known

func (h TargetHash) Known() bool

Known reports whether h belongs to the closed vocabulary.

type TransitionState

type TransitionState string

TransitionState identifies one authenticated message-state transition.

const (
	// TransitionOrigin identifies the first authenticated message state.
	TransitionOrigin TransitionState = "origin"
	// TransitionUnchanged reports no covered content change.
	TransitionUnchanged TransitionState = "unchanged"
	// TransitionBodyChanged reports a body-hash-changing transition.
	TransitionBodyChanged TransitionState = "body_changed"
	// TransitionHeadersChanged reports removed or changed header fields.
	TransitionHeadersChanged TransitionState = "headers_removed_or_changed"
	// TransitionBodyAndHeadersChanged reports both prohibited change classes.
	TransitionBodyAndHeadersChanged TransitionState = "body_and_headers_changed"
	// TransitionHeaderAdditionOnly reports only permitted header additions.
	TransitionHeaderAdditionOnly TransitionState = "header_addition_only"
	// TransitionIndeterminate reports incomplete transition evidence.
	TransitionIndeterminate TransitionState = "indeterminate"
	// TransitionNotEvaluated reports that transition evaluation did not run.
	TransitionNotEvaluated TransitionState = "not_evaluated"
)

func (TransitionState) Known

func (s TransitionState) Known() bool

Known reports whether the transition belongs to the closed vocabulary.

type Verdict

type Verdict string

Verdict identifies one local policy disposition.

const (
	// VerdictAccept authorizes normal continuation under DKIM2 policy.
	VerdictAccept Verdict = "accept"
	// VerdictReject reports permanent local-policy rejection.
	VerdictReject Verdict = "reject"
	// VerdictTempfail reports temporary SMTP deferral.
	VerdictTempfail Verdict = "tempfail"
	// VerdictContinue withholds a terminal DKIM2 decision.
	VerdictContinue Verdict = "continue"
)

func (Verdict) Known

func (v Verdict) Known() bool

Known reports whether the verdict belongs to the closed policy vocabulary.

type VerificationReason

type VerificationReason string

VerificationReason identifies the authoritative aggregate verification reason.

const (
	VerificationReasonNone                    VerificationReason = "none"
	VerificationReasonLimitExceeded           VerificationReason = "limit_exceeded"
	VerificationReasonMalformedMessage        VerificationReason = "malformed_message"
	VerificationReasonMalformedProtocol       VerificationReason = "malformed_protocol"
	VerificationReasonDuplicateHashAlgorithm  VerificationReason = "duplicate_hash_algorithm"
	VerificationReasonInvalidRecipeJSON       VerificationReason = "invalid_recipe_json"
	VerificationReasonInvalidRecipe           VerificationReason = "invalid_recipe"
	VerificationReasonFromNotAuthentic        VerificationReason = "from_not_authentic"
	VerificationReasonFromSubdomainForbidden  VerificationReason = "from_subdomain_forbidden"
	VerificationReasonDomainPolicyTemporary   VerificationReason = "domain_policy_temporary"
	VerificationReasonDomainPolicyAmbiguous   VerificationReason = "domain_policy_ambiguous"
	VerificationReasonDomainPolicyInvalid     VerificationReason = "domain_policy_invalid"
	VerificationReasonDuplicateSelector       VerificationReason = "duplicate_selector"
	VerificationReasonMissingProtocol         VerificationReason = "missing_protocol"
	VerificationReasonSequenceInvalid         VerificationReason = "sequence_invalid"
	VerificationReasonUnsupportedAlgorithm    VerificationReason = "unsupported_algorithm"
	VerificationReasonHashMismatch            VerificationReason = "hash_mismatch"
	VerificationReasonSignatureMismatch       VerificationReason = "signature_mismatch"
	VerificationReasonMissingKey              VerificationReason = "missing_key"
	VerificationReasonInvalidKey              VerificationReason = "invalid_key"
	VerificationReasonAmbiguousKey            VerificationReason = "ambiguous_key"
	VerificationReasonRevokedKey              VerificationReason = "revoked_key"
	VerificationReasonUnsupportedKeyType      VerificationReason = "unsupported_key_type"
	VerificationReasonKeyAlgorithmMismatch    VerificationReason = "key_algorithm_mismatch"
	VerificationReasonProviderTemporary       VerificationReason = "provider_temporary"
	VerificationReasonProviderPermanent       VerificationReason = "provider_permanent"
	VerificationReasonProviderContract        VerificationReason = "provider_contract"
	VerificationReasonTimestampInvalid        VerificationReason = "timestamp_invalid"
	VerificationReasonEnvelopeMismatch        VerificationReason = "envelope_mismatch"
	VerificationReasonDomainAlignmentMismatch VerificationReason = "domain_alignment_mismatch"
	VerificationReasonNextDomainMismatch      VerificationReason = "next_domain_mismatch"
	VerificationReasonCustodyMismatch         VerificationReason = "custody_mismatch"
	VerificationReasonOutOfBandRequired       VerificationReason = "out_of_band_required"
	VerificationReasonBodyHistoryUnavailable  VerificationReason = "body_history_unavailable"
	VerificationReasonInternalContract        VerificationReason = "internal_contract"
)

Closed verification reason constants mirrored from service verification outcomes.

func (VerificationReason) Known

func (r VerificationReason) Known() bool

Known reports whether reason belongs to the closed verification vocabulary.

Jump to

Keyboard shortcuts

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