aboutsummaryrefslogtreecommitdiff
path: root/src/call/server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/call/server.rs')
-rw-r--r--src/call/server.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/call/server.rs b/src/call/server.rs
index 35149e0..ce3ca76 100644
--- a/src/call/server.rs
+++ b/src/call/server.rs
@@ -16,7 +16,6 @@ use futures_util::{Sink, Stream};
use parking_lot::Mutex;
use super::{RpcStatus, ShareCall, ShareCallHolder, WriteFlags};
-use crate::auth_context::AuthContext;
use crate::buf::GrpcSlice;
use crate::call::{
BatchContext, Call, MessageReader, MethodType, RpcStatusCode, SinkBase, StreamingBase,
@@ -193,10 +192,11 @@ impl RequestContext {
}
/// If the server binds in non-secure mode, this will return None
- fn auth_context(&self) -> Option<AuthContext> {
+ #[cfg(feature = "_secure")]
+ fn auth_context(&self) -> Option<crate::AuthContext> {
unsafe {
let call = grpc_sys::grpcwrap_request_call_context_get_call(self.ctx);
- AuthContext::from_call_ptr(call)
+ crate::AuthContext::from_call_ptr(call)
}
}
}
@@ -690,7 +690,8 @@ impl<'a> RpcContext<'a> {
/// Wrapper around the gRPC Core AuthContext
///
/// If the server binds in non-secure mode, this will return None
- pub fn auth_context(&self) -> Option<AuthContext> {
+ #[cfg(feature = "_secure")]
+ pub fn auth_context(&self) -> Option<crate::AuthContext> {
self.ctx.auth_context()
}