pub struct KaslServer { /* private fields */ }Expand description
A client bound to one kasl-server instance.
Implementations§
Source§impl KaslServer
impl KaslServer
Sourcepub fn new(config: &KaslServerConfig) -> Result<Self>
pub fn new(config: &KaslServerConfig) -> Result<Self>
Builds a client for the configured server.
A configured CA certificate is added to the trust store rather than replacing it: a company CA for the server and public CAs for everything else is the normal self-hosted arrangement.
Sourcepub async fn health(&self) -> Result<Health>
pub async fn health(&self) -> Result<Health>
Asks the server whether it is serviceable, and which version it runs.
Unauthenticated: this is the call that tells a misspelled URL from a bad token, so it must not need the token to answer.
Sourcepub async fn identify(&self, token: &str) -> Result<AgentIdentity>
pub async fn identify(&self, token: &str) -> Result<AgentIdentity>
Resolves the agent token to the person it reports for.
Doubles as the token check: the server refuses an unknown, revoked, or
deactivated token with 401, which is reported as such rather than as
a transport failure.
Trait Implementations§
Source§impl Clone for KaslServer
impl Clone for KaslServer
Source§fn clone(&self) -> KaslServer
fn clone(&self) -> KaslServer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for KaslServer
impl !UnwindSafe for KaslServer
impl Freeze for KaslServer
impl Send for KaslServer
impl Sync for KaslServer
impl Unpin for KaslServer
impl UnsafeUnpin for KaslServer
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