pub struct GuardrailsModule { /* private fields */ }Expand description
The engine as a harness Module: no tables, no routes to speak of,
and a scheduled hook that runs the hygiene scan over the watched
wallets.
Implementations§
Source§impl GuardrailsModule
impl GuardrailsModule
Sourcepub fn new(engine: Arc<Guardrails>) -> Self
pub fn new(engine: Arc<Guardrails>) -> Self
Mounts the engine; watch adds scanned wallets.
Sourcepub fn watch(&self, wallet: WatchedWallet) -> Self
pub fn watch(&self, wallet: WatchedWallet) -> Self
Adds a wallet to the scheduled hygiene scan.
Sourcepub fn engine(&self) -> Arc<Guardrails> ⓘ
pub fn engine(&self) -> Arc<Guardrails> ⓘ
The engine, for hosts that call check or job_allowed directly.
Trait Implementations§
Source§impl Clone for GuardrailsModule
impl Clone for GuardrailsModule
Source§impl Module for GuardrailsModule
impl Module for GuardrailsModule
Source§fn requires(&self) -> &'static [Port]
fn requires(&self) -> &'static [Port]
Ports the module cannot run without; missing = build error.
Source§fn migrations(&self) -> Migrations
fn migrations(&self) -> Migrations
The module’s migrations, embedded per dialect.
Source§fn validate_config(&self, _cfg: &dyn Config) -> Result<(), ConfigError>
fn validate_config(&self, _cfg: &dyn Config) -> Result<(), ConfigError>
Rejects invalid configuration: missing required keys or malformed
values, reported together with the module name. Read more
Source§fn router(&self, _ctx: ModuleContext) -> Router
fn router(&self, _ctx: ModuleContext) -> Router
The module’s router, nested under
/v1/<name>.Source§fn scheduled<'a>(
&'a self,
ctx: &'a ModuleContext,
cron: &'a str,
) -> BoxFuture<'a, Result<(), AnyError>>
fn scheduled<'a>( &'a self, ctx: &'a ModuleContext, cron: &'a str, ) -> BoxFuture<'a, Result<(), AnyError>>
Scheduled work (
cron is the trigger expression). Default: none.Source§fn harness_api(&self) -> u32
fn harness_api(&self) -> u32
Contract version, checked by
Harness::build.Source§fn depends_on(&self) -> &'static [&'static str]
fn depends_on(&self) -> &'static [&'static str]
Modules this one’s schema sits on top of, by name. Read more
Source§fn tables(&self) -> &'static [&'static str]
fn tables(&self) -> &'static [&'static str]
Table names this module owns; duplicates across modules are a build
error.
Source§fn actor_kinds(&self) -> &'static [&'static str]
fn actor_kinds(&self) -> &'static [&'static str]
Actor kinds this module owns, each
[a-z0-9_-]; duplicates across
modules are a build error, and so is a kind with no handler registered
through
HarnessBuilder::actor. Read moreSource§fn personal_data(&self) -> &'static [PersonalDataSet]
fn personal_data(&self) -> &'static [PersonalDataSet]
What this module holds about a person, per table. Read more
Source§fn emits(&self) -> &'static [&'static str]
fn emits(&self) -> &'static [&'static str]
Event names this module emits (
"<module>.<event>"), listed by
/__health.Source§fn public_writes(&self) -> bool
fn public_writes(&self) -> bool
Whether the module has public write endpoints. Read more
Source§fn public_write_policy(&self) -> RoutePolicy
fn public_write_policy(&self) -> RoutePolicy
What actually protects those public writes, for a module with no
ADR 0010 surface to hang a per-action
RoutePolicy on
(issue #143). Read moreSource§fn signature_verification(&self) -> SignatureVerification
fn signature_verification(&self) -> SignatureVerification
Which verifier proves this module’s
RoutePolicy::Signature
deliveries (issue #533): how a webhook handler checks a machine
signature before acting. Read moreSource§fn max_body_bytes(&self, _cfg: &dyn Config) -> usize
fn max_body_bytes(&self, _cfg: &dyn Config) -> usize
The largest request body any route of this module accepts, so a
runtime can refuse an oversize body before buffering it
(issue #440). Read more
Source§fn streaming_routes(&self) -> &'static [StreamRoute]
fn streaming_routes(&self) -> &'static [StreamRoute]
Routes this module serves in streaming mode (issue #585), each
with its own
StreamRoute::max_bytes ceiling. Opt-in: the default
is empty, and every existing route keeps the buffered behaviour it
always had. Read moreSource§fn max_blob_object_bytes(&self) -> u64
fn max_blob_object_bytes(&self) -> u64
The largest object this module’s streamed and multipart
blob writes may produce (issue #586), enforced by the
ScopedBlob the harness hands the module on
put_stream, upload_part and complete_multipart. Read moreSource§fn self_check(&self) -> Vec<String>
fn self_check(&self) -> Vec<String>
Problems the module can find in itself, with no configuration
and no environment: its own embedded data, checked against its own
declarations. Read more
Source§fn well_known(&self) -> Option<Router>
fn well_known(&self) -> Option<Router>
Routes this module serves at the root under
/.well-known, for
spec-mandated discovery documents (OIDC openid-configuration,
jwks.json) that must live outside /v1 (issue #46). Paths are
relative to the prefix: register /jwks.json, not
/.well-known/jwks.json. Read moreSource§fn surface(&self) -> Surface
fn surface(&self) -> Surface
The module’s UI surface (ADR 0010): the actions a renderer may
offer and the views that compose them. Input schemas come from
the handler’s own body types (
Action::input::<Body>()), so the
declaration cannot drift from the route. Harness::build
validates it; GET /__surface serves the composition. Default:
nothing, and a module that declares nothing renders nothing.Auto Trait Implementations§
impl !RefUnwindSafe for GuardrailsModule
impl !UnwindSafe for GuardrailsModule
impl Freeze for GuardrailsModule
impl Send for GuardrailsModule
impl Sync for GuardrailsModule
impl Unpin for GuardrailsModule
impl UnsafeUnpin for GuardrailsModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more