ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Composition

Description

Bind validated mounts and publication targets without origin discovery. Live wiring prepares rule state and the credentials required by each role.

Synopsis

The environment-dependent wiring

type ResolveAdapter = Ecosystem -> PackumentDeps -> Maybe PublishDeps -> Maybe MountBinding Source #

Resolve an ecosystem's deps to its mount, Nothing without an adapter. Ecluse.Service implements it.

data WiringPorts Source #

The capabilities the wiring is built through, injected so a unit test assembles it with no listener.

Constructors

WiringPorts 

Fields

data BootWiring Source #

What only a live environment settles: the served mounts and the worker's publish targets.

Constructors

BootWiring 

Fields

  • bwBindings :: [MountBinding]

    The resolved mounts. A worker-only role builds them for their rules, and serves none.

  • bwPublishTargets :: [PublishTarget]

    One target per mirrored mount, with the provider that mints its write token. A role that writes nothing plans none.

resolveBootWiring :: WiringPorts -> MirrorMintPlan -> Limits -> Maybe PublishBudget -> ValidatedPlan -> IO (Either [BootError] BootWiring) Source #

Resolve serving mounts and worker targets from the same credential providers.

Boot-time wiring

planMounts :: ResolveAdapter -> IO UTCTime -> (Ecosystem -> RuleDeps) -> MirrorMintPlan -> CredentialProviders -> Limits -> Maybe PublishBudget -> ValidatedPlan -> IO (Either [BootError] [MountBinding]) Source #

Resolve mounts with their configured authority and publication budget.

Publish-side wiring

data PublishBudget Source #

The publish byte discipline, aggregate admission and per-request cap, present exactly when a mount publishes.

Constructors

PublishBudget 

Fields

data PublishTarget Source #

One ecosystem's publish target, resolved once: the worker's write endpoint and its token provider.

Constructors

PublishTarget 

Fields

  • ptEcosystem :: Ecosystem

    The ecosystem this publish target serves.

  • ptMirrorUrl :: RegistryUrl

    The mirror-target endpoint the worker publishes approved artifacts to.

  • ptUploadUrl :: RegistryUrl

    The exact native upload endpoint, independently configured from the read root.

  • ptPresentation :: ServicePresentation

    How the mirror target's store asks for the write token on reads and writes.

  • ptUsername :: Maybe Text

    The mirror target's configured username, if any. A store that declares its mechanism renders its own.

  • ptCredentials :: CredentialProvider

    The provider minting the mirror-target write token.

planPublishTargets :: MirrorMintPlan -> CredentialProviders -> ValidatedPlan -> Either [BootError] [PublishTarget] Source #

Each cleared mount's publish target, or the aggregated boot errors. A role that mints no write credential plans none.