pub struct UiServer { /* private fields */ }Implementations§
Source§impl UiServer
impl UiServer
pub fn new(facade: AreevFacade, db_label: String) -> Self
Sourcepub fn with_sso(
self,
header: impl Into<String>,
secret: impl Into<String>,
) -> Self
pub fn with_sso( self, header: impl Into<String>, secret: impl Into<String>, ) -> Self
Enable trusted-header SSO (v0). header names the identity header
the authenticating proxy forwards; secret is the proxy’s shared
secret, demanded in x-areev-proxy-secret on every SSO request.
Sourcepub fn with_credentials(self, map: CredentialMap) -> Self
pub fn with_credentials(self, map: CredentialMap) -> Self
Multi-principal mode: attach the credential map (areev-auth.json).
Tokens resolve to principal names; rights come from the memory
file’s own grant grains; unauthenticated requests run as
anonymous. See docs/cal-reference.md §9.
Sourcepub fn with_loop_policy(self, policy: Policy) -> Self
pub fn with_loop_policy(self, policy: Policy) -> Self
Attach a host loop policy to the console’s loop routes, so a
console-triggered run honors the same auto-apply grants, denies, and
severity floors as areev loop run --policy.
Sourcepub fn allow_remote(self, yes: bool) -> Self
pub fn allow_remote(self, yes: bool) -> Self
Accept requests whose Host header is non-loopback. Off by default so
the loopback console is protected against DNS-rebinding reads even when
unauthenticated; the CLI enables it under --allow-remote.
Sourcepub fn with_auth(self, token: String) -> Self
pub fn with_auth(self, token: String) -> Self
Require a shared secret on every request (the console page, reads,
and writes). Browsers authenticate through the native Basic prompt
(any username; password = token); scripts may send Authorization: Bearer <token>. Use this to serve the console to more than a single
trusted local operator. Pair with a TLS-terminating proxy for non-local
exposure — the token crosses the wire in the clear otherwise.
Sourcepub fn allow_destructive_ops(self, allow: bool) -> Self
pub fn allow_destructive_ops(self, allow: bool) -> Self
Permit or forbid destructive CAL (FORGET <hash>) from the query
console. Enabled by default; pass false to serve a read-only console.
Since the plain console is unauthenticated, disabling this is the safe
choice when the console is exposed beyond a trusted local operator.
Sourcepub fn into_hub(self, token: Option<String>, dir: &str) -> Result<Self>
pub fn into_hub(self, token: Option<String>, dir: &str) -> Result<Self>
areevd mode: require Authorization: Bearer <token> on POST
endpoints and accept segment push/pull under dir.
Sourcepub fn bind(addr: &str) -> Result<TcpListener>
pub fn bind(addr: &str) -> Result<TcpListener>
Bind and return the listener (lets callers learn the ephemeral port).
Sourcepub fn serve(&self, listener: TcpListener) -> Result<()>
pub fn serve(&self, listener: TcpListener) -> Result<()>
Serve forever on an already-bound listener.
Auto Trait Implementations§
impl !RefUnwindSafe for UiServer
impl !UnwindSafe for UiServer
impl Freeze for UiServer
impl Send for UiServer
impl Sync for UiServer
impl Unpin for UiServer
impl UnsafeUnpin for UiServer
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<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for 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