-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(backend): remove wallet address middleware #2708
Closed
Closed
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4936272
feat(backend): SPSPRouteError
mkurapov c5bfc9f
chore(backend): remove wallet address middleware, replace with inline…
mkurapov 6cf1e7f
feat(backend): SPSPRouteError
mkurapov 16d95bf
Merge branch '1905/mk/spsp-errors' into 1905/mk/remove-wallet-address…
mkurapov b0b6e13
feat(backend): SPSPRouteError
mkurapov 67a67b5
Merge branch '1905/mk/spsp-errors' into 1905/mk/remove-wallet-address…
mkurapov 18a4ba5
chore(backend): use getOrPollByUrl in SPSP middleware
mkurapov a123c69
Merge branch 'main' into 1905/mk/spsp-errors
mkurapov 221f55f
Merge branch '1905/mk/spsp-errors' into 1905/mk/remove-wallet-address…
mkurapov 9307437
chore(backend): update log during wallet address polling
mkurapov 62b3e9a
chore(backend): minor cleanup in app.ts
mkurapov 6725937
chore(backend): convert error log to debug statement in getOrPollByUrl
mkurapov d657a8d
chore(backend): updating wallet address get route
mkurapov 5b59c71
Merge branch 'main' into 1905/mk/remove-wallet-address-middleware
mkurapov 2082015
chore(backend): remove unused walletAddress arg
mkurapov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not get a specific wallet address in the following OP requests (either in the query params or request body):
GET /incoming-payments/:id
GET /outgoing-payments/:id
GET /quotes/:id
POST /incoming-payments/:id/complete
We need the
walletAddressUrl
in order to pass down intocreateTokenIntrospectionMiddleware
, as the middleware needs to determine whether the possibleidentifier
on the grant matches up to the resource for the particular wallet address.This is why we still need to get the resource first, before we can proceed with handling the request. The status quo is returning a 401/Unauthorized response code (to not give away information about whether resource exists or not). Maybe this should be 400, but I don't have a strong opinion here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to add tests for this, but I would need to do some work about splitting apart these in-line middlewares into separate functions. I can handle it in a separate PR where I do a little more refactoring, since I don't want to balloon this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the following:
GET /incoming-payments/:id
GET /outgoing-payments/:id
GET /quotes/:id
we could just store these on
ctx.state
and not have to call the<resource>Routes.get
/fetch the resource from the DB again, but a) could be done in separate PR, or b) not worth doing at all for the consistency of having the routes as they are