actix-web-middleware-opa
Open Policy Agent (openpolicyagent/OPA) middleware for actix-web applications.
This middleware performs a policy check against an Open Policy Agent instance for incoming HTTP requests.
Both the policy check request and response are generic.
Flow
Example
Take the following request :
curl -XGET -H 'Authorization: Bearer 123123123' http://localhost:8080/order/item/1
This will need to be translated to a JSON call to OPA :
We represent this as two Rust structs which implement Serialize
,
The expected response is a JSON object :
We represent this as two Rust structs which implement Deserialize
,
Lastly we have to implement the OPARequest<S>
trait so that
type VerifierMiddleware = ;