ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Config.Types

Description

Settings and load refusals shared by the decoders and composition root. Ecluse.Config resolves the settings into a Config.

Synopsis

Documentation

data Url Source #

An operator-configured http(s) URL, whitespace-trimmed. mkUrl is the only builder, so no value exists carrying credential material, another scheme, or an authority the egress gate misses.

Instances

Instances details
Show Url Source # 
Instance details

Defined in Ecluse.Config.Types

Methods

showsPrec :: Int -> Url -> ShowS #

show :: Url -> String #

showList :: [Url] -> ShowS #

Eq Url Source # 
Instance details

Defined in Ecluse.Config.Types

Methods

(==) :: Url -> Url -> Bool #

(/=) :: Url -> Url -> Bool #

Ord Url Source # 
Instance details

Defined in Ecluse.Config.Types

Methods

compare :: Url -> Url -> Ordering #

(<) :: Url -> Url -> Bool #

(<=) :: Url -> Url -> Bool #

(>) :: Url -> Url -> Bool #

(>=) :: Url -> Url -> Bool #

max :: Url -> Url -> Url #

min :: Url -> Url -> Url #

mkUrl :: Text -> Text -> Either Text Url Source #

Build a Url from a configuration key and the value written under it, the key naming every refusal. The credential refusal runs first, because the two refusals below it quote the value.

unUrl :: Url -> Text Source #

The stored URL text.

data HttpScheme Source #

The scheme a configured http(s) URL writes.

Constructors

Http 
Https 

Instances

Instances details
Show HttpScheme Source # 
Instance details

Defined in Ecluse.Config.Types

Eq HttpScheme Source # 
Instance details

Defined in Ecluse.Config.Types

splitHttpScheme :: Text -> Maybe (HttpScheme, Text) Source #

Split a URL into the scheme it writes and the text after the separator, or Nothing for neither http nor https. It is the one scheme check the configuration layer shares.

data StoreTag Source #

Which store backend an endpoint names: the one key under it, which the load validates the URL against, never a guess from the host.

Constructors

TagRegistry

Any host that speaks the ecosystem's protocol, authenticated by a static token.

TagCodeArtifact

A CodeArtifact repository endpoint, which mints its own write token.

TagVerdaccio

A Verdaccio development store, authenticated by a static token.

Instances

Instances details
Show StoreTag Source # 
Instance details

Defined in Ecluse.Config.Types

Eq StoreTag Source # 
Instance details

Defined in Ecluse.Config.Types

storeTagName :: StoreTag -> Text Source #

The tag as an operator writes it, and as a refusal names it.

taggedKeyPath :: Text -> StoreTag -> Text -> Text Source #

A key's path under an endpoint's tag, as refusals name it: mirrorTarget.codeArtifact.uploadUrl.

data Target Source #

An endpoint as a mount declares it: the tag naming its store, and the URL under that tag.

Constructors

Target 

Fields

Instances

Instances details
Show Target Source # 
Instance details

Defined in Ecluse.Config.Types

Eq Target Source # 
Instance details

Defined in Ecluse.Config.Types

Methods

(==) :: Target -> Target -> Bool #

(/=) :: Target -> Target -> Bool #

data PrivateEndpoint Source #

A private read endpoint with maintenance authority used only by Dredger.

data DeletionConsent Source #

Whether the operator consented to ecluse dredger deleting from a Verdaccio store. No other tag carries it.

data MirrorWrite Source #

How the mirror write, Écluse's one standing credential, authenticates: a minting tag carries no static token, and any other requires one.

Constructors

WriteRegistry Secret

Any protocol-speaking host: the operator's static write token.

WriteCodeArtifact (Maybe Natural)

A CodeArtifact repository: the requested lifetime of the token it mints.

WriteVerdaccio Secret DeletionConsent

A Verdaccio store: its static write token, and the operator's deletion consent.

Instances

Instances details
Show MirrorWrite Source # 
Instance details

Defined in Ecluse.Config.Types

