casbin-rs / casbin-raft

casbin with raft consensus protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feature request] cluster config

GopherJ opened this issue · comments

currently it's not clear how one node discover the others after initialisation a raft node.

We need a cluster config to be shared across nodes.

Something like: https://github.com/oronsh/raftor/blob/master/Config.toml

Every node needs to claim it's ip during the initialisation so we can check in code if it's discover_node or not.

If not, then this node should send join request to the discover node

First of all, I have to admit that it is currently a library, not a server + client. Therefore, I plan to replace the operations on Enforcer with abstract traits, and in the end it may look like toshi-raft. Maybe later today, you can see this change in the branch named pure-lib.

So there will be no cluster config for the time being, that is what casbin-server needs to consider, maybe it will be further implemented in the next stage.

@PsiACE It can be put into casbin-server, it depends on how you design things, at the beginning I consider casbin-raft as casbin-server which provides everything out of box, but you can also make them into two libs, the importance is to be able to use it without any pain

Currently refer to toshi, especially toshi-types, to separate Casbin-Raft and Casbin-OPs. The code is in the pure-lib branch and still needs improvement.