pub struct DelegatedIdentityClient { /* private fields */ }
Expand description
Impl for DelegatedIdentity API
Implementations§
Source§impl DelegatedIdentityClient
Constructors
impl DelegatedIdentityClient
Constructors
Sourcepub async fn new_from_path(path: &str) -> Result<Self, GrpcClientError>
pub async fn new_from_path(path: &str) -> Result<Self, GrpcClientError>
Creates a new instance of DelegatedIdentityClient
by connecting to the specified socket path.
§Arguments
path
- The path to the UNIX domain socket, which can optionally start with “unix:”.
§Returns
Result<Self, ClientError>
- Returns an instance ofDelegatedIdentityClient
if successful, otherwise returns an error.
§Errors
This function will return an error if the provided socket path is invalid or if there are issues connecting.
Sourcepub async fn default() -> Result<Self, GrpcClientError>
pub async fn default() -> Result<Self, GrpcClientError>
Creates a new DelegatedIdentityClient
using the default socket endpoint address.
Requires that the environment variable SPIFFE_ENDPOINT_SOCKET
be set with
the path to the Workload API endpoint socket.
§Errors
The function returns a variant of GrpcClientError
if environment variable is not set or if
the provided socket path is not valid.
Sourcepub fn new(conn: Channel) -> Result<Self, GrpcClientError>
pub fn new(conn: Channel) -> Result<Self, GrpcClientError>
Source§impl DelegatedIdentityClient
impl DelegatedIdentityClient
Sourcepub async fn fetch_x509_svid(
&mut self,
attest_type: DelegateAttestationRequest,
) -> Result<X509Svid, GrpcClientError>
pub async fn fetch_x509_svid( &mut self, attest_type: DelegateAttestationRequest, ) -> Result<X509Svid, GrpcClientError>
Fetches a single X509 SPIFFE Verifiable Identity Document (SVID).
This method connects to the SPIFFE Workload API and returns the first X509 SVID in the response.
§Arguments
selectors
- A list of selectors to filter the stream ofX509Svid
updates.
§Returns
On success, it returns a valid X509Svid
which represents the parsed SVID.
If the fetch operation or the parsing fails, it returns a GrpcClientError
.
§Errors
Returns GrpcClientError
if the gRPC call fails or if the SVID could not be parsed from the gRPC response.
Sourcepub async fn stream_x509_svids(
&mut self,
attest_type: DelegateAttestationRequest,
) -> Result<impl Stream<Item = Result<X509Svid, GrpcClientError>>, GrpcClientError>
pub async fn stream_x509_svids( &mut self, attest_type: DelegateAttestationRequest, ) -> Result<impl Stream<Item = Result<X509Svid, GrpcClientError>>, GrpcClientError>
Watches the stream of X509Svid
updates.
This function establishes a stream with the Workload API to continuously receive updates for the X509Svid
.
The returned stream can be used to asynchronously yield new X509Svid
updates as they become available.
§Arguments
selectors
- A list of selectors to filter the stream ofX509Svid
updates.
§Returns
Returns a stream of Result<X509Svid, ClientError>
. Each item represents an updated X509Svid
or an error if
there was a problem processing an update from the stream.
§Errors
The function can return an error variant of GrpcClientError
in the following scenarios:
- There’s an issue connecting to the Workload API.
- An error occurs while setting up the stream.
Individual stream items might also be errors if there’s an issue processing the response for a specific update.
Sourcepub async fn fetch_x509_bundles(
&mut self,
) -> Result<X509BundleSet, GrpcClientError>
pub async fn fetch_x509_bundles( &mut self, ) -> Result<X509BundleSet, GrpcClientError>
Fetches X509BundleSet
, that is a set of X509Bundle
keyed by the trust domain to which they belong.
§Errors
The function returns a variant of GrpcClientError
if there is en error connecting to the Workload API or
there is a problem processing the response.
Sourcepub async fn stream_x509_bundles(
&mut self,
) -> Result<impl Stream<Item = Result<X509BundleSet, GrpcClientError>>, GrpcClientError>
pub async fn stream_x509_bundles( &mut self, ) -> Result<impl Stream<Item = Result<X509BundleSet, GrpcClientError>>, GrpcClientError>
Watches the stream of X509Bundle
updates.
This function establishes a stream with the Workload API to continuously receive updates for the X509Bundle
.
The returned stream can be used to asynchronously yield new X509Bundle
updates as they become available.
§Returns
Returns a stream of Result<X509Bundle, ClientError>
. Each item represents an updated X509Bundle
or an error if
there was a problem processing an update from the stream.
§Errors
The function can return an error variant of GrpcClientError
in the following scenarios:
- There’s an issue connecting to the Admin API.
- An error occurs while setting up the stream.
Individual stream items might also be errors if there’s an issue processing the response for a specific update.
Sourcepub async fn fetch_jwt_svids<T: AsRef<str> + ToString>(
&mut self,
audience: &[T],
attest_type: DelegateAttestationRequest,
) -> Result<Vec<JwtSvid>, GrpcClientError>
pub async fn fetch_jwt_svids<T: AsRef<str> + ToString>( &mut self, audience: &[T], attest_type: DelegateAttestationRequest, ) -> Result<Vec<JwtSvid>, GrpcClientError>
Fetches a list of JwtSvid
parsing the JWT token in the Workload API response, for the given audience and selectors.
§Arguments
audience
- A list of audiences to include in the JWT token. Cannot be empty nor contain only empty strings.selectors
- A list of selectors to filter the list ofJwtSvid
.
§Errors
The function returns a variant of GrpcClientError
if there is en error connecting to the Workload API or
there is a problem processing the response.
Sourcepub async fn stream_jwt_bundles(
&mut self,
) -> Result<impl Stream<Item = Result<JwtBundleSet, GrpcClientError>>, GrpcClientError>
pub async fn stream_jwt_bundles( &mut self, ) -> Result<impl Stream<Item = Result<JwtBundleSet, GrpcClientError>>, GrpcClientError>
Watches the stream of JwtBundleSet
updates.
This function establishes a stream with the Workload API to continuously receive updates for the JwtBundleSet
.
The returned stream can be used to asynchronously yield new JwtBundleSet
updates as they become available.
§Returns
Returns a stream of Result<JwtBundleSet, ClientError>
. Each item represents an updated JwtBundleSet
or an error if
there was a problem processing an update from the stream.
§Errors
The function can return an error variant of GrpcClientError
in the following scenarios:
- There’s an issue connecting to the Workload API.
- An error occurs while setting up the stream.
Individual stream items might also be errors if there’s an issue processing the response for a specific update.
Sourcepub async fn fetch_jwt_bundles(
&mut self,
) -> Result<JwtBundleSet, GrpcClientError>
pub async fn fetch_jwt_bundles( &mut self, ) -> Result<JwtBundleSet, GrpcClientError>
Fetches JwtBundleSet
that is a set of JwtBundle
keyed by the trust domain to which they belong.
§Errors
The function returns a variant of GrpcClientError
if there is en error connecting to the Workload API or
there is a problem processing the response.
Trait Implementations§
Source§impl Clone for DelegatedIdentityClient
impl Clone for DelegatedIdentityClient
Source§fn clone(&self) -> DelegatedIdentityClient
fn clone(&self) -> DelegatedIdentityClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !Freeze for DelegatedIdentityClient
impl !RefUnwindSafe for DelegatedIdentityClient
impl Send for DelegatedIdentityClient
impl Sync for DelegatedIdentityClient
impl Unpin for DelegatedIdentityClient
impl !UnwindSafe for DelegatedIdentityClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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