Implemented phase 4 for the POC prototype in the Website service.

This commit is contained in:
javier committed 2026-09-21 12:55:35 +02:00
1 parent 95e0a455e8
commit 9403931109
42 files changed
+3407 -36

No files matched your search

@@ -69,6 +69,7 @@ func application(
// building both against an empty host.
siteOrigin: reader.siteOrigin.isEmpty ? nil : reader.siteOrigin,
logLevel: reader.logLevel,
passkeysOrigin: reader.passkeysOrigin,
probe: Probe(fluent: fluent),
accounts: AccountRepository(fluent: fluent),
trade: TradeRepository(fluent: fluent),
@@ -183,6 +184,7 @@ private func logger(
/// - securityHeaders: the security headers applied to every response.
/// - siteOrigin: the public origin the pages derive their canonical URLs and language alternates from, or `nil` to omit them.
/// - logLevel: the level the request-logging middleware logs at.
/// - passkeysOrigin: the origin the `PasskeyController` binds passkeys to.
/// - probe: the probe consulted by the `HealthController` readiness route.
/// - accounts: the repository the `SessionController` finds and creates accounts through.
/// - trade: the repository the `TradeController` reads and writes conversations, offers, and sales through.
@@ -200,6 +202,7 @@ private func router(
securityHeaders: SecurityHeadersMiddleware<AppRequestContext>.Configuration,
siteOrigin: String?,
logLevel: Logger.Level,
passkeysOrigin: String,
probe: Probe,
accounts: AccountRepository,
trade: TradeRepository,
@@ -260,6 +263,19 @@ private func router(
assetVersion: assetVersion,
analytics: analytics
)
PasskeyController<AppRequestContext>(
origin: passkeysOrigin,
accounts: accounts,
sessions: sessions
)
ListingFormController<AppRequestContext>(
catalogue: repository,
trade: trade,
sessions: sessions,
photos: PhotoStore(staticFilesPath: staticFilesPath),
assetVersion: assetVersion,
analytics: analytics
)
TradeController<AppRequestContext>(
trade: trade,
catalogue: repository,
@@ -264,6 +264,14 @@ package extension ConfigReader {
)
}
/// The origin passkeys are bound to, read from the `passkeys.origin` key.
var passkeysOrigin: String {
string(
forKey: .Passkeys.origin,
default: .Passkeys.origin
)
}
/// The directory the static files are served from, read from the `path.staticFiles` key.
var staticFilesPath: String {
string(