pub struct ProxyToken { /* private fields */ }Expand description
The minted proxy token, as a header map (TRAP-7).
§Why a map rather than a string
Because that is what the service answers: authToken is a TokenParts map, and the
value at X-aws-proxy-auth is the header value. A client that treated the response as a
string would send a stringified map and get a rejection that reads like a bad token.
ProxyToken::headers always emits both headers, which is the other half of the
same trap: X-aws-proxy-auth without X-aws-proxy-port is rejected the same
indistinguishable way.
Implementations§
Source§impl ProxyToken
impl ProxyToken
Sourcepub fn from_map(
map: &BTreeMap<String, String>,
port: u16,
) -> Result<Self, Error>
pub fn from_map( map: &BTreeMap<String, String>, port: u16, ) -> Result<Self, Error>
Reads the token out of the service’s authToken map.
A missing X-aws-proxy-auth key is ErrorKind::Retryable via
crate::error::WireKind::AuthTokenMint: minting is inside the request retry path
(TRAP-9), and a throttle at minute 30 of a long run must not kill a trial that is
otherwise healthy.
Trait Implementations§
Source§impl Clone for ProxyToken
impl Clone for ProxyToken
Source§fn clone(&self) -> ProxyToken
fn clone(&self) -> ProxyToken
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProxyToken
Names the headers and the port, never the token value.
impl Debug for ProxyToken
Names the headers and the port, never the token value.
A minted proxy token is a credential, and a derived Debug would print it into every
log line that formats a ProxyToken, a RunMicrovmRequest holding one, or an error
chain containing either. The sibling type in crate::session::proxy made this choice
first; this is the same rule on the control-plane side of the conversion.
impl Eq for ProxyToken
Source§impl From<ProxyToken> for ProxyToken
The seam to the control plane’s own token type.
impl From<ProxyToken> for ProxyToken
The seam to the control plane’s own token type.
The two lanes that landed this module and crate::control arrived at the same trap
closure from different directions: control::ProxyToken keeps the auth value and the
port as two fields and emits a fixed pair from headers(), while this one keeps the
service’s whole map so a third header the platform adds later rides along without a
code change. Neither is wrong, and unifying them would mean one lane editing the
other’s module.
So the conversion lives here, which is the side that consumes it. It is the whole of
what a caller needs to hand ControlPlane::mint_auth_token’s result to a
TokenMinter, and it is From rather than a named function so the wiring is one
.into() at the boundary.
Source§fn from(token: ProxyToken) -> Self
fn from(token: ProxyToken) -> Self
Source§impl PartialEq for ProxyToken
impl PartialEq for ProxyToken
impl StructuralPartialEq for ProxyToken
Auto Trait Implementations§
impl Freeze for ProxyToken
impl RefUnwindSafe for ProxyToken
impl Send for ProxyToken
impl Sync for ProxyToken
impl Unpin for ProxyToken
impl UnsafeUnpin for ProxyToken
impl UnwindSafe for ProxyToken
Blanket Implementations§
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> 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> ⓘ
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> ⓘ
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