casbin-rs / actix-casbin-auth

Casbin Actix-web access control middleware
https://github.com/casbin/casbin-rs
55 stars 15 forks source link

Actix with diesel and self Auth middlewaze #3

Closed vietlib closed 4 years ago

vietlib commented 4 years ago

Can you create an example for Casbin Middlewaze with Model and Policy get from Postgres (Diesel) and self Auth please ?

hsluoyz commented 4 years ago

@GopherJ @xcaptain @hackerchai

hackerchai commented 4 years ago

Can you create an example for Casbin Middlewaze with Model and Policy get from Postgres (Diesel) and self Auth please ?

I am working on it. I will ping you when it is finished.

hackerchai commented 4 years ago

Can you create an example for Casbin Middlewaze with Model and Policy get from Postgres (Diesel) and self Auth please ?

We recommend using sqlx-adapter rather than diesel-adapter, because the sqlx-adapter is fully async. The demo will use sqlx-adapter and diesel(for app data) with PostgreSQL. We will also implement a JWT authentication middleware working with actix-casbin-auth.

GopherJ commented 4 years ago

@vietlib Sure, @hackerchai When you finish the example we can put in actix-web's casbin example and also casbin-rs's example directory

hackerchai commented 4 years ago

@vietlib Sure, @hackerchai When you finish the example we can put in actix-web's casbin example and also casbin-rs's example directory

Get it

vietlib commented 4 years ago

Can you create an example for Casbin Middlewaze with Model and Policy get from Postgres (Diesel) and self Auth please ?

We recommend using sqlx-adapter rather than diesel-adapter, because the sqlx-adapter is fully async. The demo will use sqlx-adapter and diesel(for app data) with PostgreSQL. We will also implement a JWT authentication middleware working with actix-casbin-auth.

It's great if you can create full example on an app with postgres authentication and casbin-postgres Model. Example like: user group must login to post an article and admin can publish it . It so great ! Thank you so much !

vietlib commented 4 years ago

Any update on thiss please

hsluoyz commented 4 years ago

@GopherJ @hackerchai

hackerchai commented 4 years ago

Any update on thiss please

@vietlib See https://github.com/casbin-rs/examples/tree/master/actix-middleware-example

Thanks for your waiting

hsluoyz commented 4 years ago

Any one working on it? @GopherJ @hackerchai @PsiACE

hackerchai commented 4 years ago

Any one working on it? @GopherJ @hackerchai @PsiACE

@hsluoyz Already done. I will close this issue.

hsluoyz commented 4 years ago

Great, thanks!

makorne commented 3 years ago

We recommend using sqlx-adapter rather than diesel-adapter, because the sqlx-adapter is fully async. The demo will use sqlx-adapter and diesel(for app data) with PostgreSQL. We will also implement a JWT authentication middleware working with actix-casbin-auth.

Looks like the sqlx-adapter is forgotten. Only diesel-adapter = { version = "0.8.1", default-features = false, features = ["postgres","runtime-async-std"] }

hsluoyz commented 3 years ago

@hackerchai @smrpn