-
Notifications
You must be signed in to change notification settings - Fork 11
feat: request grant confirmation for config updates #39
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
Merged
DarianM
merged 43 commits into
main
from
al/13-request-grant-confirmation-for-config-updates
Mar 21, 2025
Merged
Changes from 34 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
29fbddf
add open payments library
lengyel-arpad85 07183bc
corrected type
lengyel-arpad85 eb14c77
required grant in api response
lengyel-arpad85 3dc2aa4
format
lengyel-arpad85 fb757f2
Merge branch 'main' into al/13-request-grant-confirmation-for-config-…
lengyel-arpad85 b41355d
OP env vars
lengyel-arpad85 1186c08
validate form functionality moved to a function
lengyel-arpad85 423c272
get grant interact url
lengyel-arpad85 468fd0f
wallet ownership modal and grant confirmation
lengyel-arpad85 b5f0bbf
Merge branch 'main' into al/13-request-grant-confirmation-for-config-…
lengyel-arpad85 de8afd3
fix opening grant confirmation link
lengyel-arpad85 e407768
lint
lengyel-arpad85 961b383
cleanup OP functions
lengyel-arpad85 e746c43
add finalizeValidationPayment
lengyel-arpad85 c289840
Merge branch 'main' into al/13-request-grant-confirmation-for-config-…
lengyel-arpad85 618e0d3
re-add awaits
lengyel-arpad85 7a09f69
remove duplicat modal
lengyel-arpad85 14b72e1
OP functions updated to work as wallet ownership validation
lengyel-arpad85 3d928d2
process grant response
lengyel-arpad85 83980cb
backend handle session
lengyel-arpad85 c08999a
backend cookie handling
lengyel-arpad85 3a6352b
Merge branch 'main' into al/13-request-grant-confirmation-for-config-…
DarianM ff89b02
remove query params from form
lengyel-arpad85 623a8ce
removed fetching quote as unnecesary
lengyel-arpad85 af10f44
move server files to server directory
lengyel-arpad85 16ca8a1
moved detection of missing param
lengyel-arpad85 31f1791
global crypto
lengyel-arpad85 2c7d59b
painfull this was, state loss is fixed
lengyel-arpad85 aeb3f94
Update frontend/app/lib/server/open-payments.server.ts
lengyel-arpad85 c28ec39
revert change
lengyel-arpad85 874c16a
removed unused code
lengyel-arpad85 fea654c
removed dangerouslySetInnerHTML
lengyel-arpad85 865158a
changed order of formdata
lengyel-arpad85 1803c98
session secret exported
lengyel-arpad85 1da37fd
fix error on new version creation
lengyel-arpad85 5d124b0
fixed new version fail when unauthenticated
lengyel-arpad85 952b57c
Merge branch 'main' into al/13-request-grant-confirmation-for-config-…
lengyel-arpad85 d584b93
typo fixed
lengyel-arpad85 31e97f9
standardize wallet address
lengyel-arpad85 2f00e24
fallback when missing walletaddress
lengyel-arpad85 987cdfb
ensure new version has value assigned
lengyel-arpad85 b1e3195
improved logic of when to set new version value
lengyel-arpad85 d18ae66
changed validation logic order
lengyel-arpad85 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 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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { createCookieSessionStorage } from '@remix-run/node' | ||
|
|
||
| export const SESSION_COOKIE_SECRET_KEY = | ||
| process.env.SESSION_COOKIE_SECRET_KEY || 'supersecretilpaystring' | ||
|
|
||
| const { getSession, commitSession, destroySession } = | ||
| createCookieSessionStorage({ | ||
| cookie: { | ||
| name: 'wmtools-session', | ||
| httpOnly: true, | ||
| secure: true, | ||
| sameSite: 'none', | ||
| secrets: [SESSION_COOKIE_SECRET_KEY] | ||
| } | ||
| }) | ||
|
|
||
| export { getSession, commitSession, destroySession } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import 'express-session' | ||
|
|
||
| declare module 'express-session' { | ||
| interface Session { | ||
| validForWallet?: string | ||
| } | ||
| } |
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
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
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
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
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
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
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
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
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
File renamed without changes.
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.
do you think we should add a maxAge or delete the wmtools-session cookie when the session/tab closes?
basically asking the user for a new grant confirmation over a period of time or after the tab closes.
only session gets cleared after a session but not this
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.
sadly there is no way of detecting when tab closes (browser event
onunloadfires even when navigating to a different domain, so it would remove the cookie everytime we go to IDP to confirm the grant)the only solution I see is add maxAge, just need to decide how long that should be ? 10, 30 minutes ? 1h ?