diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/authorization/cedar_authorizer.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/authorization/cedar_authorizer.rs b/src/authorization/cedar_authorizer.rs index 17867aba..4eeaf645 100644 --- a/src/authorization/cedar_authorizer.rs +++ b/src/authorization/cedar_authorizer.rs @@ -85,7 +85,7 @@ impl Authorizer for CedarAuthorizer { return true; } - match self.create_cedar_request(http_request.clone()) { + match self.map_from(http_request.clone()) { Ok(cedar_request) => { let entities = Entities::empty(); let response = @@ -107,7 +107,7 @@ impl Authorizer for CedarAuthorizer { } impl CedarAuthorizer { - fn create_cedar_request( + fn map_from( &self, http_request: envoy_types::pb::envoy::service::auth::v3::attribute_context::HttpRequest, ) -> Result<CedarRequest, Box<dyn std::error::Error>> { @@ -136,13 +136,13 @@ impl CedarAuthorizer { if !bearer_token.is_empty() { context_map.insert( "bearer_token".to_string(), - cedar_policy::RestrictedExpression::from_str(bearer_token)?, + cedar_policy::RestrictedExpression::new_string(bearer_token.to_string()), ); } if !http_request.path.is_empty() { context_map.insert( "path".to_string(), - cedar_policy::RestrictedExpression::from_str(&http_request.path.to_string())?, + cedar_policy::RestrictedExpression::new_string(http_request.path.clone()), ); } |
