-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add lock
to PerspectiveManager
#999
Conversation
I understand the concept but if we want to prevent js client modifications, this should be a construction time attribute that cannot be undone (e.g. no unlock). As is this current PR feels like "authentication-light" which is not something we want to be doing. |
Agreed - wondering if we should just default the manager to locked as well |
I think so. The followup question is do you want to implement a token-granting system for perspective? This would be just on the client-server api, basically the ability to:
Then web servers could either provide a token scheme, or otherwise put the token granting behind an authenticated api (using their own authentication). This keeps us out of the authentication business while still allowing perspective to work nicely in authenticated contexts. |
Yeah this is definitely working up to a token-based authentication scheme for the remote API. Adding a lock is mostly for being able to host python-based perspective remote examples on the internet without having to worry about getting the example table cleared/deleted remotely. |
under management. | ||
|
||
All `PerspectiveManager`s exposed over the internet should be locked to | ||
prevent content from being mutated by clients. |
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.
This language simplifies things a bit :)
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.
Thanks for the PR! Changes look good!
Perspective is not currently scoped for granular, secure, full duplex communications to a virtual host. The intention of this feature is to simply allow read-only mode for documented APIs that are vandalism-prone for use in kiosk/demo mode, after whatever necessary mutable setup is done.
This PR adds the
lock
attribute toPerspectiveManager
, which will reject the following remote messages that can mutate the state ofTable
s andView
s under management:table
table.update
table.clear
table.replace
table.reset
table.delete
PerspectiveManager
s exposed over the internet should be locked, either by calling.lock()
or initializing withlock=True
. This PR also includes tests and a compact example demonstrating message rejection when the manager is locked.