Closed mkurapov closed 4 months ago
Name | Link |
---|---|
Latest commit | bffcaa5e6d723a2327f007a1125c821f4bc06958 |
Latest deploy log | https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/664c9ffc9d1af20008f24f03 |
Deploy Preview | https://deploy-preview-2722--brilliant-pasca-3e80ec.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
walletAddressUrl
is added to thectx
as a middleware specific to the route route, meaning we can remove all-encompassing logic inwalletAddressMiddleware
. Likewise, we don't need to actually fetch the wallet address before doing token introspection and http sig verification
This is much better. Low coupling/high cohesion. 👍
Changes proposed in this pull request
To finalize the standardization of Open Payments route errors in
backend
, this PR splits upwalletAddressMiddleware
into several separate middlewares. One group of them deals with adding the walletAddressUrl onto the ctx (from several resources), whilegetWalletAddressForSubresource
simply polls for the active wallet address by using thectx.walletAddressUrl
itself. Each of the middlewares is then added explicity to the route.The benefits:
openPaymentsServerErrorMiddleware
(i.e. we don't usectx.throw
at all in other places)walletAddressUrl
is added to thectx
as a middleware specific to the route route, meaning we can remove all-encompassing logic inwalletAddressMiddleware
. Likewise, we don't need to actually fetch the wallet address before doing token introspection and http sig verificationOther changes:
accept
header to include'application/spsp4+json'
explicitlyContext
Fixes #1905 for backend
Checklist
fixes #number