casbin-rs / actix-casbin-auth

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

considering add a customized configuration in CasbinService to config error mesage? #32

Open Kilerd opened 3 years ago

Kilerd commented 3 years ago

for now the middleware use original error page built in actix-web,like

Ok(req.into_response(HttpResponse::Forbidden().finish().into_body()));
Ok(req.into_response(HttpResponse::BadGateway().finish().into_body()));
Ok(req.into_response(HttpResponse::Unauthorized().finish().into_body()));

but for some cases, we wanna keep the error message having the same structured response like other error type. so maybe add some fields in CasbinService to config the response of error payload?

hsluoyz commented 3 years ago

Hi @Kilerd , can you make a PR to fix it?

hackerchai commented 3 years ago

@Kilerd good suggstion. We will implement it in next version release

hsluoyz commented 3 years ago

@smrpn

Kilerd commented 3 years ago

so any idea how to implement it?

seems there are a lot scenarios to emit error? can someone just classify them into groups?

hsluoyz commented 2 years ago

@SiddheshKanawade plz work on this

/cc @hackerchai

SiddheshKanawade commented 2 years ago

Ok