pub struct AuthContext { /* private fields */ }
Expand description

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

Binding to gRPC Core AuthContext

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

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

AuthContext[peer_identity_property_name()]

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

Trait Implementations

Executes the destructor for this type. Read more

Iterate over the AuthContext properties

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.