pub trait AuthExt {
// Required methods
fn register_policy(
&self,
policy: &Policy,
) -> impl Future<Output = Result<()>> + Send;
fn get_policy(
&self,
role: &str,
) -> impl Future<Output = Result<Option<Policy>>> + Send;
fn list_policies(&self) -> impl Future<Output = Result<Vec<Policy>>> + Send;
fn assign_role(
&self,
node_id: &str,
role: &str,
) -> impl Future<Output = Result<()>> + Send;
fn get_role(
&self,
node_id: &str,
) -> impl Future<Output = Result<Option<String>>> + Send;
fn check_permission(
&self,
node_id: &str,
permission: Permission,
topic: &str,
) -> impl Future<Output = Result<bool>> + Send;
fn delete_policy(
&self,
role: &str,
) -> impl Future<Output = Result<()>> + Send;
fn unassign_role(
&self,
node_id: &str,
) -> impl Future<Output = Result<()>> + Send;
}Expand description
Authorization extension trait for Context
Required Methods§
Sourcefn list_policies(&self) -> impl Future<Output = Result<Vec<Policy>>> + Send
fn list_policies(&self) -> impl Future<Output = Result<Vec<Policy>>> + Send
List all registered policies
Sourcefn assign_role(
&self,
node_id: &str,
role: &str,
) -> impl Future<Output = Result<()>> + Send
fn assign_role( &self, node_id: &str, role: &str, ) -> impl Future<Output = Result<()>> + Send
Sourcefn check_permission(
&self,
node_id: &str,
permission: Permission,
topic: &str,
) -> impl Future<Output = Result<bool>> + Send
fn check_permission( &self, node_id: &str, permission: Permission, topic: &str, ) -> impl Future<Output = Result<bool>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.