-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix: avoid email delegation via GET request #430
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,7 @@ describe('access/authorize', function () { | |
/** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/capabilities/types').AccessSession]>} */ ( | ||
url.searchParams.get('ucan') | ||
) | ||
const rsp = await mf.dispatchFetch(url) | ||
const rsp = await mf.dispatchFetch(url, { method: 'POST' }) | ||
const html = await rsp.text() | ||
|
||
assert(html.includes(encoded)) | ||
|
@@ -119,7 +119,7 @@ describe('access/authorize', function () { | |
|
||
const url = new URL(inv) | ||
// click email url | ||
await mf.dispatchFetch(url) | ||
await mf.dispatchFetch(url, { method: 'POST' }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does the comment say 'click email url', which I assume would usually involve an HTTP GET, but this changes it to 'POST'? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right so this change splits the approval process into 3 pieces (from the 2 that it is now):
here's the page that gets served by the GET request: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and for clarity, in this framing our current process is:
|
||
|
||
// ws | ||
const res = await mf.dispatchFetch('http://localhost:8787/validate-ws', { | ||
|
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.
ah, thanks for catching these up! I thought I had successfully re-run the tests but apparently not.
(and this is the exact change intended/expected — for anything out there in the wild that was relying on the old approval URLs they simply need to
POST
instead ofGET
after these changes)