pub trait Authorizer: Send + Sync {
// Required method
fn authorize(
&self,
action: AuthAction,
arg1: Option<&str>,
arg2: Option<&str>,
db_name: Option<&str>,
trigger: Option<&str>,
) -> AuthResult;
}Expand description
Statement authorizer callback (§9.4).
Called during SQL compilation (not execution) to approve or deny each operation. Used for sandboxing untrusted SQL.
§Parameters
action: The type of SQL operation being authorized.arg1/arg2: Context-dependent string parameters (table name, column name, index name, etc.). The meaning depends on theAuthAction.db_name: The database name (e.g."main","temp", attached name).trigger: If the operation originates inside a trigger, this is the trigger name.Nonefor top-level SQL.
Required Methods§
Return allow/deny/ignore for the given action.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".