| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Pipeline.Internal
Description
Integrity admission, metric projections, and the denial audit trail that the packument and tarball handlers share and their specs reach directly. Importing this module opts out of the stability promise of the public hub, Ecluse.Core.Server.Pipeline.
The module field on every line emitted here is pipelineInternalModule, a fixed operator
filter key rather than the source module path.
Synopsis
- pipelineModule :: Text
- pipelineInternalModule :: Text
- admitByIntegrity :: IntegrityFloor floor => floor -> ServeDecision -> ServeDecision -> PackageInfo -> (PackageInfo, [VersionVerdict])
- packumentServeDecision :: [ServeDecision] -> Decision
- statusServeDecision :: PackumentStatus -> Decision
- serveDecisionClass :: ServeDecision -> Decision
- denialLabels :: RejectReason -> (Maybe Text, ReasonClass)
- evalTier :: [PreparedRule] -> Tier
- transienceCause :: Transience -> Cause
- recordDenials :: MetricsPort -> [ServeDecision] -> IO ()
- recordEffectfulFailures :: MetricsPort -> [Decision] -> IO ()
- data VersionVerdict = VersionVerdict {}
- data DenialAudit = DenialAudit {
- daPackage :: PackageName
- daVersion :: Text
- daRule :: Maybe Text
- daReasonClass :: ReasonClass
- daAdvisoryEtag :: Maybe DbEtag
- daReasons :: [Reason]
- denialAuditPayload :: DenialAudit -> SimpleLogPayload
- logDenials :: KatipContext m => PackageName -> Maybe DbEtag -> [VersionVerdict] -> m ()
- logSkippedChecks :: KatipContext m => PackageName -> Text -> Maybe DbEtag -> [SkippedCheck] -> m ()
- logSkippedChecksOnce :: KatipContext m => (AdmissionIdentity -> IO Bool) -> PackageName -> Text -> Maybe DbEtag -> [SkippedCheck] -> m ()
The operator log-filter keys
pipelineModule :: Text Source #
The module field of the pipeline's own lines, and of any line a request logs whose site names none.
pipelineInternalModule :: Text Source #
The module field every line in this family carries, held stable so an operator's saved filter keeps matching.
Integrity-floor admission (pure)
admitByIntegrity :: IntegrityFloor floor => floor -> ServeDecision -> ServeDecision -> PackageInfo -> (PackageInfo, [VersionVerdict]) Source #
Keep each version's files whose strongest digest meets the floor, so a version drops only when none survives, as at the download gate. Each dropped version keeps its refusal beside its version, so its audit line can name it.
Metric-label projections (pure)
packumentServeDecision :: [ServeDecision] -> Decision Source #
The bounded ecluse.serve.decision value of a no-survivors packument: a refusal is a denial, the rest unavailable.
statusServeDecision :: PackumentStatus -> Decision Source #
packumentServeDecision over a folded status, so the no-survivors path walks the decisions once.
serveDecisionClass :: ServeDecision -> Decision Source #
Classify a single artifact-path serve decision into the bounded metric decision.
denialLabels :: RejectReason -> (Maybe Text, ReasonClass) Source #
The ecluse.rule.denials labels: the deciding rule of a policy denial, and the bounded reason class.
evalTier :: [PreparedRule] -> Tier Source #
The rule-evaluation tier of a duration: effectful when any prepared rule reads through a resilience policy.
transienceCause :: Transience -> Cause Source #
Map an undecidable verdict's transience to the bounded ecluse.rule.effectful.failures cause.
Metric emits (off a serve outcome)
recordDenials :: MetricsPort -> [ServeDecision] -> IO () Source #
Count ecluse.rule.denials once per rejected decision, labelled by denialLabels.
recordEffectfulFailures :: MetricsPort -> [Decision] -> IO () Source #
Count each Undecidable decision, the signal that an effectful rule could not consult its source.
Denial audit trail (structured log)
data VersionVerdict Source #
A per-version serve outcome beside its version, so a denial's audit line can name the version it refused.
Constructors
| VersionVerdict | |
Fields
| |
Instances
| Show VersionVerdict Source # | |
Defined in Ecluse.Core.Server.Pipeline.Internal Methods showsPrec :: Int -> VersionVerdict -> ShowS # show :: VersionVerdict -> String # showList :: [VersionVerdict] -> ShowS # | |
| Eq VersionVerdict Source # | |
Defined in Ecluse.Core.Server.Pipeline.Internal Methods (==) :: VersionVerdict -> VersionVerdict -> Bool # (/=) :: VersionVerdict -> VersionVerdict -> Bool # | |
data DenialAudit Source #
Everything one denial audit line records. A shadow swap can make the emit-time DbEtag differ from the decision's.
Constructors
| DenialAudit | |
Fields
| |
denialAuditPayload :: DenialAudit -> SimpleLogPayload Source #
Render a DenialAudit to the structured payload katip folds into the line's data object.
logDenials :: KatipContext m => PackageName -> Maybe DbEtag -> [VersionVerdict] -> m () Source #
Emit debug details per denied version. recordDenials counts them at every log level.
logSkippedChecks :: KatipContext m => PackageName -> Text -> Maybe DbEtag -> [SkippedCheck] -> m () Source #
One audit line per check skipped for unavailability. An unreached check gets none. A trusted serve runs no rules, so it never reaches here.
logSkippedChecksOnce :: KatipContext m => (AdmissionIdentity -> IO Bool) -> PackageName -> Text -> Maybe DbEtag -> [SkippedCheck] -> m () Source #
logSkippedChecks once per package, version and skipped rule set for the outage, so a public serve that admits again repeats no line.