ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Config

Synopsis

Documentation

data Config Source #

Constructors

Config 

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 AppConfig Source #

The resolved application configuration, one sub-record per document group so a field's home says what it governs (the document schema and this type mirror each other one to one).

Instances

Instances details
FromJSON AppConfig Source # 
Instance details

Defined in Ecluse.Config.Aeson

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 QueueSettings Source #

The queue group: the mirror queue's destination and the in-memory rollover's depth cap. The backend is derived from the URL's shape (Ecluse.Config.QueueTarget), never named here.

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 LimitsSettings Source #

The limits group: the hostile-input bounds. The structural counts are pinned policy defaults; the byte-valued caps are computed from the memory plan when unset (Ecluse.Composition.MemoryPlan), a configured value always winning.

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 #

The integrity group: the global integrity floors and divergence policy (minTrusted and divergencePolicy refinable per mount).

Constructors

IntegritySettings 

Fields

newtype EgressSettings Source #

The egress group: the operator's additions to the blocked target ranges.

Instances

Instances details
Show EgressSettings Source # 
Instance details

Defined in Ecluse.Config.Types

Eq EgressSettings Source # 
Instance details

Defined in Ecluse.Config.Types

data RuntimeSettings Source #

The runtime group: the process-sizing overrides. Every field is optional; 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 and telemetry switch.

Constructors

ObservabilitySettings 

Fields

type MountMap = Map Ecosystem Mount Source #

data Mount Source #

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 #

data MountRegistries Source #

Constructors

MountRegistries 

Fields

data MountMode Source #

Whether a mount mirrors, derived from its declared endpoints: a declared mirrorTarget makes the mount Mirrored (and its private upstream is then required, so the mirror can be read back), an absent one makes it ServeOnly (never writes anywhere; the private upstream is optional, and a mount with neither is the pure public gate). The coupling is structural, so a mirrored mount without a readable private leg is unrepresentable.

Constructors

Mirrored MirroredLegs

The mount mirrors admitted public artifacts; both legs are required.

ServeOnly (Maybe RegistryUrl)

The mount never writes; the optional private upstream is still merged 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 married to 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: total over both modes, so call sites read as before while the compiler makes them face the serve-only absence.

regMirrorTarget :: MountRegistries -> Maybe MirrorTarget Source #

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

data MirrorTarget Source #

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 MirrorCredential Source #

The mirror-write credential, derived from the mirror-target URL so a token can never be paired with an endpoint it was not minted for. A CodeArtifact endpoint encodes its whole identity in its host, so that identity is parsed straight from the URL; any other host is written with an operator-supplied static bearer. The choice is made once, at config load (resolveMirrorCredential), and carried here so the pairing is correct by construction.

Constructors

MirrorCodeArtifact CodeArtifactConfig

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

MirrorStatic Secret

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

data MountConfig Source #

Constructors

MountConfig 

Fields

newtype Url Source #

Constructors

Url Text 

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 #

newtype RulePatch Source #

Constructors

RulePatch (Map Text RuleEntry) 

Instances

Instances details
FromJSON RulePatch Source # 
Instance details

Defined in Ecluse.Config.Aeson

Show RulePatch Source # 
Instance details

Defined in Ecluse.Config.Rule

Eq RulePatch Source # 
Instance details

Defined in Ecluse.Config.Rule

newtype RulePolicy Source #

Constructors

RulePolicy 

Fields

Instances

Instances details
Show RulePolicy Source # 
Instance details

Defined in Ecluse.Config.Rule

Eq RulePolicy Source # 
Instance details

Defined in Ecluse.Config.Rule

data ConfigError Source #

Constructors

ParseError Text 
PolicyErrors [PolicyError] 
PublicUrlRequired

A mount is active but server.publicUrl is unset. Served artifact URLs must be rewritten against the proxy's own externally-reachable base URL; a relative dist.tarball reads to the npm CLI as a file: path and every install fails, so the omission is refused at boot rather than discovered client by client. Host-header derivation is deliberately not offered (a spoofed header would poison every shared-cache entry with an attacker-chosen artifact URL).

MountMissingPrivateUpstream Ecosystem

A mirrored mount (one that declares a mirrorTarget) does not define its private upstream. The mirror write must be readable back through the private leg, so a mirrored mount without one is refused; a serve-only mount (no mirrorTarget) never raises this.

MirrorSettingWithoutWrite Ecosystem Text

A serve-only mount (no mirrorTarget declared) carries a mirror-write setting anyway. A write credential or token duration on a mount that never writes signals a misunderstanding (most likely a missing mirrorTarget), so it is refused per offending key rather than silently ignored. Carries the mount's ecosystem and the offending document key.

MirrorCredentialTokenMissing Ecosystem

An active mount's mirror target is not a CodeArtifact endpoint (whose write token would be minted), so it needs an explicit static write token, and none was supplied. Carries the mount's ecosystem.

MirrorCredentialConflict Ecosystem

An active mount's mirror target is a CodeArtifact endpoint (its write token is minted automatically from the host identity) yet a static write token was also supplied. Refused so the two credential sources can never silently contend. Carries the mount's ecosystem.

Instances

Instances details
Show ConfigError Source # 
Instance details

Defined in Ecluse.Config.Types

Eq ConfigError Source # 
Instance details

Defined in Ecluse.Config.Types

loadConfig :: [(String, String)] -> Maybe ByteString -> Either [ConfigError] Config Source #

Load the full configuration: defaults, the optional operator document, and the environment overlay, merged strongest-last, then parsed, activated, and resolved.

A mount is active when the operator overlay (the document or the ECLUSE_MOUNTS__* environment variables) declares any key under mounts.<ecosystem>; the mounts shipped in config/default.yaml are dormant per-ecosystem templates until then. The enabled key is itself a declaration, so enabled: true alone activates a mount against its template public upstream (the serve-only pure public gate), and enabled: false switches a mount off without removing its other keys.

Whether an active mount mirrors is derived from its declared endpoints: a mirrorTarget makes it mirrored (its private upstream is then required, so the mirror can be read back: MountMissingPrivateUpstream), and an absent one makes it serve-only (never writing anywhere; a mirror-write setting left behind is refused per key as MirrorSettingWithoutWrite rather than silently ignored). The boot log names each mount's resolved posture, so an unintentionally dropped mirrorTarget is visible at start-up.

mountCollisionWarnings :: Config -> [Text] Source #

Boot-time advisory: one warning per pair of an active mount's resolved registry endpoints that point at the same registry. Each collapse is supported by the proxy (declaring the mirror target equal to the private upstream is a valid arrangement), but a distinct registry per endpoint is the recommended posture, so every collision is surfaced once at boot. A publication target equal to the private upstream is the documented publish arrangement and is not warned. Comparison is textual on the validated URL, insensitive to trailing slashes.

mountPostureLines :: Config -> [Text] Source #

Boot-time posture: one line per served mount naming its derived mode and its consequence. The mode is derived from the declared endpoints (see loadConfig), so this is the loud counterpart of that inference: an unintentionally dropped mirrorTarget shows up here as "serve-only" at the very next boot rather than silently un-mirroring.

resolvedKeyProvenance :: [(String, String)] -> Maybe ByteString -> [Text] Source #

One line per resolved leaf of the merged configuration: the dotted path, the rendered value (secret-typed keys redacted), and the layer that supplied it (environment > document > default, mirroring the merge precedence). Derived and computed values are deliberately absent: they are not configuration, and their resolvers log their own provenance lines (the runtime posture, the memory plan, the queue selection). Renders nothing if the layers fail to parse; callers dump provenance only after a successful loadConfig.