pub struct TrustedIdentityVerifier;Expand description
Tokenless trusted-upstream verifier — AUTH_MODE=trusted.
For the proxied-integration deployment shape: an existing application’s
backend has already authenticated the user and proxies smooth-operator over
a trusted/internal network. That upstream forwards the user’s identity
(sub / org / role / groups); smooth-operator trusts it without
any signature verification — the upstream owns identity and token
lifetime, so there is no signature to check and no exp to enforce.
§Wire format — identity in the same slot a token would ride
The forwarded identity rides in the exact same slot a JWT would: the
/ws ?token= query param (reference server) or the send_message token
field (Lambda). So all the existing transport plumbing is reused — the only
difference from JwtVerifier is trust, don’t verify.
The value is base64url(JSON) of the [Claims] shape, e.g.
base64url({"sub":"u1","org":"acme","role":"basic","groups":["github:acme/secret"]}).
base64url is used (not raw JSON) so the blob survives the query-string and
JSON-string transports cleanly without escaping. No padding is required
(URL_SAFE_NO_PAD is accepted; padded URL_SAFE is also tolerated).
§Security boundary — this is trust without verification
AUTH_MODE=trusted is only safe when smooth-operator is not directly
reachable by clients — it must be fronted by your authenticated
backend/proxy on a trusted network. A client that can reach /ws directly
could forge any identity (any org, any groups). AuthConfig::from_env
emits a loud startup tracing::warn! to that effect whenever this mode is
selected.
§Fail closed — never silently no-auth-admin
Absent / empty / malformed trusted identity yields an AuthError, which the
connect path (crate::access_control::AccessContext::anonymous) maps to an
anonymous connection (org-public only) — exactly like the no-token path.
Trusted mode never degrades to an admin / all-access principal on bad
input.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrustedIdentityVerifier
impl RefUnwindSafe for TrustedIdentityVerifier
impl Send for TrustedIdentityVerifier
impl Sync for TrustedIdentityVerifier
impl Unpin for TrustedIdentityVerifier
impl UnsafeUnpin for TrustedIdentityVerifier
impl UnwindSafe for TrustedIdentityVerifier
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request