Eq MirrorWrite Source # 
Instance details

Defined in Ecluse.Config.Types

data MirrorEndpoint Source #

A declared mirrorTarget: where the mirror writes, and how that write authenticates.

Constructors

MirrorEndpoint 

Fields

  • meUrl :: RegistryUrl
     
  • meWrite :: MirrorWrite
     
  • meUploadUrl :: Maybe RegistryUrl

    Where uploads go. The load requires it on a protocol with a separate upload endpoint and refuses it elsewhere.

  • meUsername :: Maybe Text

    The configured Basic username. A store that declares its write mechanism never sends it.

Instances

Instances details
Show MirrorEndpoint Source # 
Instance details

Defined in Ecluse.Config.Types

Eq MirrorEndpoint Source # 
Instance details

Defined in Ecluse.Config.Types

meTarget :: MirrorEndpoint -> Target Source #

The mirror endpoint as the collision rules read it. The tag comes from meWrite.

data PublicationEndpoint Source #

A publication endpoint and the credential that replaces an authenticated edge token.

Constructors

PublicationEndpoint 

Fields

data MintPlan Source #

How a mount's mirror write authenticates, projected from its resolved StoreBackend.

Constructors

MintCodeArtifact CodeArtifactConfig

A CodeArtifact mirror target: the mint identity parsed from its host.

MintStatic Secret

Any other mirror target: an operator-supplied static write token.

Instances

Instances details
Show MintPlan Source # 
Instance details

Defined in Ecluse.Config.Types

Eq MintPlan Source # 
Instance details

Defined in Ecluse.Config.Types

data ControlPlane Source #

The control plane a mount's store offers, the face ecluse dredger deletes through.

Constructors

ControlCodeArtifact CodeArtifactStore

The CodeArtifact repository the target addresses, which the load has vetted.

ControlProtocol Secret DeletionConsent

A store with no vendor control plane, swept through the ecosystem protocol's own verbs: its write token, and the operator's consent to delete from it.

ControlNone

The tag names no control plane this build implements.

Instances

Instances details
Show ControlPlane Source # 
Instance details

Defined in Ecluse.Config.Types

Eq ControlPlane Source # 
Instance details

Defined in Ecluse.Config.Types

data StoreBackend Source #

A mount's store backend, resolved once at load (Ecluse.Config.Target), so no two roles infer a different one. The tag discriminates, so no arm pairs one store's mint with another's plane.

Constructors

BackendRegistry Secret

A protocol-speaking host: its static write token, and no control plane.

BackendCodeArtifact CodeArtifactConfig CodeArtifactStore

A CodeArtifact repository: the identity it mints from, and the store a sweep deletes in.

BackendVerdaccio Secret DeletionConsent

A Verdaccio store: its static write token, and the operator's deletion consent.

Instances

Instances details
Show StoreBackend Source # 
Instance details

Defined in Ecluse.Config.Types

Eq StoreBackend Source # 
Instance details

Defined in Ecluse.Config.Types

sbTag :: StoreBackend -> StoreTag Source #

The tag a backend was declared under.

sbMint :: StoreBackend -> MintPlan Source #

How the mirror write to this backend authenticates.

sbControl :: StoreBackend -> ControlPlane Source #

The control plane this build reaches for a backend.

data FirstParty #

Constructors

(Eq entry, Show entry, Typeable entry) => FirstParty (FirstPartyNames entry) (NonEmpty entry) 

Instances

Instances details
Show FirstParty 
Instance details

Defined in Ecluse.Core.Registry.FirstParty

Eq FirstParty 
Instance details

Defined in Ecluse.Core.Registry.FirstParty

newtype MountIntegrity Source #

A mount's refinements of the global integrity group, under its own integrity key. Each is Nothing at the global setting.

Constructors

MountIntegrity 

Fields

  • miMinTrusted :: Maybe MinTrustedIntegrity

    A per-mount trusted-integrity floor, for one legacy private registry whose loosening must not leak onto other mounts.

Instances

