AccessController

Trait AccessController 

Source
pub trait AccessController: Send + Sync {
    // Required methods
    fn get_type(&self) -> &str;
    fn get_authorized_by_role<'life0, 'life1, 'async_trait>(
        &'life0 self,
        role: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn grant<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        capability: &'life1 str,
        key_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn revoke<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        capability: &'life1 str,
        key_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        address: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ManifestParams>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn can_append<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        entry: &'life1 dyn LogEntry,
        identity_provider: &'life2 dyn IdentityProvider,
        additional_context: &'life3 dyn CanAppendAdditionalContext,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

A trait que todos os controladores de acesso do GuardianDB devem implementar.

Required Methods§

Source

fn get_type(&self) -> &str

Retorna o tipo do controlador de acesso como uma string.

Source

fn get_authorized_by_role<'life0, 'life1, 'async_trait>( &'life0 self, role: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retorna a lista de chaves autorizadas para uma dada permissão (“role”).

Source

fn grant<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, capability: &'life1 str, key_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Concede a uma nova chave uma determinada permissão.

Source

fn revoke<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, capability: &'life1 str, key_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove a permissão de uma chave para realizar uma ação.

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Carrega a configuração do controlador de acesso a partir de um endereço.

Source

fn save<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ManifestParams>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Salva/persiste a configuração do controlador (seu manifesto).

Source

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fecha o controlador e libera quaisquer recursos.

Source

fn can_append<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, entry: &'life1 dyn LogEntry, identity_provider: &'life2 dyn IdentityProvider, additional_context: &'life3 dyn CanAppendAdditionalContext, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Verifica se uma entrada pode ser adicionada ao log.

Implementors§