-
Notifications
You must be signed in to change notification settings - Fork 325
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
Adds scoped permissions #386
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alanshaw
force-pushed
the
feat/scoped-permissions
branch
from
February 19, 2018 14:44
211b372
to
930bf98
Compare
alanshaw
force-pushed
the
feat/scoped-permissions
branch
from
February 19, 2018 15:08
930bf98
to
7737081
Compare
…allows scroll if > 3 lines
Bundled page loaded using browser.windows.create won't show contents unless resized. See https://bugzilla.mozilla.org/show_bug.cgi?id=1402110
lidel
approved these changes
Feb 20, 2018
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.
👍 from me (added small fix for FF in inf9b60ff )
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎥 https://youtu.be/v6wuFRDKVBU
This PR introduces scope based permissions - following a similar implementation as service worker registration scopes.
This means that allowing access to:
https://ipfs.io/ipfs/QmQxeMcbqW9npq5h5kyE2iPECR9jxJF4j5x4bSRQ2phLY4/
will allow access to:
https://ipfs.io/ipfs/QmQxeMcbqW9npq5h5kyE2iPECR9jxJF4j5x4bSRQ2phLY4/path/to/something
...but not:
https://ipfs.io/ipfs/QmWfVY9y3xjsixTgbd9AorQxH7VtMpzfx2HaWtsoUYecaX
or other hashes.
resolves #375
Scopes
Permissions are scoped to the origin and path (and sub-paths) of the file from which the permission was requested.
Scoped permissions in
window.ipfs
work similarly to how they work for service worker registrations except that the user cannot control the scope, and it is set to the origin and path from which the permission was requested.Scope based permissions allow applications running on an IPFS gateway to be granted different permissions. Consider the following two web sites running on the ipfs.io gateway:
With same-origin policy these two applications would be granted the same permissions. With scoped permissions, these applications will be given a different set of permissions.
e.g.
files.add
tohttps://domain.com/
files.add
to:https://domain.com/file
https://domain.com/file2.html
https://domain.com/sub/paths
https://domain.com/sub/paths/files
files.add
tohttps://domain.com/feature
files.add
to:https://domain.com/feature/file
https://domain.com/feature/file2.html
https://domain.com/feature/sub/paths
https://domain.com/feature/sub/paths/files
https://domain.com/featuresearch/sub/paths/files
(note substring)https://domain.com/features.html
(note substring)files.add
to:https://domain.com/
https://domain.com/files