Instances details
Show MountIntegrity Source # 
Instance details

Defined in Ecluse.Config.Types

Eq MountIntegrity Source # 
Instance details

Defined in Ecluse.Config.Types

data MountConfig Source #

Endpoint and activation settings for one mount before resolution.

Constructors

MountConfig 

Fields

Instances

Instances details
Show MountConfig Source # 
Instance details

Defined in Ecluse.Config.Types

Eq MountConfig Source # 
Instance details

Defined in Ecluse.Config.Types

data AppConfig Source #

Application settings, before active mounts resolve their layered policies.

Instances

Instances details
Show AppConfig Source # 
Instance details

Defined in Ecluse.Config.Types

Eq AppConfig Source # 
Instance details

Defined in Ecluse.Config.Types

data ServerSettings Source #

The server group: the inbound edge Écluse itself presents.

Constructors

ServerSettings 

Fields

Instances

Instances details
Show ServerSettings Source # 
Instance details

Defined in Ecluse.Config.Types

Eq ServerSettings Source # 
Instance details

Defined in Ecluse.Config.Types

data QueueTarget Source #

A recognised mirror-queue destination, parsed from the queue URL's shape.

Constructors

SqsTarget Text

An SQS queue URL, carrying the region parsed from its host.

PubSubTarget Text Text

A Pub/Sub topic resource, carrying its project and topic.

Instances

Instances details
Show QueueTarget Source # 
Instance details

Defined in Ecluse.Config.Queue.Internal

Eq QueueTarget Source # 
Instance details

Defined in Ecluse.Config.Queue.Internal

data QueueUrl Source #

queue.url as parsed at load (mkQueueUrl): the value as written, with the backend its shape names, or no backend when only the SQS endpoint override can dial it.

Instances

Instances details
Show QueueUrl Source # 
Instance details

Defined in Ecluse.Config.Queue.Internal

Eq QueueUrl Source # 
Instance details

Defined in Ecluse.Config.Queue.Internal

queueUrlText :: QueueUrl -> Text Source #

The value as written, trimmed.

queueUrlTarget :: QueueUrl -> Maybe QueueTarget Source #

The backend the value's shape names, Nothing when it names none.

data QueueSettings Source #

The queue group: the mirror queue's destination, depth cap, and redelivery budget. The URL's shape decides the backend, and the load derives it once (Ecluse.Config.QueueTarget).

Constructors

QueueSettings 

Fields

Instances

Instances details
Show QueueSettings Source # 
Instance details

Defined in Ecluse.Config.Types

Eq QueueSettings Source # 
Instance details

Defined in Ecluse.Config.Types

data AdvisoryStoreTarget Source #

A recognised advisory-database store, parsed from the URL's scheme. It carries the bucket and the optional key prefix under which the compiled artifacts live.

Constructors

S3Store Text (Maybe Text)

An s3://bucket[/prefix] store.

data AdvisoryStoreUrl Source #

advisories.url as parsed at load (mkAdvisoryStoreUrl): the value as written, with the store its scheme names.

advisoryStoreUrlText :: AdvisoryStoreUrl -> Text Source #

The value as written, trimmed.

advisoryStoreTarget :: AdvisoryStoreUrl -> AdvisoryStoreTarget Source #

The store the value's scheme names.

data LimitsSettings Source #

The limits group: the hostile-input bounds. The memory plan computes unset tenant-sized caps, and the rest stay pinned.

Constructors

LimitsSettings 

Fields

Instances

Instances details
Show LimitsSettings Source # 
Instance details

Defined in Ecluse.Config.Types

Eq LimitsSettings Source # 
Instance details

Defined in Ecluse.Config.Types

data CacheSettings Source #

The cache group: the metadata cache's TTL and its computed-by-default bounds.

Constructors

CacheSettings 

Fields

Instances

Instances details
Show CacheSettings Source # 
Instance details

Defined in Ecluse.Config.Types

Eq CacheSettings Source # 
Instance details

Defined in Ecluse.Config.Types

