User story / Problem statement
Currently the registry mounts no CORS middleware, so a browser dApp on another origin can send a
request but cannot read the response. canton-dappbooster hit this: its dev server is on 3012 and
the registry on 3013, so the metadata calls its config load depends on fail with an opaque
TypeError: Failed to fetch, and the transfer-factory POST triggers a preflight nothing answers.
Expected outcome
A browser dApp on a configured origin can call the registry directly and read the responses,
preflighted POST included. Which origins are allowed is deployment configuration, not a
hardcoded wildcard.
Acceptance criteria
Alternatives considered
Each consumer proxies the registry behind its own origin. It works, but every consumer
reimplements it and the registry's routes end up behind a second URL shape.
Technical notes
registry/src/server.ts mounts only the request-target canonicaliser, express.json(), the
OpenAPI validators and the routers, and the package has no cors dependency.
registry/src/config.ts has no origins key. @bootnodedev/canton-wallet-service already does
this with the cors package and a WALLET_SERVICE_CORS_ORIGINS list, a shape worth matching.
Additional context
Found while implementing BootNodeDev/canton-dappbooster#172, which points its dApp at the
registry on 3013.
User story / Problem statement
Currently the registry mounts no CORS middleware, so a browser dApp on another origin can send a
request but cannot read the response.
canton-dappboosterhit this: its dev server is on 3012 andthe registry on 3013, so the metadata calls its config load depends on fail with an opaque
TypeError: Failed to fetch, and the transfer-factoryPOSTtriggers a preflight nothing answers.Expected outcome
A browser dApp on a configured origin can call the registry directly and read the responses,
preflighted
POSTincluded. Which origins are allowed is deployment configuration, not ahardcoded wildcard.
Acceptance criteria
Access-Control-Allow-Originfor a request from an allowed originOPTIONSon the transfer-factory route is answered without reaching the OpenAPI validatorAlternatives considered
Each consumer proxies the registry behind its own origin. It works, but every consumer
reimplements it and the registry's routes end up behind a second URL shape.
Technical notes
registry/src/server.tsmounts only the request-target canonicaliser,express.json(), theOpenAPI validators and the routers, and the package has no
corsdependency.registry/src/config.tshas no origins key.@bootnodedev/canton-wallet-servicealready doesthis with the
corspackage and aWALLET_SERVICE_CORS_ORIGINSlist, a shape worth matching.Additional context
Found while implementing BootNodeDev/canton-dappbooster#172, which points its dApp at the
registry on 3013.