Closed Bug 878105 Opened 10 years ago Closed 10 years ago

Ensure origin for packaged app is unique


(Marketplace Graveyard :: Developer Pages, defect, P1)



(Not tracked)



(Reporter: andy+bugzilla, Assigned: robhudson)



In bug 852720 packaged apps were allowed to have an origin in the manifest. This is for the developer tools to ensure that if an origin is present on a packaged app, it is unique within the marketplace.
Why do we need them to be unique?
I'm trying to remember the security meeting, I was wonder the impression we didn't want colliding origins. But I can't remember exactly, Raymond can you remember.

If they aren't unique, I can't use them for receipts and would have to use something else.
Flags: needinfo?(rforbes)
Blocks: 867265
Nevermind, says they are unique
No longer blocks: 867265
Flags: needinfo?(rforbes)
Priority: -- → P1
Blocks: 867265
When the switch 'webapps-unique-by-domain' is enabled this already happens. Should we separate packaged app origins from this switch so they are always unique? Seems like a good idea to me.
Assignee: nobody → robhudson.mozbugs
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2013-06-27
Please add STR here or mark it with [qa-] if no QA is needed.
To verify:
Submit a packaged app with an origin. Try to submit a 2nd packaged app with that same origin. You should get an error at submission time.
I tried to submit a 2nd packaged app with the same origin, and after I clicked contine, it just refreshed the submission page and no error message was displayed. I got the same behavior after submitting a packaged app with an invalid origin. Verified in on FF25 (Win 7)
Please see screencast
Resolution: FIXED → ---
Target Milestone: 2013-06-27 → 2013-07-18
I started working on this and it's more complicated than it seems. (Likewise for bug 892694 when we get to it).

The reason is we're validating a zip file before we actually save it. If the zip file is bad we want to toss it away and only create the FileUpload record that has the validation results with it. If the file size is < 2.5MB Django keeps it in memory but parse_addon requires a file on disk.

The form is going to have to check if it's an in-memory file and if so, create the file on disk to pass it to parse_addon in order to get the origin out of it.

The most straightforward approach is to do the above in the form -- make a tempfile, parse it, then throw it away when done.

But I'm also wondering if it might be nice to update our SafeUnzip library to take a file-like object and not assume a file on disk so we can pull this file out and handle it all in-memory.
I went with the in-memory approach:
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Verified as fixed in on FF25 (Win 7).
Postfix screencast
Closing bug.
You need to log in before you can comment on or make changes to this bug.