#[non_exhaustive]pub struct ExchangeRequest {
pub subject_token: String,
pub subject_token_type: String,
pub actor_token: Option<(String, String)>,
pub audience: Vec<String>,
pub resource: Vec<String>,
pub scopes: Vec<String>,
pub requested_token_type: Option<String>,
}Expand description
What to exchange, and for what (RFC 8693 §2.1).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.subject_token: StringThe token naming the principal the work is for.
subject_token_type: StringIts type; ACCESS_TOKEN_TYPE by default.
actor_token: Option<(String, String)>The acting agent’s own token and its type, when the identity provider wants the actor authenticated by token as well as by the client credentials.
audience: Vec<String>The agents the new token is for (audience, repeated).
resource: Vec<String>The resources the new token is for (resource, repeated).
scopes: Vec<String>The scopes asked for; the identity provider may grant fewer.
requested_token_type: Option<String>The token type asked for, if any.
Implementations§
Source§impl ExchangeRequest
impl ExchangeRequest
Sourcepub fn new(subject_token: impl Into<String>) -> ExchangeRequest
pub fn new(subject_token: impl Into<String>) -> ExchangeRequest
Exchanges subject_token, an access token.
Sourcepub fn with_subject_token_type(
self,
token_type: impl Into<String>,
) -> ExchangeRequest
pub fn with_subject_token_type( self, token_type: impl Into<String>, ) -> ExchangeRequest
Sets the subject token’s type.
Sourcepub fn with_actor_token(
self,
token: impl Into<String>,
token_type: impl Into<String>,
) -> ExchangeRequest
pub fn with_actor_token( self, token: impl Into<String>, token_type: impl Into<String>, ) -> ExchangeRequest
Presents the acting agent’s own token, of token_type.
Sourcepub fn with_audience(self, audience: impl Into<String>) -> ExchangeRequest
pub fn with_audience(self, audience: impl Into<String>) -> ExchangeRequest
Adds an audience.
Sourcepub fn with_resource(self, resource: impl Into<String>) -> ExchangeRequest
pub fn with_resource(self, resource: impl Into<String>) -> ExchangeRequest
Adds a resource.
Sourcepub fn with_scopes<I, S>(self, scopes: I) -> ExchangeRequest
pub fn with_scopes<I, S>(self, scopes: I) -> ExchangeRequest
Sets the scopes asked for.
Sourcepub fn with_requested_token_type(
self,
token_type: impl Into<String>,
) -> ExchangeRequest
pub fn with_requested_token_type( self, token_type: impl Into<String>, ) -> ExchangeRequest
Asks for a token of token_type.
Trait Implementations§
Source§impl Clone for ExchangeRequest
impl Clone for ExchangeRequest
Source§fn clone(&self) -> ExchangeRequest
fn clone(&self) -> ExchangeRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Forget for ExchangeRequest
impl Freeze for ExchangeRequest
impl Move for ExchangeRequest
impl RefUnwindSafe for ExchangeRequest
impl Send for ExchangeRequest
impl Sync for ExchangeRequest
impl Unpin for ExchangeRequest
impl UnsafeUnpin for ExchangeRequest
impl UnwindSafe for ExchangeRequest
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].