data IntegritySettings Source #

Global integrity floors. A mount can refine the trusted floor through MountIntegrity.

Constructors

IntegritySettings 

Fields

data EgressSettings Source #

Outbound identity and extra blocked target ranges.

Constructors

EgressSettings 

Fields

Instances

Instances details
Show EgressSettings Source # 
Instance details

Defined in Ecluse.Config.Types

Eq EgressSettings Source # 
Instance details

Defined in Ecluse.Config.Types

data AdvisoriesSettings Source #

The advisories group: the OSV/CVE pipeline's store, cadences, and upstream feeds.

Constructors

AdvisoriesSettings 

Fields

data RuntimeSettings Source #

The runtime group: the process-sizing overrides. Unset, each is computed from the runtime posture (cgroups, RTS, file-descriptor limit), with its provenance boot-logged.

data ObservabilitySettings Source #

The observability group: log shape, log level, and telemetry switch.

Constructors

ObservabilitySettings 

Fields

data DredgerSettings Source #

The dredger group: the sweep's pacing, its deletion cap, and the names it walks. Only ecluse dredger reads it.

Constructors

DredgerSettings 

Fields

  • drgChunkSize :: Int

    Candidate packages one chunk examines before the sweep pauses.

  • drgChunkPause :: NominalDiffTime

    Seconds between chunks, which is also the wait a fault advising no delay of its own takes.

  • drgCyclePause :: NominalDiffTime

    Seconds between the end of one cycle and the start of the next.

  • drgTargetCycleWindow :: Maybe NominalDiffTime

    Seconds within which an advisory is paced to reach every affected mirrored version. Unset, the cycle pause sets it.

  • drgRequestBudgetFraction :: Maybe Rational

    The share of a store's request capacity one sweep may take, computed per pool when unset so the proxy is not starved.

  • drgQuotaOverrides :: Map Text QuotaOverride

    Declared request capacity, keyed by the store URL it describes.

  • drgDeletionCap :: Maybe Int

    Versions one cycle may hand over for deletion, computed per sweepable store when unset. Reaching it halts the sweep for the life of the process, so a poisoned generation stops there.

  • drgFullWalk :: Bool

    Walk every package each cycle rather than the advisory and identity-deny candidates. It covers a rule-configuration change, and it writes one resumption marker to the store.

data QuotaOverride Source #

One store's declared request capacity. It supplies the capacity a backend publishes none of, and a shared scope joins two endpoints of one pool so the sweep paces them together.

Constructors

QuotaOverride 

Fields

  • qoScope :: Maybe Text

    The capacity pool this store shares, which defaults to the store's own authority.

  • qoQuotas :: Map QuotaDimension Rational

    Requests per second the pool admits, replacing the backend's own number per dimension.

  • qoWeights :: Map RequestKind Rational

    What one request of a kind costs relative to the backend's own cost for it.

Instances

Instances details
Show QuotaOverride Source # 
Instance details

Defined in Ecluse.Config.Types

Eq QuotaOverride Source # 
Instance details

Defined in Ecluse.Config.Types

data MountRegistries Source #

A resolved mount's endpoints: the public upstream it gates, and what it does with the rest.

Constructors

MountRegistries 

Fields

data MountMode Source #

Whether a mount mirrors. A declared mirrorTarget makes it Mirrored, which always carries the private upstream it reads back.

Constructors

Mirrored MirroredLegs

The mount mirrors admitted public artifacts, and it needs both legs.

ServeOnly (Maybe RegistryUrl)

The mount never writes. It still merges the optional private upstream when present.

Instances

Instances details
Show MountMode Source # 
Instance details

Defined in Ecluse.Config.Types

Eq MountMode Source # 
Instance details

Defined in Ecluse.Config.Types

data MirroredLegs Source #

A mirrored mount's two required halves: the readable private upstream, and the mirror target with its derived write credential.

Constructors

MirroredLegs 

Fields

Instances

Instances details
Show MirroredLegs Source # 
Instance details

