Skip to content
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

Expose API to whitelisted pages to preview recipe actions in the add-on #416

Closed
Osmose opened this issue Jan 9, 2017 · 8 comments
Closed
Assignees

Comments

@Osmose
Copy link
Contributor

Osmose commented Jan 9, 2017

When installed, the system add-on should make some form of API available to a whitelisted set of domains that allows them to execute actions in "testing" mode. This will be used on the preview page in the control interface to preview how a recipe will behave.

The whitelisting mechanism should be similar to how UITour's whitelist behaves: http://bedrock.readthedocs.io/en/latest/uitour.html

This was originally mozilla/normandy-addon#30 in the add-on repo.

@Osmose
Copy link
Contributor Author

Osmose commented Apr 14, 2017

@Mossop
Copy link
Member

Mossop commented Apr 14, 2017

The one difference between using Services.mm and the message manager that UITour uses is that UITour's will only see events from webpages loaded in tab while Services.mm will see events from any webpage, so for example the sidebar, webextension panels etc. Since you're going to be doing domain checking I wouldn't expect that to be an issue though but if needs be you can do additional verification when sending a message up to the main process that the page is actually in a tab.

@Osmose Osmose self-assigned this Apr 15, 2017
@Osmose Osmose added this to the Sprint 10 - April 18th, 2017 to April 29th, 2017 milestone Apr 16, 2017
@Osmose
Copy link
Contributor Author

Osmose commented Apr 16, 2017

@Mossop @gijsk I have a question while I'm looking over the UITour implementation:

UITour uses nsiPermissionManager to check for origins that have permission to use UITour, and add the origins they care about to the list of default permissions. However, as a system add-on, we'd have to manually add the origins we care about on startup to the permissions manager anyway (or at least once; I can't tell if they persist after being added).

Given that, is there any point to using nsiPermissionManager if we're going to be doing our own domain checking for test origins anyway?

@Mossop
Copy link
Member

Mossop commented Apr 16, 2017

I don't think there is any need to use the permissions manager, just hardcode your domains.

@gijsk
Copy link
Contributor

gijsk commented Apr 17, 2017

nsIPermissionManager does persist, but I agree with Mossop that hand-rolling this is fine, on the assumption that we get the relevant checks correct. :-)

(Basically, what I think you'll want is checking document.nodePrincipal and checking that that matches some whitelisted principal.)

@Osmose
Copy link
Contributor Author

Osmose commented Apr 24, 2017

After talking with ulfr, I filed bug 1359198 to get feedback/approval on the security model of this feature.

@Osmose Osmose removed this from the Sprint 10 - April 18th, 2017 to April 29th, 2017 milestone Apr 26, 2017
@Osmose
Copy link
Contributor Author

Osmose commented Apr 26, 2017

This is blocked until the discussion in that bug is resolved.

@mythmon
Copy link
Contributor

mythmon commented Jun 21, 2017

We have decided to remove the preview feature entirely.

@mythmon mythmon closed this as completed Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants