pub struct Privacy { /* private fields */ }Expand description
Subject access and erasure over whatever the venture composed, plus the external providers a venture registered.
Implementations§
Source§impl Privacy
impl Privacy
Sourcepub fn new() -> Self
pub fn new() -> Self
The module, with no providers. What it reads is what the other modules
declared; add a system the harness never sees with Self::provider.
Sourcepub fn provider(self, provider: HttpProvider) -> Self
pub fn provider(self, provider: HttpProvider) -> Self
Registers an external system holding data about subjects (issue
#653). A provider is called on export and erasure, and its sections
are merged into the response under providers; a failure there never
obscures the local answer.
Sourcepub fn serve_provider(self, secret_env: impl Into<String>) -> Self
pub fn serve_provider(self, secret_env: impl Into<String>) -> Self
Serves the same protocol this module calls out on (issue #656), so
this deployment can be the provider another deployment reaches:
/v1/privacy/provider/export, /provider/erase/plan and
/provider/erase/apply answer over this composition’s declarations.
secret_env names the config/env variable holding the shared HMAC
secret — the same one an outbound HttpProvider::secret_env points
at. The name is taken here; the value is read from the config port
at request time, so one build works in every environment and a
deployment that was built before the secret existed does not have to be
rebuilt to start answering.
Opt-in rather than always-on because the routes are a public door: a deployment that never opted in does not answer, and a deployment that did but has no secret refuses every call rather than opening.
No admin token, deliberately. The HMAC over the raw body is the
authorisation — a caller on another deployment has no account here and
no ADMIN_TOKEN to present, so an admin guard would refuse every
legitimate call while authorising nothing the protocol lacks.
Trait Implementations§
Source§impl Module for Privacy
impl Module for Privacy
Source§fn requires(&self) -> &'static [Port]
fn requires(&self) -> &'static [Port]
The database it reads and erases is other modules’ tables; it owns
none itself.
Signer is required, not optional: without it there is no
confirmation token, and erasure would have to be a single call.
HttpClient and Defer join only when a provider is registered —
with none, this module makes no outbound call and defers nothing.
Serving the protocol (Self::serve_provider) adds no port: it
reads the same tables through the Db already required here and
takes its secret from the config every route already has, so a
deployment that only serves does not ask for an outbound client it
will never use.
Source§fn tables(&self) -> &'static [&'static str]
fn tables(&self) -> &'static [&'static str]
No tables. A module that owned one would have to declare its own personal data, and a privacy module keeping records about the people who asked what it keeps is a joke that writes itself. Erasure keeps none either: its receipt is the confirm response, not a stored record.
Source§fn validate_config(&self, _cfg: &dyn Config) -> Result<(), ConfigError>
fn validate_config(&self, _cfg: &dyn Config) -> Result<(), ConfigError>
Nothing to validate: the module has no configuration of its own, and
what it reads is what other modules declared, which
HarnessBuilder::build already checked. A provider’s secret is read
at call time and its absence reported as not_configured, not
refused at build.
Source§fn migrations(&self) -> Migrations
fn migrations(&self) -> Migrations
Source§fn router(&self, ctx: ModuleContext) -> Router
fn router(&self, ctx: ModuleContext) -> Router
/v1/<name>.Source§fn harness_api(&self) -> u32
fn harness_api(&self) -> u32
Harness::build.Source§fn depends_on(&self) -> &'static [&'static str]
fn depends_on(&self) -> &'static [&'static str]
Source§fn actor_kinds(&self) -> &'static [&'static str]
fn actor_kinds(&self) -> &'static [&'static str]
[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]
Source§fn emits(&self) -> &'static [&'static str]
fn emits(&self) -> &'static [&'static str]
"<module>.<event>"), listed by
/__health.Source§fn public_writes(&self) -> bool
fn public_writes(&self) -> bool
Source§fn public_write_policy(&self) -> RoutePolicy
fn public_write_policy(&self) -> RoutePolicy
RoutePolicy on
(issue #143). Read moreSource§fn signature_verification(&self) -> SignatureVerification
fn signature_verification(&self) -> SignatureVerification
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
Source§fn streaming_routes(&self) -> &'static [StreamRoute]
fn streaming_routes(&self) -> &'static [StreamRoute]
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
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>
Source§fn well_known(&self) -> Option<Router>
fn well_known(&self) -> Option<Router>
/.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
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.