[][src]Struct grpcio::AuthContext

pub struct AuthContext { /* fields omitted */ }

To perform server-side authentication, gRPC exposes the authentication context for each call. The context exposes important authentication-related information about the RPC such as the type of security/authentication type being used and the peer identity.

The authentication context is structured as a multi-map of key-value pairs - the auth properties. In addition to that, for authenticated RPCs, the set of properties corresponding to a selected key will represent the verified identity of the caller - the peer identity.

The contents of the auth properties are populated by an auth interceptor within gRPC Core. The interceptor also chooses which property key will act as the peer identity (e.g. for client certificate authentication this property will be x509_common_name or x509_subject_alternative_name).

Implementations

impl AuthContext[src]

Binding to gRPC Core AuthContext

pub fn peer_identity_property_name(&self) -> Option<&str>[src]

The name of the property gRPC Core has chosen as main peer identity property, if any.

pub fn peer_is_authenticated(&self) -> bool[src]

true if the client has provided a valid certificate (or other auth method considered valid by gRPC). false in non-secure scenarios.

pub fn peer_identity(&self) -> AuthPropertyIter<'_>

Notable traits for AuthPropertyIter<'a>

impl<'a> Iterator for AuthPropertyIter<'a> type Item = AuthProperty<'a>;
[src]

AuthContext[peer_identity_property_name()]

There may be several of them (for instance if x509_subject_alternative_name is selected)

Trait Implementations

impl Drop for AuthContext[src]

impl<'a> IntoIterator for &'a AuthContext[src]

type Item = AuthProperty<'a>

The type of the elements being iterated over.

type IntoIter = AuthPropertyIter<'a>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter[src]

Iterate over the AuthContext properties

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.