pub struct NativeAssertionBridge { /* private fields */ }Expand description
A host may replace its delivery channel after a webview reload without changing the authenticated epoch. Logout/account replacement must retire this bridge; Rust capabilities observe that epoch change immediately.
Implementations§
Source§impl NativeAssertionBridge
impl NativeAssertionBridge
pub fn new( session_key: String, sink: impl Fn(NativeAssertionRequest) -> Result<(), String> + Send + Sync + 'static, ) -> Result<Self>
pub fn rebind( &self, sink: impl Fn(NativeAssertionRequest) -> Result<(), String> + Send + Sync + 'static, ) -> Result<()>
Sourcepub fn complete(
&self,
request_id: &str,
result: Result<IdentityAssertion, String>,
) -> Result<bool>
pub fn complete( &self, request_id: &str, result: Result<IdentityAssertion, String>, ) -> Result<bool>
Complete only the request issued to the current delivery channel. Late or duplicate replies cannot install identity material for another epoch.
pub fn retire(&self) -> Result<()>
Trait Implementations§
Source§impl AssertionProvider for NativeAssertionBridge
impl AssertionProvider for NativeAssertionBridge
fn assertion<'life0, 'async_trait>(
&'life0 self,
__arg1: bool,
) -> Pin<Box<dyn Future<Output = Result<IdentityAssertion>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn assertion_for_device<'life0, 'life1, 'async_trait>(
&'life0 self,
refresh: bool,
device: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<IdentityAssertion>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn assertion_for_device<'life0, 'life1, 'async_trait>(
&'life0 self,
refresh: bool,
device: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<IdentityAssertion>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns an assertion for the exact durable installation being enrolled. Read more
Source§fn assertion_for_device_recovery<'life0, 'life1, 'async_trait>(
&'life0 self,
device: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<IdentityAssertion>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn assertion_for_device_recovery<'life0, 'life1, 'async_trait>(
&'life0 self,
device: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<IdentityAssertion>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a newly authorized assertion after OpenRTC reports that this
installation ID is bound to a different public key. Consumer backends
should require recent interactive authentication before adding their
recovery authorization claim. This is never called for another 412.
Source§fn session_key(&self) -> Result<Option<String>>
fn session_key(&self) -> Result<Option<String>>
Stable, non-secret local identifier for one signed-in principal. It
changes on login/logout/account switch, never on access-token refresh.
OpenRTC hashes it with the app and install-key thumbprint before asking
the certificate store for a cold-start lookup.
None preserves the RC
assertion-first compatibility behavior.Source§fn identity_epoch(&self) -> u64
fn identity_epoch(&self) -> u64
Monotonic application-owned login epoch. Increment it only for login,
logout, account switch, or explicit revocation–never for an ordinary
OAuth access-token refresh.
Source§fn subscribe_identity_epoch(&self) -> Option<Receiver<u64>>
fn subscribe_identity_epoch(&self) -> Option<Receiver<u64>>
Optional immediate epoch observer. OpenRTC closes every capability
created under the old epoch when this value changes. Hosts without an
observer must explicitly close their handles during logout/account
switch; grant renewal still fails closed if
identity_epoch() changed.Auto Trait Implementations§
impl !Freeze for NativeAssertionBridge
impl !RefUnwindSafe for NativeAssertionBridge
impl !UnwindSafe for NativeAssertionBridge
impl Send for NativeAssertionBridge
impl Sync for NativeAssertionBridge
impl Unpin for NativeAssertionBridge
impl UnsafeUnpin for NativeAssertionBridge
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
Mutably borrows from an owned value. Read more