pub struct MossClient { /* private fields */ }Expand description
MOSS client for signing and verification.
Implementations§
Source§impl MossClient
impl MossClient
Sourcepub fn with_config(config: MossConfig) -> Result<Self, MossError>
pub fn with_config(config: MossConfig) -> Result<Self, MossError>
Creates a new MOSS client with custom configuration.
Sourcepub async fn sign(&self, req: SignRequest) -> Result<SignResult, MossError>
pub async fn sign(&self, req: SignRequest) -> Result<SignResult, MossError>
Signs a payload and returns the envelope.
Sourcepub fn verify(&self, payload: &Value, envelope: &Envelope) -> VerifyResult
pub fn verify(&self, payload: &Value, envelope: &Envelope) -> VerifyResult
Verifies an envelope against a payload.
Sourcepub async fn register_agent(
&self,
req: RegisterAgentRequest,
) -> Result<RegisterAgentResult, MossError>
pub async fn register_agent( &self, req: RegisterAgentRequest, ) -> Result<RegisterAgentResult, MossError>
Registers a new agent.
Sourcepub async fn get_agent(
&self,
agent_id: &str,
) -> Result<Option<Agent>, MossError>
pub async fn get_agent( &self, agent_id: &str, ) -> Result<Option<Agent>, MossError>
Gets agent details.
Sourcepub async fn rotate_agent_key(
&self,
agent_id: &str,
reason: Option<&str>,
) -> Result<RotateKeyResult, MossError>
pub async fn rotate_agent_key( &self, agent_id: &str, reason: Option<&str>, ) -> Result<RotateKeyResult, MossError>
Rotates an agent’s signing key.
Sourcepub async fn suspend_agent(
&self,
agent_id: &str,
reason: Option<&str>,
) -> Result<(), MossError>
pub async fn suspend_agent( &self, agent_id: &str, reason: Option<&str>, ) -> Result<(), MossError>
Suspends an agent.
Sourcepub async fn reactivate_agent(&self, agent_id: &str) -> Result<(), MossError>
pub async fn reactivate_agent(&self, agent_id: &str) -> Result<(), MossError>
Reactivates a suspended agent.
Sourcepub async fn revoke_agent(
&self,
agent_id: &str,
reason: &str,
) -> Result<(), MossError>
pub async fn revoke_agent( &self, agent_id: &str, reason: &str, ) -> Result<(), MossError>
Permanently revokes an agent.
Sourcepub fn is_enterprise_enabled(&self) -> bool
pub fn is_enterprise_enabled(&self) -> bool
Returns true if enterprise mode is enabled.
Auto Trait Implementations§
impl !Freeze for MossClient
impl !RefUnwindSafe for MossClient
impl Send for MossClient
impl Sync for MossClient
impl Unpin for MossClient
impl UnsafeUnpin for MossClient
impl !UnwindSafe for MossClient
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