Closed
Bug 1383293
Opened 7 years ago
Closed 7 years ago
Add new readonly attribute principal in nsIPaymentRequest
Categories
(Core :: DOM: Web Payments, enhancement)
Core
DOM: Web Payments
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: jonathanGB, Assigned: edenchuang)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 5 obsolete files)
20.30 KB,
image/png
|
Details | |
17.27 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
18.55 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
As discussed on #payments, it would be simpler/more robust for the RequestPayment UI to simply fetch the origin "principle" from the DOM API rather than going through layers of tabs and windows to find the information. It would be great if that information was part of the "payment-request-service". Thanks!
Reporter | ||
Updated•7 years ago
|
Summary: Add origin "principle" in payment-request-service → Add origin "principal" in payment-request-service
Assignee | ||
Comment 1•7 years ago
|
||
Hi Jonathan I want to make sure what information you really need. Is "origin" enough, or you need "principal"?
Flags: needinfo?(jguillotteblouin)
Reporter | ||
Comment 2•7 years ago
|
||
Flags: needinfo?(jguillotteblouin)
Reporter | ||
Comment 3•7 years ago
|
||
(In reply to Eden Chuang[:edenchuang] from comment #1) > Hi Jonathan > > I want to make sure what information you really need. Is "origin" enough, or > you need "principal"? As you can see in the screenshot attached, we really only need the origin. I doubt we'll need the principal eventually, but if the cost is minimal maybe it'd be useful to just use the principal in order for it to be future-proof.
Flags: needinfo?(MattN+bmo)
Comment 4•7 years ago
|
||
The principal should always be preferred for security information so that's what should be passed. To be clear though, it should be the top-level origin and should be labelled as such.
Flags: needinfo?(MattN+bmo)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → echuang
Status: NEW → ASSIGNED
Summary: Add origin "principal" in payment-request-service → Add new readonly attribute principal in nsIPaymentRequest
Assignee | ||
Comment 5•7 years ago
|
||
Assignee | ||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Comment on attachment 8897393 [details] [diff] [review] Bug 1383293 - Adding a new readonly attribute in nsIPaymentRequest. r?baku Review of attachment 8897393 [details] [diff] [review]: ----------------------------------------------------------------- From skimming the patch I don't think this is implementing what we need in the UI. See the 2nd sentence in comment 4 where I explain we need the top-level document's principal, not the principal of the document that creates the request. The test case should handle this cross-origin sub-frame approach.
Assignee | ||
Comment 8•7 years ago
|
||
The principal is the top level principal of new PaymentRequest() caller.
Attachment #8897393 -
Attachment is obsolete: true
Assignee | ||
Comment 9•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7d5a23f3e317e9dd4acf553c469f45e2e51d5a89
Assignee | ||
Comment 10•7 years ago
|
||
Saving top level principal information in nsIPaymentRequest when constructing PaymentRequest. And providing a new readonly attribute nsIPrincipal principal in nsIPaymentRequest for UI to query the top level principal information.
Attachment #8897758 -
Attachment is obsolete: true
Attachment #8899719 -
Flags: review?(amarchesini)
Assignee | ||
Comment 11•7 years ago
|
||
Adding checks in ConstructorChromeScript.js to test the new readonly attribute. Removing useless test case.
Attachment #8897394 -
Attachment is obsolete: true
Attachment #8899724 -
Flags: review?(amarchesini)
Comment 12•7 years ago
|
||
Comment on attachment 8899719 [details] [diff] [review] Bug 1383293 - Adding a new readonly attribute principal in nsIPaymentRequest for UI to query top level principal information. r?baku Review of attachment 8899719 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/interfaces/payments/nsIPaymentActionRequest.idl @@ +63,5 @@ > > /* > + * The triggering principal > + */ > + readonly attribute nsIPrincipal principal; If this is the top-level document's principal then the name should reflect that as I said before. The comment would also be stale since IIUC the triggering principal would normally refer to the principal that triggered the dialog from the subframe.
Attachment #8899719 -
Flags: feedback-
Assignee | ||
Comment 13•7 years ago
|
||
Modify the patch according to comment 12. Change the attribute name to topLevelPrincipal.
Attachment #8899719 -
Attachment is obsolete: true
Attachment #8899719 -
Flags: review?(amarchesini)
Attachment #8900146 -
Flags: review?(amarchesini)
Assignee | ||
Comment 14•7 years ago
|
||
modify the patch according to comment 12. 1. change the attribute name to topLevelPrincipal 2. adding a new test testCrossOriginTopLevelPrincipal in test_constructor.html to testing topLevelPrincipal under cross origin situation.
Attachment #8899724 -
Attachment is obsolete: true
Attachment #8899724 -
Flags: review?(amarchesini)
Attachment #8900148 -
Flags: review?(amarchesini)
Updated•7 years ago
|
Attachment #8900146 -
Flags: review?(amarchesini) → review+
Updated•7 years ago
|
Attachment #8900148 -
Flags: review?(amarchesini) → review+
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Comment 15•7 years ago
|
||
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/8f9e0ce46ae4 Add a new readonly attribute topLevelPrincipal in nsIPaymentRequest for UI support. r=baku https://hg.mozilla.org/integration/mozilla-inbound/rev/33d4c40de9a2 Mochitest for testing the new readonly attribute topLevelPrincipal in nsIPaymentRequest. r=baku
Keywords: checkin-needed
Comment 16•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8f9e0ce46ae4 https://hg.mozilla.org/mozilla-central/rev/33d4c40de9a2
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•