accesscontrol icon indicating copy to clipboard operation
accesscontrol copied to clipboard

Redis Support?

Open joshrathke opened this issue 7 years ago • 7 comments

I’m looking to implement authorization in a clustered Node app. Has there been an attempt to make this package have Redis support? Or is there an alternative method of sharing memory between Node instances?

joshrathke avatar Jul 08 '18 17:07 joshrathke

@onury Any Comments on this one?

aggarwaldev avatar Jan 08 '19 15:01 aggarwaldev

Yes, we should add this feature. Though, there are higher priority features we need to implement first.

onury avatar Jan 08 '19 16:01 onury

@onury I think you should use "Feature Request" label instead of "Help Wanted". Also, I think it's really important feature for clustered node applications.

In the meantime, do you think a workaround would be possible to update roles when changes are made in database?

aggarwaldev avatar Jan 08 '19 17:01 aggarwaldev

"help wanted" stands for: contributors / collaborators are needed to implement this; and PRs are welcome. It does not indicate "this user is asking for help".

This is a good but extra feature. Unfortunately, AC itself cannot provide a "workaround" for this; other than implementing redis integration.

What you can do for a workaround is; either have your app instances periodically check (poll) for updates; or horizontally update or notify instances of your service/application; at the time when any policy is changed. Depends on the architecture of your application. e.g. if using sockets with a central server, you could even do subscriptions.

onury avatar Jan 08 '19 21:01 onury

I've been researching how to put it all together in this repo (here is authorization helper with Redis [cache] functionality I'm using if it helps):

  • https://github.com/mikesparr/typescript-postgres-auth-example/blob/master/src/utils/authorization.helper.ts

mikesparr avatar Jan 25 '19 15:01 mikesparr

I'll check it soon. Thanks.

onury avatar Jan 25 '19 20:01 onury

Thank YOU for putting together a great library. I just wrapped up integration tests and 51 tests green. Enjoy the repo: https://github.com/mikesparr/typescript-postgres-auth-example

mikesparr avatar Jan 25 '19 23:01 mikesparr