summaryrefslogtreecommitdiff
path: root/src/authorization/check_service.rs
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/check_service.rs
parente97b15bcb9581b895d8431f3f3eaf7a9dd1bcac6 (diff)
chore: add generated rpc code
Diffstat (limited to 'src/authorization/check_service.rs')
-rw-r--r--src/authorization/check_service.rs20
1 files changed, 16 insertions, 4 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,
+ }))
}
}
}