Repository navigation
feat(deploy): sync the portal's Numina and Stripe keys and allow their APIs - #598
Conversation
…r APIs Add the business-site-numina and business-site-stripe ExternalSecrets through the namespaced openbao store, and allow HTTPS egress to exactly api.numina.app and api.stripe.com. The WebApp does not project the new Secrets: the platform admits one non-optional projection, so a missing billing entry would stop the public pages from starting. The README records the projection items and portal-settings lines for later. The tenant validator, its tests and the publication verifier admit exactly the new manifests and refuse widened variants. Both billing flags stay off. Refs #597 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codex review for the tenant package admits exactly the two billing ExternalSecrets and FQDN egress, the validators refuse widened variants, and nothing can stop the public pages from starting while the billing entries are missing |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Exercised at
|
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
#598's billing test pinned the WebApp's one projection to business-site-disclosure and forbade a portal-settings argument. This PR projects the platform's business-site-runtime instead, with the portal settings file. The test keeps its point: one Secret, never optional, and no Numina or Stripe Secret in it. Refs #302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…594) * feat(deploy): project the platform's runtime Secret into the WebApp The WebApp now projects the platform-composed `business-site-runtime` Secret with exactly four items (company-disclosure as disclosure, portal-settings, portal-client-secret, portal-database-ca) and passes `--portal-settings-projection /run/webapp-inputs/portal-settings`. While sign-in is off the settings item holds only a comment line, so the portal reads none of the other portal items and stays closed. The package validator admits exactly that Secret, those items and the appended argument pair, and the package tests refuse missing, renamed, extra or relocated inputs. The Docker smoke mounts fictional files for all four items, proves serving fails closed without the disclosure or the settings item, and keeps the portal closed with a comment-only settings file. The public receipt check omits the settings argument, which it refuses by design. The projection fixture now verifies every copied item and drops macOS tar metadata that a Linux daemon cannot set. The retained disclosure ExternalSecret is no longer projected; removing it is a later cleanup. Merge only after `business-site-runtime` exists in production: without it the Pods cannot start. Refs #302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(deploy): keep billing keys out of the runtime projection #598's billing test pinned the WebApp's one projection to business-site-disclosure and forbade a portal-settings argument. This PR projects the platform's business-site-runtime instead, with the portal settings file. The test keeps its point: one Secret, never optional, and no Numina or Stripe Secret in it. Refs #302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Summary
This prepares the tenant package for the portal's Numina invoices and Stripe card payments (#587, #588, #590). Both flags,
portal-invoice-billingandportal-card-billing, stay off.ExternalSecrets. They mirror
external-secret-disclosure.yaml: the namespacedopenbaoSecretStore,refreshInterval: 1h,creationPolicy: Owner, and named properties of one exact entry each.business-site-numinareadsapps/business-site/numinapropertyapi-key.business-site-stripereadsapps/business-site/stripepropertiesapi-keyandwebhook-secret.Egress (
network-policy.yaml): theegress: [{}]default-deny rule becomes one rule that allows TCP 443 to exactlyapi.numina.appandapi.stripe.combytoFQDNsmatchName. Any egress rule keeps every other destination default-denied.Docs (
deploy/README.md): a new "Portal billing inputs" section. It names the Secrets and entries, the files to project, their confinement and the exact portal-settings lines:The optional
PORTAL_NUMINA_API_URL,PORTAL_NUMINA_SALES_ACCOUNT,PORTAL_NUMINA_VAT_CODEandPORTAL_STRIPE_API_URLkeep their defaults when omitted. The runtime refuses billing lines unless the five portal dependency keys are present too. The egress paragraph now describes the new rule.Validators:
scripts/check-tenant-package.mjsadmits exactly nine resources with exactly these three ExternalSecrets and this egress rule.scripts/tenant-package.test.mjsadds 24 refusals: a missing or duplicate billing sync, a foreign entry, tenant or property, the shared cluster store, overwriting or merging into the disclosure Secret, an inline value, a bulk import, an extra or missing Stripe property, a projected billing key, an extra name, a wildcard or*pattern, port 80, an extra port, port-only or port-unrestricted egress, a second rule, and the old[{}].scripts/verify-runtime-publication.shadmits the two new manifest members, andscripts/runtime-verification.test.shadds a missing-Stripe and an altered-Numina control.Why the keys are not projected yet
The platform's WebApp RGD declares
secretProjectionswithmaxItems=1and always renders the volume withoptional: false. So:The runtime reads these files only when portal settings name them, and the portal-settings projection is not wired yet. So nothing reads them today. The README records the three items (
numina-api-key,stripe-api-key,stripe-webhook-secret) to add once the one projected Secret carries these keys. This interacts with #594, which moves the single projection to a platform-composedbusiness-site-runtimeSecret. If that Secret is where the keys end up, the platform composes them there, and these tenant ExternalSecrets may become redundant. That is the maintainer's call.Validation
kubectl kustomize deploy | node scripts/check-tenant-package.mjs: accepted.node --test scripts/tenant-package.test.mjs: 118/118 pass.bash scripts/runtime-verification.test.sh,bash scripts/publishing-contract.test.sh,bash scripts/runtime-release.test.shandbash scripts/runtime-publisher-contract.test.sh: pass.applyagainst the platform's policies on the rendered package, as thebusiness-siteservice account in amanaged-by: kronamespace:restrict-tenant-network-policiespasses the new CiliumNetworkPolicy. Three negative controls fail as expected:matchPattern: "*", port-only egress andtoEntities: [world].restrict-tenant-secret-storespasses the SecretStore and all three ExternalSecrets. AClusterSecretStorevariant fails.shellcheckis clean for both changed scripts. markdownlint (MegaLinter's config) andmarkdown-table-formatter --checkare clean for the README. jscpd with MegaLinter's v10.2.0 config finds no clone in any changed file.node scripts/tenant-runtime-smoke.test.mjs.webapp.yamlis unchanged, and the committed baseline image predates the current runtime arguments, so CI runs the smoke against its newly built image.Fixes #597
🤖 Generated with Claude Code