pub struct SmooIdentityVerifier { /* private fields */ }Expand description
Validates a Smoo-issued token — the hosted path (lom.smoo.ai wires Smoo’s
identity). Implemented as JWT validation keyed to Smoo’s issuer/audience,
reusing JwtVerifier’s internals.
§Live introspection (hosted, stubbed)
The fully-hosted variant would call Smoo’s auth server /introspect endpoint
(RFC 7662) to validate an opaque token and pull the principal. That requires
a network round-trip + a client credential, so it is intentionally not
implemented here: SmooIdentityVerifier::introspect documents the contract
and returns AuthError::Misconfigured until the introspection client is
wired. The JWT form below is the one exercised in tests + the default hosted
deployment (Smoo signs a JWT; we verify it locally with Smoo’s public key /
shared secret — no per-request network call).
Implementations§
Source§impl SmooIdentityVerifier
impl SmooIdentityVerifier
Sourcepub fn hs256(secret: &[u8], issuer: String, audience: Option<String>) -> Self
pub fn hs256(secret: &[u8], issuer: String, audience: Option<String>) -> Self
A Smoo-identity verifier over an HS256 shared secret, keyed to Smoo’s issuer + audience.
Sourcepub fn rs256(
public_key_pem: &[u8],
issuer: String,
audience: Option<String>,
) -> Result<Self, AuthError>
pub fn rs256( public_key_pem: &[u8], issuer: String, audience: Option<String>, ) -> Result<Self, AuthError>
A Smoo-identity verifier over an RS256 public key, keyed to Smoo’s issuer + audience.
§Errors
Returns AuthError::Misconfigured if the PEM can’t be parsed.
Sourcepub fn introspect(&self, _opaque_token: &str) -> Result<Principal, AuthError>
pub fn introspect(&self, _opaque_token: &str) -> Result<Principal, AuthError>
Live token introspection (RFC 7662) against Smoo’s auth server.
Not implemented: this is the opaque-token hosted variant, which needs
a network call to {auth_server}/introspect with a client credential and
a parse of the introspection response into a Principal. Wiring it is
the follow-up; until then this returns AuthError::Misconfigured so a
caller can never mistake the stub for a working validator.
§Errors
Always returns AuthError::Misconfigured (stub).
Trait Implementations§
Source§impl AuthVerifier for SmooIdentityVerifier
impl AuthVerifier for SmooIdentityVerifier
Auto Trait Implementations§
impl Freeze for SmooIdentityVerifier
impl RefUnwindSafe for SmooIdentityVerifier
impl Send for SmooIdentityVerifier
impl Sync for SmooIdentityVerifier
impl Unpin for SmooIdentityVerifier
impl UnsafeUnpin for SmooIdentityVerifier
impl UnwindSafe for SmooIdentityVerifier
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