pub struct OAuthPassthroughAuth { /* private fields */ }Expand description
OAuth passthrough — forwards the INCOMING MCP client token to the backend (H1).
PER-REQUEST: prefers the per-request inbound_token arg to apply; falls back
to the construction-time captured incoming_token (via
create_passthrough_auth_provider). When neither is present and the config
is required, apply returns HttpConnectorError::Auth.
§Trust boundary (WR-04)
This provider relays a client-controlled value into an operator-controlled destination — the trust posture is intentional and must stay visible at the type:
- The MCP client controls the forwarded token VALUE: it is the raw
inbound
Authorizationheader captured byTokenCaptureAuthProviderand forwarded verbatim (bare tokens are prefixed withBearerinapply). - The operator controls the destination header NAME (
target_header), fixed in the committed config; the client cannot redirect the token to a different header.
Relaying the client’s own credential to the backend is the intended
SSO-passthrough behavior — use it only when the backend should receive the
MCP client’s own identity. The HeaderValue::try_from control-character
rejection in apply is the protection against header injection; a
malformed token value is rejected, not relayed.
Trait Implementations§
Source§impl HttpAuthProvider for OAuthPassthroughAuth
impl HttpAuthProvider for OAuthPassthroughAuth
Source§fn apply<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
headers: &'life1 mut HeaderMap,
_query: &'life2 mut HashMap<String, String>,
inbound_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<(), HttpConnectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn apply<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
headers: &'life1 mut HeaderMap,
_query: &'life2 mut HashMap<String, String>,
inbound_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<(), HttpConnectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Auto Trait Implementations§
impl Freeze for OAuthPassthroughAuth
impl RefUnwindSafe for OAuthPassthroughAuth
impl Send for OAuthPassthroughAuth
impl Sync for OAuthPassthroughAuth
impl Unpin for OAuthPassthroughAuth
impl UnsafeUnpin for OAuthPassthroughAuth
impl UnwindSafe for OAuthPassthroughAuth
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> 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