3.2 KiB
3.2 KiB
Services: cms-api-foundation
The solution has no new domain services: step 0 adds hosting behaviour (middleware and policy) and build/deploy automation. This document defines the orchestration points.
S1. Host composition (CmsHost)
- Responsibility: single place where a client host's services and pipeline are composed.
ConfigureServicesandConfigurePipelinekeep their signatures; the new behaviour enters throughCmsHostOptions. - Orchestration (pipeline order, with the reason):
MigrateCoreDatabase(unchanged).- Exception handler, then security headers, then rate limiter (unchanged). Security headers must stay before static content: static files short-circuit the pipeline, and the website's HTML is almost all the host serves.
- HTTPS redirection (unchanged).
- Static content: admin mount first (unchanged). The website mount is either the existing static mount plus SPA fallback (
SpaFallback) or the prerendered-site middleware (PrerenderedPages). Response compression sits before both. - CORS, modules, authentication, authorization, controllers, health, Sentry tunnel (unchanged).
- The website fallback (
NotFound->404.html) is the last step, after the API routes, so an unknown API path stays an API 404.
- Invariant: reserved prefixes
/admin,/api/v1,/healthare never resolved by the website middleware.
S2. Security header resolution (existing PathPolicyResolver + CspPolicyCatalog)
- Responsibility: path -> policy name (configuration) -> header values (code).
- Change: the catalog knows
StrictSite. Andrea's client setsDefaultPolicy = StrictSite; the three reserved prefixes stayStrict. Startup validation rejects unknown names (unchanged), so a typo cannot produce a weaker policy.
S3. Build and deploy service chain (CI)
sequenceDiagram
box rgba(246,224,94,0.4) CMS repo
participant CC as CMS CI
end
box rgba(99,179,237,0.4) Web repo
participant WC as Web CI
end
box rgba(154,230,180,0.4) Test host
participant H as Andrea CMS host
end
CC->>CC: build admin with VITE_THEME andreaslop
CC->>CC: publish Api.AndreaSlopFotografie
CC->>H: deploy release, atomic switch
WC->>WC: build prerendered site
WC->>H: deliver files to wwwroot/web
WC->>H: verify headers, redirects, 404, CSP
H-->>WC: results
Text alternative: the CMS CI builds and deploys the host with its themed admin; the web CI builds the site, delivers it into the host's website folder and then verifies the host's behaviour.
- Ordering rules: the CMS release switch never touches
wwwroot/web/; the web delivery is idempotent and can run without a CMS deploy; the old static test site stays up until verification passes.
S4. Verification service (verify-deployment.sh)
- Responsibility: the contract test between the repositories. It runs from the web repo against the live host and is the CSP drift guard (design decision Q3).
S5. Hand-off service (process)
- Responsibility: brief out, hand-back in; see C9. The CMS session's AIDLC outputs (its design summary and its hand-back note) are copied or linked under
construction/cms-host/in this feature.