Defined in Ecluse.Config.Types

Eq MirroredLegs Source # 
Instance details

Defined in Ecluse.Config.Types

regPrivateUpstream :: MountRegistries -> Maybe RegistryUrl Source #

The mount's private upstream, when it has one. It is total over both mount modes.

regMirrorTarget :: MountRegistries -> Maybe MirrorTarget Source #

The mount's mirror target (with its derived credential), when it mirrors.

data MirrorTarget Source #

A mirror target married to the backend resolved from the tag it was declared under.

Constructors

MirrorTarget 

Fields

Instances

Instances details
Show MirrorTarget Source # 
Instance details

Defined in Ecluse.Config.Types

Eq MirrorTarget Source # 
Instance details

Defined in Ecluse.Config.Types

data Mount Source #

One resolved mount: its ecosystem, its endpoints, and the rules in precedence order.

Constructors

Mount 

Fields

Instances

Instances details
Show Mount Source # 
Instance details

Defined in Ecluse.Config.Types

Methods

showsPrec :: Int -> Mount -> ShowS #

show :: Mount -> String #

showList :: [Mount] -> ShowS #

Eq Mount Source # 
Instance details

Defined in Ecluse.Config.Types

Methods

(==) :: Mount -> Mount -> Bool #

(/=) :: Mount -> Mount -> Bool #

type MountMap = Map Ecosystem Mount Source #

The mounts a load resolved, keyed by the ecosystem each was declared under.

data RuleInactivity Source #

Why a shipped rule an advisory source activates does not run, when no operator patch enabled or disabled it.

Constructors

NoAdvisorySource

No advisories.url is configured, and no patch decided the rule.

Instances

Instances details
Show RuleInactivity Source # 
Instance details

Defined in Ecluse.Config.Types

Eq RuleInactivity Source # 
Instance details

Defined in Ecluse.Config.Types

data Config Source #

A completed load: the document's settings and the mounts resolved against them.

Constructors

Config 

Fields

Instances

Instances details
Show Config Source # 
Instance details

Defined in Ecluse.Config.Types

Eq Config Source # 
Instance details

Defined in Ecluse.Config.Types

Methods

(==) :: Config -> Config -> Bool #

(/=) :: Config -> Config -> Bool #

data ConfigError Source #

Why a load was refused. renderConfigError writes each one as the boot reports it.

Constructors

ParseError Text 
PolicyErrors [PolicyError] 
SharedPolicyErrors [PolicyError]

Shared rule errors that include suppression of a shipped npm mount default.

PublicUrlRequired

A mount is active but server.publicUrl is unset. Deriving it from a spoofable Host header would poison the shared cache.

MountMissingPrivateUpstream Ecosystem

A mount declares a mirrorTarget but no private upstream, through which the mirror write must be readable back. A serve-only mount never raises this.

CodeArtifactHostMismatch Ecosystem Text

A codeArtifact endpoint whose URL is not a CodeArtifact endpoint. The tag names the store, so the URL would misdirect a write or read.

CodeArtifactFormatUnsupported Ecosystem Text

A codeArtifact endpoint on an ecosystem CodeArtifact has no package format for. Carries its key.

CodeArtifactRepositoryMissing Ecosystem Text Text

A codeArtifact endpoint whose path addresses no repository under the mount's own format, whose per-format endpoints are separate stores. Carries its key, then the format token.

UploadUrlRefused Ecosystem Text

A write target sets uploadUrl, but the protocol derives its write address from url. Carries its key.

Instances

Instances details
Show ConfigError Source # 
Instance details

Defined in Ecluse.Config.Types

Eq ConfigError Source # 
Instance details

Defined in Ecluse.Config.Types

renderConfigError :: ConfigError -> Text Source #

Render a load refusal, including the mount remedy for a misplaced shared suppression.

shippedMountRules :: [(Text, NonEmpty Ecosystem)] Source #

The rule names config/default.yaml ships under mount rules, with the mounts that ship each. The shared layer defines none.