| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Config.Types
Synopsis
- newtype Url = Url Text
- mkUrl :: Text -> Either Text Url
- unUrl :: Url -> Text
- data MirrorCredential
- = MirrorCodeArtifact CodeArtifactConfig
- | MirrorStatic Secret
- data MountConfig = MountConfig {
- mntEnabled :: Maybe Bool
- mntPrivateUpstream :: Maybe RegistryUrl
- mntPublicUpstream :: RegistryUrl
- mntMirrorTarget :: Maybe RegistryUrl
- mntMirrorTargetToken :: Maybe Secret
- mntMirrorCodeArtifactTokenDuration :: Maybe Natural
- mntPublicationTarget :: Maybe RegistryUrl
- mntPublicationTargetToken :: Maybe Secret
- mntPublishAllow :: [Scope]
- mntMinTrustedIntegrity :: Maybe MinTrustedIntegrity
- mntDivergencePolicy :: Maybe DivergencePolicy
- mntAdditionalRules :: RulePatch
- data AppConfig = AppConfig {
- cfgServer :: ServerSettings
- cfgQueue :: QueueSettings
- cfgLimits :: LimitsSettings
- cfgCache :: CacheSettings
- cfgIntegrity :: IntegritySettings
- cfgEgress :: EgressSettings
- cfgAdvisories :: AdvisoriesSettings
- cfgRuntime :: RuntimeSettings
- cfgObservability :: ObservabilitySettings
- cfgMounts :: Map Ecosystem MountConfig
- data ServerSettings = ServerSettings {
- srvPort :: Int
- srvPublicUrl :: Maybe Url
- srvAuthToken :: Maybe Secret
- srvHelpMessage :: Maybe Text
- srvShutdownDrainTimeout :: Int
- data QueueSettings = QueueSettings {}
- data LimitsSettings = LimitsSettings {}
- data CacheSettings = CacheSettings {}
- data IntegritySettings = IntegritySettings {
- intMinPublic :: MinIntegrity
- intMinTrusted :: MinTrustedIntegrity
- intDivergencePolicy :: DivergencePolicy
- newtype EgressSettings = EgressSettings {}
- data AdvisoriesSettings = AdvisoriesSettings {}
- data RuntimeSettings = RuntimeSettings {}
- data ObservabilitySettings = ObservabilitySettings {
- obsLogFormat :: LogFormat
- obsTelemetry :: TelemetrySwitch
- data MountRegistries = MountRegistries {
- regPublicUpstream :: RegistryUrl
- regMode :: MountMode
- data MountMode
- = Mirrored MirroredLegs
- | ServeOnly (Maybe RegistryUrl)
- data MirroredLegs = MirroredLegs {
- mlPrivateUpstream :: RegistryUrl
- mlMirrorTarget :: MirrorTarget
- regPrivateUpstream :: MountRegistries -> Maybe RegistryUrl
- regMirrorTarget :: MountRegistries -> Maybe MirrorTarget
- data MirrorTarget = MirrorTarget {
- mtUrl :: RegistryUrl
- mtCredential :: MirrorCredential
- data Mount = Mount {
- mountEcosystem :: Ecosystem
- mountRegistries :: MountRegistries
- mountPolicy :: [PrecededRule]
- type MountMap = Map Ecosystem Mount
- data Config = Config {}
- data ConfigError
- = ParseError Text
- | PolicyErrors [PolicyError]
- | PublicUrlRequired
- | MountMissingPrivateUpstream Ecosystem
- | MirrorSettingWithoutWrite Ecosystem Text
- | MirrorCredentialTokenMissing Ecosystem
- | MirrorCredentialConflict Ecosystem
- renderConfigError :: ConfigError -> Text
Documentation
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. |
Instances
| Show MirrorCredential Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> MirrorCredential -> ShowS # show :: MirrorCredential -> String # showList :: [MirrorCredential] -> ShowS # | |
| Eq MirrorCredential Source # | |
Defined in Ecluse.Config.Types Methods (==) :: MirrorCredential -> MirrorCredential -> Bool # (/=) :: MirrorCredential -> MirrorCredential -> Bool # | |
data MountConfig Source #
Constructors
| MountConfig | |
Fields
| |
Instances
| FromJSON MountConfig Source # | |
Defined in Ecluse.Config.Aeson Methods parseJSON :: Value -> Parser MountConfig Source # parseJSONList :: Value -> Parser [MountConfig] Source # | |
| Show MountConfig Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> MountConfig -> ShowS # show :: MountConfig -> String # showList :: [MountConfig] -> ShowS # | |
| Eq MountConfig Source # | |
Defined in Ecluse.Config.Types | |
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).
Constructors
| AppConfig | |
Fields
| |
data ServerSettings Source #
The server group: the inbound edge Écluse itself presents.
Constructors
| ServerSettings | |
Fields
| |
Instances
| Show ServerSettings Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> ServerSettings -> ShowS # show :: ServerSettings -> String # showList :: [ServerSettings] -> ShowS # | |
| Eq ServerSettings Source # | |
Defined in Ecluse.Config.Types Methods (==) :: ServerSettings -> ServerSettings -> Bool # (/=) :: ServerSettings -> ServerSettings -> Bool # | |
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 | |
Instances
| Show QueueSettings Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> QueueSettings -> ShowS # show :: QueueSettings -> String # showList :: [QueueSettings] -> ShowS # | |
| Eq QueueSettings Source # | |
Defined in Ecluse.Config.Types Methods (==) :: QueueSettings -> QueueSettings -> Bool # (/=) :: QueueSettings -> QueueSettings -> Bool # | |
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
| Show LimitsSettings Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> LimitsSettings -> ShowS # show :: LimitsSettings -> String # showList :: [LimitsSettings] -> ShowS # | |
| Eq LimitsSettings Source # | |
Defined in Ecluse.Config.Types Methods (==) :: LimitsSettings -> LimitsSettings -> Bool # (/=) :: LimitsSettings -> LimitsSettings -> Bool # | |
data CacheSettings Source #
The cache group: the metadata cache's TTL and its computed-by-default bounds.
Constructors
| CacheSettings | |
Fields
| |
Instances
| Show CacheSettings Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> CacheSettings -> ShowS # show :: CacheSettings -> String # showList :: [CacheSettings] -> ShowS # | |
| Eq CacheSettings Source # | |
Defined in Ecluse.Config.Types Methods (==) :: CacheSettings -> CacheSettings -> Bool # (/=) :: CacheSettings -> CacheSettings -> Bool # | |
data IntegritySettings Source #
The integrity group: the global integrity floors and divergence policy
(minTrusted and divergencePolicy refinable per mount).
Constructors
| IntegritySettings | |
Fields
| |
Instances
| Show IntegritySettings Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> IntegritySettings -> ShowS # show :: IntegritySettings -> String # showList :: [IntegritySettings] -> ShowS # | |
| Eq IntegritySettings Source # | |
Defined in Ecluse.Config.Types Methods (==) :: IntegritySettings -> IntegritySettings -> Bool # (/=) :: IntegritySettings -> IntegritySettings -> Bool # | |
newtype EgressSettings Source #
The egress group: the operator's additions to the blocked target ranges.
Constructors
| EgressSettings | |
Fields | |
Instances
| Show EgressSettings Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> EgressSettings -> ShowS # show :: EgressSettings -> String # showList :: [EgressSettings] -> ShowS # | |
| Eq EgressSettings Source # | |
Defined in Ecluse.Config.Types Methods (==) :: EgressSettings -> EgressSettings -> Bool # (/=) :: EgressSettings -> EgressSettings -> Bool # | |
data AdvisoriesSettings Source #
The advisories group: the OSV/CVE pipeline's bucket, cadences, and bounds.
Constructors
| AdvisoriesSettings | |
Fields | |
Instances
| Show AdvisoriesSettings Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> AdvisoriesSettings -> ShowS # show :: AdvisoriesSettings -> String # showList :: [AdvisoriesSettings] -> ShowS # | |
| Eq AdvisoriesSettings Source # | |
Defined in Ecluse.Config.Types Methods (==) :: AdvisoriesSettings -> AdvisoriesSettings -> Bool # (/=) :: AdvisoriesSettings -> AdvisoriesSettings -> Bool # | |
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.
Constructors
| RuntimeSettings | |
Fields | |
Instances
| Show RuntimeSettings Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> RuntimeSettings -> ShowS # show :: RuntimeSettings -> String # showList :: [RuntimeSettings] -> ShowS # | |
| Eq RuntimeSettings Source # | |
Defined in Ecluse.Config.Types Methods (==) :: RuntimeSettings -> RuntimeSettings -> Bool # (/=) :: RuntimeSettings -> RuntimeSettings -> Bool # | |
data ObservabilitySettings Source #
The observability group: log shape and telemetry switch.
Constructors
| ObservabilitySettings | |
Fields
| |
Instances
| Show ObservabilitySettings Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> ObservabilitySettings -> ShowS # show :: ObservabilitySettings -> String # showList :: [ObservabilitySettings] -> ShowS # | |
| Eq ObservabilitySettings Source # | |
Defined in Ecluse.Config.Types Methods (==) :: ObservabilitySettings -> ObservabilitySettings -> Bool # (/=) :: ObservabilitySettings -> ObservabilitySettings -> Bool # | |
data MountRegistries Source #
Constructors
| MountRegistries | |
Fields
| |
Instances
| Show MountRegistries Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> MountRegistries -> ShowS # show :: MountRegistries -> String # showList :: [MountRegistries] -> ShowS # | |
| Eq MountRegistries Source # | |
Defined in Ecluse.Config.Types Methods (==) :: MountRegistries -> MountRegistries -> Bool # (/=) :: MountRegistries -> MountRegistries -> Bool # | |
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. |
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
| Show MirroredLegs Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> MirroredLegs -> ShowS # show :: MirroredLegs -> String # showList :: [MirroredLegs] -> ShowS # | |
| Eq MirroredLegs Source # | |
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
| Show MirrorTarget Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> MirrorTarget -> ShowS # show :: MirrorTarget -> String # showList :: [MirrorTarget] -> ShowS # | |
| Eq MirrorTarget Source # | |
Defined in Ecluse.Config.Types | |
Constructors
| Mount | |
Fields
| |
Constructors
| Config | |
Fields | |
data ConfigError Source #
Constructors
| ParseError Text | |
| PolicyErrors [PolicyError] | |
| PublicUrlRequired | A mount is active but |
| MountMissingPrivateUpstream Ecosystem | A mirrored mount (one that declares a |
| MirrorSettingWithoutWrite Ecosystem Text | A serve-only mount (no |
| 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
| Show ConfigError Source # | |
Defined in Ecluse.Config.Types Methods showsPrec :: Int -> ConfigError -> ShowS # show :: ConfigError -> String # showList :: [ConfigError] -> ShowS # | |
| Eq ConfigError Source # | |
Defined in Ecluse.Config.Types | |
renderConfigError :: ConfigError -> Text Source #