summaryrefslogtreecommitdiff
path: root/src/authorization/check_service.rs
diff options
context:
space:
mode:
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,
+ }))
}
}
}