Skip to main content

AuthManager

Trait AuthManager 

Source
pub trait AuthManager: Send + Sync {
    // Required methods
    fn list(&self) -> Vec<HostAuth>;
    fn get_by_id(&self, id: &str) -> Option<HostAuth>;
    fn save(
        &self,
        auths: SavedAuths,
        write: &mut dyn FnMut() -> Result<(), String>,
    ) -> Result<(), String>;
    fn lookup_session_affinity(
        &self,
        provider: &str,
        model: &str,
        session_id: &str,
    ) -> (String, Option<HostAuth>);
}
Expand description

The server’s credential manager as the plugin host uses it.

Required Methods§

Source

fn list(&self) -> Vec<HostAuth>

Go Manager.List.

Source

fn get_by_id(&self, id: &str) -> Option<HostAuth>

Go Manager.GetByID.

Source

fn save( &self, auths: SavedAuths, write: &mut dyn FnMut() -> Result<(), String>, ) -> Result<(), String>

Go saveAuthFile from the write on: write puts the file (its error is the callback’s), then the manager registers or updates auths and removes the file’s other credentials (upsertAuthRecordsForPath), persisting them as its store does. The manager serialises this with its own credential changes.

Source

fn lookup_session_affinity( &self, provider: &str, model: &str, session_id: &str, ) -> (String, Option<HostAuth>)

Go Manager.LookupSessionAffinity: the status (bound, unbound, ambiguous, unsupported) and, when bound, the credential.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§