Repository navigation
Four DX and hardening fixes: webhook egress, SDK generation, devcontainer toolchain, compose stack (#1490, #1496, #1498, #1500) - #1518
Merged
Smartdevs17 merged 4 commits intoNov 20, 2026
Conversation
…17#1490) Webhook deliveries POSTed to any merchant-supplied URL. Add an egress policy checked at endpoint registration and again before each delivery: - https only, no userinfo, port in WEBHOOK_EGRESS_ALLOWED_PORTS (443) - host must match WEBHOOK_EGRESS_ALLOWED_HOSTS (exact or *.suffix); an empty list denies all egress - loopback, private, CGNAT, link-local and multicast addresses are always denied, including IPv4-mapped IPv6; DNS answers are checked - redirects are not followed A permanent denial dead-letters without sending. A DNS failure retries. Registration returns 400 with a reason. Operators must set WEBHOOK_EGRESS_ALLOWED_HOSTS before webhooks deliver.
…Smartdevs17#1496) The generate job called sdk:generate:<lang> scripts that did not exist, so it could not run. Add them, backed by scripts/sdk/generate-sdk.mjs, which reads backend/openapi-generator.config.json and runs the pinned openapi-generator-cli image. Generation runs on every push. make test-tooling now also runs scripts/*/*.test.mjs.
…evs17#1498) Build the Rust toolchain (wasm32 target, clippy, rustfmt, rust-analyzer) and soroban-cli 21.0.0 in a rust stage and copy them into the devcontainer image, so container create compiles nothing. Drop the Rust devcontainer feature. scripts/setup.sh verifies or installs the toolchain and replaces the inline install in post-create.sh, which hid failures. The Soroban version is pinned in one place and tested against contracts/Cargo.toml.
…vs17#1500) Add backend and frontend services to the root docker-compose.yml under the app profile, built from the production Dockerfiles. Add make up-app. make down also stops app services. Plain docker compose up still starts infra only. Also set output: standalone in the Next config. Dockerfile.frontend and CI already expect standalone output, so this fixes that build. Pass NEXT_PUBLIC_API_URL as a build arg, since Next compiles it in.
|
@TheDEV111 is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@TheDEV111 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Four developer-experience and hardening items in one branch. Each has its own section below, and each closes its issue.
Closes #1490
Closes #1496
Closes #1498
Closes #1500
#1490 Webhook dispatcher egress allow-list and port guards
Outbound webhook URLs were POSTed to with no destination checks. This adds
backend/src/services/webhooks/egress-policy.ts:WEBHOOK_EGRESS_ALLOWED_PORTS(default 443).WEBHOOK_EGRESS_ALLOWED_HOSTS(exact or*.suffix). An empty list denies everything (fail closed).redirect: 'manual'.Behaviour: registration returns 400 with a
reason. A permanent denial dead-letters the delivery without sending. A DNS failure is retried.Breaking for existing deployments: webhooks deliver nothing until
WEBHOOK_EGRESS_ALLOWED_HOSTSis set.Scope note: the issue names
workers/webhookDispatcher/, which does not exist. The dispatcher isbackend/src/services/webhooks/delivery-manager.ts, so the guard lives there.workers/is the Cloudflare edge proxy and was not changed.#1496 Typed SDK generation on every push
.github/workflows/sdk-generation.yml(the issue namessdk-gen.yml, which does not exist) callednpm run sdk:generate:<lang>, but those scripts were missing, so the job could not run. Changes:sdk:generate:{typescript,python,go}tobackend/package.json, backed byscripts/sdk/generate-sdk.mjs. It readsbackend/openapi-generator.config.json, merges the typed options, and runs the pinnedopenapi-generator-cli:v7.0.1image, so no local Java is needed.pathsfilter, so generation runs on every push. PR trigger filter unchanged.make test-toolingnow also runsscripts/*/*.test.mjs. The generator tests include a check that every workflow matrix language has a config and a script.Not changed, and needs a decision:
publish-sdkstill runsrm -rf packages/sdk/srcand replaces it with the generated output on main. That would overwrite the hand-written SDK. Publishing is out of this PR's scope and I did not change it.#1498 Devcontainer with Soroban CLI and Rust targets
.devcontainer/Dockerfilenow has a multi-stage build. Arust:1.93-bookwormstage installs the wasm32 target, clippy, rustfmt, rust-analyzer andsoroban-cli21.0.0. The toolchain is copied into the node image, so it is ready at container create.devcontainer.jsondrops the Rust feature, since the image now provides Rust.scripts/setup.sh: verifies or installs the toolchain.--checkreports status and exits 1 if anything is missing.post-create.shcalls it instead of its own inline install (which swallowed failures).SOROBAN_CLI_VERSIONin setup.sh, mirrored by the Dockerfile ARG). A test keeps it equal tosoroban-sdkincontracts/Cargo.toml.Not verified here: the image build itself (soroban-cli compiles from source, which is slow). Please check the devcontainer CI job.
#1500 One-command local stack via compose profile
docker-compose.yml:backendandfrontendservices under theappprofile, built fromDockerfile.backend/Dockerfile.frontend. Without the profile, only infra starts, as before.make up-appstarts the full stack.make downnow also stops app services.frontend/next.config.ts:output: "standalone".Dockerfile.frontendalready expected standalone output, and CI already builds it, so this fixes an existing build failure rather than adding a feature.NEXT_PUBLIC_API_URLis a build arg, because Next compilesNEXT_PUBLIC_*in.docker compose configtests cover the profile contents and build args.Known gap: the database is not migrated automatically. Run
make db-migrateonce against a new database.Testing
make test-tooling: 47/47 pass (makefile dry-run of every target, SDK generator, setup.sh with shimmed toolchains, compose config, docs index, turbo config).node --test scripts/sdk/generate-sdk.test.mjs: 13/13.node --test scripts/setup.test.mjs: 10/10.node --test scripts/compose.test.mjs: 5/5 against the realdocker composebinary.backend:vitest run src/services/webhooks/__tests__/egress-policy.test.ts: 32/32 pass.backendwebhook and route suites: the same 12 files and 49 tests fail on cleanmainand on this branch, so those failures predate this PR. The branch adds one passing file.tsc --noEmit: no new errors in the touched files. The remaining errors inwebhooks-dlq.tsanddelivery-manager.tsare on lines this PR does not change.Notes
cd backend && npm run sdk:generate:typescript(needs Docker).next buildand theDockerfile.frontendimage build, and the devcontainer image build. Please check these in CI before merge.