summaryrefslogtreecommitdiff
path: root/src/authorization
diff options
context:
space:
mode:
Diffstat (limited to 'src/authorization')
-rw-r--r--src/authorization/cedar_authorizer.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/authorization/cedar_authorizer.rs b/src/authorization/cedar_authorizer.rs
index 0f53dacb..662aafeb 100644
--- a/src/authorization/cedar_authorizer.rs
+++ b/src/authorization/cedar_authorizer.rs
@@ -89,21 +89,21 @@ impl CedarAuthorizer {
fn permission_from(
&self,
- _http_request: &envoy_types::pb::envoy::service::auth::v3::attribute_context::HttpRequest,
+ http_request: &envoy_types::pb::envoy::service::auth::v3::attribute_context::HttpRequest,
) -> Result<cedar_policy::EntityUid, Box<dyn std::error::Error>> {
Ok(cedar_policy::EntityUid::from_type_name_and_id(
cedar_policy::EntityTypeName::from_str("Action")?,
- cedar_policy::EntityId::from_str("check")?,
+ cedar_policy::EntityId::from_str(&http_request.method)?,
))
}
fn resource_from(
&self,
- _http_request: &envoy_types::pb::envoy::service::auth::v3::attribute_context::HttpRequest,
+ http_request: &envoy_types::pb::envoy::service::auth::v3::attribute_context::HttpRequest,
) -> Result<cedar_policy::EntityUid, Box<dyn std::error::Error>> {
Ok(cedar_policy::EntityUid::from_type_name_and_id(
cedar_policy::EntityTypeName::from_str("Resource")?,
- cedar_policy::EntityId::from_str("resource")?,
+ cedar_policy::EntityId::from_str(&http_request.path)?,
))
}