#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct X509svidRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct X509svidResponse {
#[prost(message, repeated, tag = "1")]
pub svids: ::prost::alloc::vec::Vec<X509svid>,
#[prost(bytes = "bytes", repeated, tag = "2")]
pub crl: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
#[prost(map = "string, bytes", tag = "3")]
pub federated_bundles:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct X509svid {
#[prost(string, tag = "1")]
pub spiffe_id: ::prost::alloc::string::String,
#[prost(bytes = "bytes", tag = "2")]
pub x509_svid: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "3")]
pub x509_svid_key: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "4")]
pub bundle: ::prost::bytes::Bytes,
#[prost(string, tag = "5")]
pub hint: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct X509BundlesRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct X509BundlesResponse {
#[prost(bytes = "bytes", repeated, tag = "1")]
pub crl: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
#[prost(map = "string, bytes", tag = "2")]
pub bundles: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JwtsvidRequest {
#[prost(string, repeated, tag = "1")]
pub audience: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "2")]
pub spiffe_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JwtsvidResponse {
#[prost(message, repeated, tag = "1")]
pub svids: ::prost::alloc::vec::Vec<Jwtsvid>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Jwtsvid {
#[prost(string, tag = "1")]
pub spiffe_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub svid: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub hint: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JwtBundlesRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JwtBundlesResponse {
#[prost(map = "string, bytes", tag = "1")]
pub bundles: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::bytes::Bytes>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ValidateJwtsvidRequest {
#[prost(string, tag = "1")]
pub audience: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub svid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidateJwtsvidResponse {
#[prost(string, tag = "1")]
pub spiffe_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub claims: ::core::option::Option<::prost_types::Struct>,
}
pub mod spiffe_workload_api_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct SpiffeWorkloadApiClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SpiffeWorkloadApiClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SpiffeWorkloadApiClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SpiffeWorkloadApiClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
Into<StdError> + std::marker::Send + std::marker::Sync,
{
SpiffeWorkloadApiClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn fetch_x509svid(
&mut self,
request: impl tonic::IntoRequest<super::X509svidRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::X509svidResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/SpiffeWorkloadAPI/FetchX509SVID");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("SpiffeWorkloadAPI", "FetchX509SVID"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn fetch_x509_bundles(
&mut self,
request: impl tonic::IntoRequest<super::X509BundlesRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::X509BundlesResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/SpiffeWorkloadAPI/FetchX509Bundles");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("SpiffeWorkloadAPI", "FetchX509Bundles"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn fetch_jwtsvid(
&mut self,
request: impl tonic::IntoRequest<super::JwtsvidRequest>,
) -> std::result::Result<tonic::Response<super::JwtsvidResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/SpiffeWorkloadAPI/FetchJWTSVID");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("SpiffeWorkloadAPI", "FetchJWTSVID"));
self.inner.unary(req, path, codec).await
}
pub async fn fetch_jwt_bundles(
&mut self,
request: impl tonic::IntoRequest<super::JwtBundlesRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::JwtBundlesResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/SpiffeWorkloadAPI/FetchJWTBundles");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("SpiffeWorkloadAPI", "FetchJWTBundles"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn validate_jwtsvid(
&mut self,
request: impl tonic::IntoRequest<super::ValidateJwtsvidRequest>,
) -> std::result::Result<tonic::Response<super::ValidateJwtsvidResponse>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/SpiffeWorkloadAPI/ValidateJWTSVID");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("SpiffeWorkloadAPI", "ValidateJWTSVID"));
self.inner.unary(req, path, codec).await
}
}
}