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§
Sourcefn save(
&self,
auths: SavedAuths,
write: &mut dyn FnMut() -> Result<(), String>,
) -> Result<(), String>
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".