-
Notifications
You must be signed in to change notification settings - Fork 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
[Spec] Correctly validate payeeOrigin #160
Conversation
@annevk - PTAL (and apologies for the delay!). I wasn't sure if we should be doing the same 3rd step as postMessage does, which is:
I assume this is for normalization, but I'm unclear if its desirable for SPC as it seems to be a tuple rather than a string then? |
If you don't have an actual origin, how would you do a same origin check? Internally you also want origins to be "objects". If you need to output it at some point you can serialize it then. |
I may not be following you; nowhere in the spec is For example, in a redirect flow, |
Okay, so you essentially use a serialized form of the origin for signing (which would still end up being compared I suspect at some other point by another party?). In that case you do still want to extract the origin from URL. Then you probably want to check that it's not an opaque origin (and fail if it is one). And I guess you might even want to enforce that the origin's scheme is And yeah, normalization is important here. E.g., if the supplied value is |
Ah yes, very good points. I'm embarrassed - I hadn't even considered that (I now assume) the URL parser would accept Thanks, I'll update the PR and ping for re-review. I appreciate your help! |
@annevk - PTAAL. I now check the |
ff86ef7
to
a5f8c82
Compare
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.
Yeah this works I think. Modifying data is a little weird, but it's a copy so it should be okay.
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.
This looks pretty solid, thanks.
(By the way, if you ever need to add something from a WHATWG specification to an anchors block, please file an issue. To a large extent they are code smell.)
Co-authored-by: Anne van Kesteren <[email protected]>
Ack, thanks (and thanks for the review!) |
SHA: ea5e611 Reason: push, by @stephenmcgruer Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fixes #149
Preview | Diff