-
-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Labels
authfeaturenew product features that weren't there beforenew product features that weren't there beforepriority:low0.5x0.5x
Description
Describe the problem you're trying to solve
Sometimes you may want to grant a toolbar extension a read-only version of your data (allow graphql queries but not mutations) That way you dont need to worry about them calling a mutation to zap or anything because the chrome extensions are allowed to break CORS and have access to cookies
Describe the solution you'd like
Add a query-string parameter readOnly
to /api/graphql
that defaults false
. It can be picked up by middleware and return a http 403
with an error message of operation not allowed
if a mutation operation is detected when readOnly=true
Describe alternatives you've considered
- We could make an entirely new endpoint like
/api/graphql-ro
but I didn't like the idea of having a whole new route just for the readonly version. - Im not sure how I could do it in the host permission of the extension because it doesn't allow me to restrict the arguments sent
- Do nothing - I wasn't a fan because I would like people to be able to trust the tool isn't going to be able to steal sats after some update without some alert of permissions changes
Additional context
- Stacker thread for original conversation: https://stacker.news/items/1037861/r/carter?commentId=1038405
- Documentation on host permission: https://developer.chrome.com/docs/extensions/develop/concepts/declare-permissions#host-permissions
Soxasora
Metadata
Metadata
Assignees
Labels
authfeaturenew product features that weren't there beforenew product features that weren't there beforepriority:low0.5x0.5x