pub struct PluginServiceClient<T> { /* private fields */ }Implementations§
Source§impl<T> PluginServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> PluginServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> PluginServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn get_query_schemas(
&mut self,
request: impl IntoRequest<GetQuerySchemasRequest>,
) -> Result<Response<Streaming<GetQuerySchemasResponse>>, Status>
pub async fn get_query_schemas( &mut self, request: impl IntoRequest<GetQuerySchemasRequest>, ) -> Result<Response<Streaming<GetQuerySchemasResponse>>, Status>
Get schemas for all supported queries by the plugin.
This is used by Hipcheck to validate that:
- The plugin supports a default query taking a
targettype if used as a top-level plugin in the user’s policy file. - That requests sent to the plugin and data returned by the plugin match the schema during execution.
Sourcepub async fn set_configuration(
&mut self,
request: impl IntoRequest<SetConfigurationRequest>,
) -> Result<Response<SetConfigurationResponse>, Status>
pub async fn set_configuration( &mut self, request: impl IntoRequest<SetConfigurationRequest>, ) -> Result<Response<SetConfigurationResponse>, Status>
Hipcheck sends all child nodes for the plugin from the user’s policy file to configure the plugin.
Sourcepub async fn get_default_policy_expression(
&mut self,
request: impl IntoRequest<GetDefaultPolicyExpressionRequest>,
) -> Result<Response<GetDefaultPolicyExpressionResponse>, Status>
pub async fn get_default_policy_expression( &mut self, request: impl IntoRequest<GetDefaultPolicyExpressionRequest>, ) -> Result<Response<GetDefaultPolicyExpressionResponse>, Status>
Get the default policy for a plugin, which may additionally depend on the plugin’s configuration.
Sourcepub async fn explain_default_query(
&mut self,
request: impl IntoRequest<ExplainDefaultQueryRequest>,
) -> Result<Response<ExplainDefaultQueryResponse>, Status>
pub async fn explain_default_query( &mut self, request: impl IntoRequest<ExplainDefaultQueryRequest>, ) -> Result<Response<ExplainDefaultQueryResponse>, Status>
Get an explanation of what the default query returns, to use when reporting analysis results to users.
Note that, because users can specify their own policy expression, this explanation should not assume the user has used the default policy expression, if one is provided by the plugin.
Sourcepub async fn initiate_query_protocol(
&mut self,
request: impl IntoStreamingRequest<Message = InitiateQueryProtocolRequest>,
) -> Result<Response<Streaming<InitiateQueryProtocolResponse>>, Status>
pub async fn initiate_query_protocol( &mut self, request: impl IntoStreamingRequest<Message = InitiateQueryProtocolRequest>, ) -> Result<Response<Streaming<InitiateQueryProtocolResponse>>, Status>
Open a bidirectional streaming RPC to enable a request/response protocol between Hipcheck and a plugin, where Hipcheck can issue queries to the plugin, and the plugin may issue queries to other plugins through Hipcheck.
Queries are cached by the publisher name, plugin name, query name, and key, and if a match is found for those four values, then Hipcheck will respond with the cached result of that prior matching query rather than running the query again.
Trait Implementations§
Source§impl<T: Clone> Clone for PluginServiceClient<T>
impl<T: Clone> Clone for PluginServiceClient<T>
Source§fn clone(&self) -> PluginServiceClient<T>
fn clone(&self) -> PluginServiceClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for PluginServiceClient<T>
impl<T> RefUnwindSafe for PluginServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for PluginServiceClient<T>where
T: Send,
impl<T> Sync for PluginServiceClient<T>where
T: Sync,
impl<T> Unpin for PluginServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for PluginServiceClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request