ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Config.AdvisoryStore

Description

Derive the advisory-database store from advisories.url's own scheme, once at load (mkAdvisoryStoreUrl), the way Ecluse.Config.QueueTarget derives the mirror-queue backend.

s3://bucket[/prefix] names the S3 store. No separate provider selector exists to disagree with the URL, and a scheme this build does not know is refused at load rather than dialled. advisoryStoreBucket and advisoryObjectKey are the one place the proxy's sync and Pilot's export agree on where an artifact lives.

Synopsis

Documentation

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.

mkAdvisoryStoreUrl :: Text -> Text -> Either Text AdvisoryStoreUrl Source #

Build the AdvisoryStoreUrl an advisories.url key resolves to, the key naming every refusal. The credential refusal runs first, because the refusals below it quote the value.

advisoryStoreBucket :: AdvisoryStoreUrl -> Text Source #

The bucket the store names.

advisoryObjectKey :: AdvisoryStoreUrl -> FilePath -> Text Source #

The object key one compiled artifact takes in the store: the configured prefix ahead of the artifact's own file name.