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

Docs — RPC protocol #736

Open
nichoth opened this issue Oct 19, 2020 · 3 comments
Open

Docs — RPC protocol #736

nichoth opened this issue Oct 19, 2020 · 3 comments

Comments

@nichoth
Copy link

nichoth commented Oct 19, 2020

Hey. I had a question that I couldn't find here or in the protocol guide. It says that peers replicate by calling createHistoryStream via RPC, but I was curious about where the permissions for RPC are created. For example, you wouldn't be able to call .publish on a remote server, to publish a message under the remote id.

@clehner
Copy link
Contributor

clehner commented Oct 19, 2020

Hi @nichoth,

Plugins specify permissions:
https://github.com/ssb-js/secret-stack/blob/main/PLUGINS.md#pluginpermissions-object-optional

To make a method public, it should be included in the anonymous array in the permissions object.
e.g. the example in the above linked file makes a localPeers method public:

  permissions: {
    anonymous: [ 'localPeers' ]                                         
  },

createHistoryStream has it specified here:
https://github.com/ssbc/ssb-db/blob/master/index.js#L50

anonymous is the permission group that all remote callers are in by default. The local user and ssb-master-authenticated callers can call any method by default.

@nichoth
Copy link
Author

nichoth commented Oct 19, 2020

thanks @clehner !

@stale
Copy link

stale bot commented Jun 2, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the stale label Jun 2, 2021
@staltz staltz removed the stale label Jun 2, 2021
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

3 participants