-
Notifications
You must be signed in to change notification settings - Fork 5
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 auto-loading of new policies #9
Comments
@mattbishop you can use watchers: https://casbin.org/docs/en/watchers |
@mattbishop, I think the safest way to work on a multi-node configuration is the one @hsluoyz mention. |
Thanks, I read about watchers but am hoping to avoid standing up another process for this purpose. I only have node servers next Postgres would be simpler for this task in my situation.
—
Matt Bishop
… On Sep 14, 2021, at 3:15 AM, Maxime LUCE ***@***.***> wrote:
@mattbishop, I think the safest way to work on a multi-node configuration is the one @hsluoyz mention.
Watchers were built exactly for this purpose.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Then you have to implement the feature in this repo. ping @nodece @Zxilly @Gabriel-403 |
I agree to have a
However, if you want to implement this in this repo, you should stick using node-postgres. Maybe the simplest way would be to create another repo and package using pg-listen. |
I like this approach! I won't be able to get to it until October
or November so please keep recording your thoughts in this ticket.
…On Wed, Sep 15, 2021 at 2:09 PM Maxime LUCE ***@***.***> wrote:
I agree to have a Watcher implementation in this repo:
1. Create a watcher.ts file in lib
2. Implement the Watcher interface from casbin
3. Export the PostgresWatcher in index.ts
However, if you want to implement this in this repo, you should stick
using node-postgres <https://node-postgres.com/>.
Maybe the simplest way would be to create another repo and package using
pg-listen <https://www.npmjs.com/package/pg-listen>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACY3BO63JKIBLWSWNWG5DTUCEDPXANCNFSM5D7H3LVA>
.
|
When Casbin is used in a multi-node configuration, one node may change the Casbin configuration, yet the others are unaware of this change. It would be possible for all nodes to use Postgres' LISTEN/NOTIFY feature to listen for changes on the tables and reload their policies as they change.
See https://www.postgresql.org/docs/current/sql-listen.html
The text was updated successfully, but these errors were encountered: