Repository navigation
[M3.7b] Web: applications, deployments and secrets - #169
Merged
Merged
Conversation
The validator now runs in the browser too, where Buffer does not exist. Signed-off-by: Samuel Mbabhazi <[email protected]>
The environment page lists applications and creates them from a shipkeep.yml document validated in the browser with the API's schema, and manages write-only secrets (values never shown, field cleared after each attempt). The application page shows the configuration as YAML, deploys, follows running deployments every 3 s and cancels them. Signed-off-by: Samuel Mbabhazi <[email protected]>
Signed-off-by: Samuel Mbabhazi <[email protected]>
4 tasks done
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 7, 2026
…he CSP (#189) ## What changed The `shipkeep.yml` validator is now compiled at generation time (`pnpm gen:config` → `packages/config-schema/src/gen/validator.ts`) instead of at runtime. Ajv's standalone output needs two small helpers, which live in `validator-runtime.ts`, so Ajv itself no longer reaches the web bundle. ## Why **The environment page has been blank in real browsers since #169.** That page holds application creation, and everything after it is reached through it. Ajv's runtime compiler builds functions from strings. The production CSP (`script-src 'self'`, no `unsafe-eval`) refuses that, so the module threw `EvalError` when loaded and the route rendered nothing. jsdom does not enforce CSP, so every unit test passed, and with CI off the browser suite never ran. A real Chromium run caught it today. Allowing `unsafe-eval` was not considered: the CSP is doing its job, and that would weaken it for the whole UI. ## How it was tested - **Guard test** `csp.spec.ts`: refuses `Function` and `eval`, then loads and validates. It **fails on the old code** with `EvalError` and passes now, so jsdom can no longer hide this. - All golden fixtures, valid and invalid, pass through the generated validator (89 tests). - **Real Chromium**, against the production build, API and a local PostgreSQL 18.4: the environment page renders under the production CSP. That spec arrives in the next PR, with M2.3f2. - Local gate, including the generation drift check. The same schema now validates on the API through the generated code, which the integration suite exercised before this change only through the old path. The fixtures cover the new path; the suite should be rerun with CI-1. ## Security considerations The CSP is unchanged. The generator refuses output containing `require(`, `new Function` or `eval(`. `deepEqual` and `ucs2length` are new hand-written code on validation paths, with their own tests, including lone surrogates. ## Checklist - [x] Tests, including a regression guard - [x] No new shell invocation, no new secret exposure path - [x] Generated code comes from the schema, not edited by hand (rule 9) - [x] No new state change Signed-off-by: review <[email protected]> Co-authored-by: review <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
M3.7b plus the application screens: from the web UI you can now create an application, set its secrets, deploy it and follow the deployment.
shipkeep.ymldocument in a YAML editor prefilled with an example. The document is validated in the browser with the API's own schema (@shipkeep/config-schema). Problems are listed by JSON pointer before anything is sent.…/applications/:applicationId):DeliveryApiextends the workspace client: same origin, CSRF, bounded errors.parseShipkeepConfigmeasured documents with Node'sBuffer, which does not exist in the browser. It now usesTextEncoder.@shipkeep/config-schema(workspace) andyaml2.9.1 (ISC, already in the lockfile) for the web app. They load only in lazy route chunks: the initial bundle is 361 kB, under the 500 kB budget.How it was tested
delivery-pages.spec.ts, with a fake API:/namewithout any request, and valid YAML posts the exact parsed config;queued, and cancels.Security considerations