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

feat: add iframe permissions support #399

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

beaugunderson
Copy link
Member

@beaugunderson beaugunderson commented Feb 7, 2025

@beaugunderson beaugunderson requested a review from a team as a code owner February 7, 2025 20:29
@beaugunderson beaugunderson changed the title Add iframe permissions support feat: add iframe permissions support Feb 7, 2025
@beaugunderson beaugunderson requested a review from aduane February 10, 2025 22:08
Copy link
Collaborator

@aduane aduane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want these to be specified in the manifest rather than in the effect. This will allow the permissions to be surfaced on an extension listing page.

@beaugunderson
Copy link
Member Author

We want these to be specified in the manifest rather than in the effect. This will allow the permissions to be surfaced on an extension listing page.

hmm... the permissions will need to be pairs of url,permission then, since one plugin may launch modals with different URLs and may not want the permissions to apply to every URL, does that work?

@aduane
Copy link
Collaborator

aduane commented Feb 11, 2025

Yes

@beaugunderson
Copy link
Member Author

@aduane how does this look?

88621

example:

{
	...
	"url_permissions": [
		{
			"url": "https://example-a.com/testing",
			"permissions": ["microphone"]
        },
		{
			"url": "https://example-b.com",
			"permissions": ["allow-same-origin", "microphone"]
        },
	]

@aduane
Copy link
Collaborator

aduane commented Feb 11, 2025

I think the structure looks good, but I wonder about the name. Should it mention iframe in the attribute name? Should we merge this with what we have for origins? That would require a period of dual compatibility and a deprecation cycle, though.

Screenshot 2025-02-11 at 12 38 21 PM

I'm trying to think backwards from what we would display on a plugin's listing page.

This plugin can embed the following URLs:

url permissions
https://canvasmedical.com microphone scripts cookies from same origin

@beaugunderson
Copy link
Member Author

you could have origins and origin_permissions... but that does seem overkill, personally I'd just want all the configuration grouped under each origin

@aduane
Copy link
Collaborator

aduane commented Feb 11, 2025

Like this?

{
  "other_stuff": "..."
  "origins": [
    {
        "url": "http://www.canvasmedical.com",
        "permissions": ["allow-same-origin", "microphone"]
    },
    {
        "url": "http://example.com",
        "permissions": ["scripts", "microphone", "allow-downloads", "usb"]
    }
  ]
}

We'd be mixing concepts here. Some would belong in the sandbox attribute, others would end up in the CSP. I think the usb one (which we don't really need to worry about) would end up in headers(?)

Definitely a good developer experience, we would just have to take on the burden of sorting them out on our end (which is a mark of a good platform! shift the complexity away from the developer and towards the platform)

@beaugunderson
Copy link
Member Author

yes, the other PR already sorts them into the right place (allow and sandbox respectively)

@aduane
Copy link
Collaborator

aduane commented Feb 11, 2025

I like it as long as we identify when the "old way" of defining origins is used and provide a warning / a cutover date for when the "new way" is the "only way".

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

Successfully merging this pull request may close these issues.

2 participants