summaryrefslogtreecommitdiff
path: root/src/authorization
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-16 13:44:59 -0600
committermo khan <mo@mokhan.ca>2025-07-16 13:44:59 -0600
commitaadfbeb39d0ac5ccb1a19899d7680b1c96b1a6cf (patch)
tree293cb102463ab1aeeac6aa899cedbbbf03ed6187 /src/authorization
parente97b15bcb9581b895d8431f3f3eaf7a9dd1bcac6 (diff)
chore: add generated rpc code
Diffstat (limited to 'src/authorization')
-rw-r--r--src/authorization/check_service.rs20
-rw-r--r--src/authorization/spice/authorizer.rs2
2 files changed, 17 insertions, 5 deletions
diff --git a/src/authorization/check_service.rs b/src/authorization/check_service.rs
index 0a2cf771..83e6705a 100644
--- a/src/authorization/check_service.rs
+++ b/src/authorization/check_service.rs
@@ -22,11 +22,23 @@ impl crate::rpc::envoy::service::auth::v3::authorization_server::Authorization f
request: Request<CheckRequest>,
) -> Result<Response<CheckResponse>, Status> {
if self.authorizer.authorize(request.into_inner()) {
- Ok(Response::new(CheckResponse::with_status(Status::ok("OK"))))
+ Ok(Response::new(CheckResponse {
+ status: Some(crate::rpc::google::rpc::Status {
+ code: 0,
+ message: "OK".to_string(),
+ details: vec![],
+ }),
+ dynamic_metadata: None,
+ }))
} else {
- Ok(Response::new(CheckResponse::with_status(
- Status::unauthenticated("Unauthorized"),
- )))
+ Ok(Response::new(CheckResponse {
+ status: Some(crate::rpc::google::rpc::Status {
+ code: 7,
+ message: "Unauthorized".to_string(),
+ details: vec![],
+ }),
+ dynamic_metadata: None,
+ }))
}
}
}
diff --git a/src/authorization/spice/authorizer.rs b/src/authorization/spice/authorizer.rs
index d906752f..57c604bc 100644
--- a/src/authorization/spice/authorizer.rs
+++ b/src/authorization/spice/authorizer.rs
@@ -8,7 +8,7 @@ impl Authorizer {
}
impl crate::authorization::authorizer::Authorizer for Authorizer {
- fn authorize(&self, _request: envoy_types::ext_authz::v3::pb::CheckRequest) -> bool {
+ fn authorize(&self, _request: crate::rpc::envoy::service::auth::v3::CheckRequest) -> bool {
false
}
}