pub trait SourcePlugin {
// Required methods
fn describe(&self) -> Describe;
fn validate_config(&self, config: &str) -> Result<(), String>;
fn auth_status(&self, ctx: &Context) -> Result<AuthStatus, String>;
fn authenticate(&self, ctx: &Context) -> Result<(), String>;
fn fetch(&self, req: &FetchRequest) -> Result<FetchResult, String>;
// Provided methods
fn config_auth_realm(&self, _config: &str) -> Result<Option<String>, String> { ... }
fn auth_begin(&self, _ctx: &Context) -> Result<AuthChallenge, String> { ... }
fn auth_poll(
&self,
_ctx: &Context,
_handle: &str,
) -> Result<AuthPollResult, String> { ... }
}Expand description
The contract (ADR 0001). Builtins implement it in-process; the stdio harness for external plugins wraps the same shapes.
Required Methods§
fn describe(&self) -> Describe
Sourcefn validate_config(&self, config: &str) -> Result<(), String>
fn validate_config(&self, config: &str) -> Result<(), String>
Pure, offline config validation — run at PROPOSAL validation so a malformed sources.ron cannot be accepted (SOL finding 35).
fn auth_status(&self, ctx: &Context) -> Result<AuthStatus, String>
fn authenticate(&self, ctx: &Context) -> Result<(), String>
fn fetch(&self, req: &FetchRequest) -> Result<FetchResult, String>
Provided Methods§
Sourcefn config_auth_realm(&self, _config: &str) -> Result<Option<String>, String>
fn config_auth_realm(&self, _config: &str) -> Result<Option<String>, String>
The auth realm this CONFIGURATION requires (tenant/client-derived —
SOL finding 33). None falls back to Describe::auth_realm.
Sourcefn auth_begin(&self, _ctx: &Context) -> Result<AuthChallenge, String>
fn auth_begin(&self, _ctx: &Context) -> Result<AuthChallenge, String>
Begin an interactive sign-in (device-code style). Default: not supported — surfaces degrade to “run the CLI” with a live status poll, so plugins without an interactive flow still work in the web.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".