Git Product home page Git Product logo

Comments (5)

gavin-norman-sociomantic avatar gavin-norman-sociomantic commented on August 12, 2024

Another aspect which was discussed: it'd be nice to also have permissions based on an ip white/black list. For example, instances of apps running on a test server should not be allowed to read from but not write to live nodes. They will likely user the same auth key as the real apps, but can be distinguished by their ip.

from swarm.

gavin-norman-sociomantic avatar gavin-norman-sociomantic commented on August 12, 2024

A simple initial idea for client-based permissions:

  1. We add support for a set of action categories to be defined by the node. (e.g. "read", "write", "delete".) (These will need to vary by node, as some node types have different concepts of destructive requests, for example.)
  2. Each request is assigned to one of these categories. (See https://github.com/sociomantic-tsunami/swarm/blob/v4.x.x/src/swarm/neo/node/ConnectionHandler.d#L65.)
  3. The node's credentials file (or some config file) is extended to also allow specifying whether each client is allowed/disallowed to perform each action. (It may make sense to have the default permission always be "disallow", unless configured otherwise.)
  4. When a client sends a request to a node, the node can look up the action category of the request and the permissions of the client, then decide whether to continue handling the request or return some error code.

from swarm.

gavin-norman-sociomantic avatar gavin-norman-sociomantic commented on August 12, 2024

Another aspect which was discussed: it'd be nice to also have permissions based on an ip white/black list. For example, instances of apps running on a test server should not be allowed to read from but not write to live nodes. They will likely user the same auth key as the real apps, but can be distinguished by their ip.

I think this is a separate idea. I don't think the implementation would share much in common with the per-client / per-request permissions. Split to #166.

from swarm.

gavin-norman-sociomantic avatar gavin-norman-sociomantic commented on August 12, 2024

It may make sense to have the default permission always be "disallow", unless configured otherwise.

This would be a major breaking change, though :D

from swarm.

gavin-norman-sociomantic avatar gavin-norman-sociomantic commented on August 12, 2024

After some discussion, we decided to go for a super simple scheme, as follows:

  • #169 enables request handlers in the node to get the name of the connected client.
  • For very sensitive requests (e.g. RemoveChannel, Redistribute), we add a simple check that the client's name is "admin" and send an error status code, if not.

This approach addresses all of our current needs. We can extend it to a more complicated system, if we ever need one.

Nothing more to do here.

from swarm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.