pub struct HarnessSigner { /* private fields */ }Implementations§
Source§impl HarnessSigner
impl HarnessSigner
Sourcepub fn generated(credential_ids: &[&str]) -> Self
pub fn generated(credential_ids: &[&str]) -> Self
A signer holding fresh random roots under the given fixture credential ids.
Sourcepub fn fixed(credential_id: &str, secret: [u8; 32]) -> Self
pub fn fixed(credential_id: &str, secret: [u8; 32]) -> Self
A signer holding one root with a fixed secret (the golden pair’s RFC 8032 key).
Sourcepub fn from_pairs(roots: impl IntoIterator<Item = (String, KeyPair)>) -> Self
pub fn from_pairs(roots: impl IntoIterator<Item = (String, KeyPair)>) -> Self
A signer holding the given key pairs as roots. The pair’s type decides only how
FixtureRoot::account_public spells the key; the signature is the same.
Sourcepub fn without(&self, credential_id: &str) -> Self
pub fn without(&self, credential_id: &str) -> Self
The same signer without the root credential_id: requests for that credential
return not_found, like a vault missing the key or ck-bus missing its grant on it.
pub fn with_fault(self, fault: SignerFault) -> Self
pub fn root(&self, credential_id: &str) -> &FixtureRoot
pub fn observed_principals(&self) -> Vec<Option<Principal>>
Sourcepub fn manifest(&self) -> ModuleManifest
pub fn manifest(&self) -> ModuleManifest
Register as the claustrum vault’s management surface, so ck-bus can route signing requests to the same module id and operations as in production.
Sourcepub fn answer(&self, body: &[u8]) -> HandlerOutcome
pub fn answer(&self, body: &[u8]) -> HandlerOutcome
Answers one request body the way claustrum’s read surface does: a {method, params} body in, {"result": ...} out, a vault refusal as {"result": {"error": {code, class}}} in an ordinary response, and undecodable params as an error
frame (invalid_params).
Trait Implementations§
Source§impl Clone for HarnessSigner
impl Clone for HarnessSigner
Source§impl ModuleHandler for HarnessSigner
impl ModuleHandler for HarnessSigner
Source§fn on_bind<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 RouteBindRequest,
) -> Pin<Box<dyn Future<Output = BindDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_bind<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 RouteBindRequest,
) -> Pin<Box<dyn Future<Output = BindDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Accepts every caller. The principal is recorded for the report, never checked: this signer carries no authority to check it against.
Source§fn handle<'life0, 'async_trait>(
&'life0 self,
_ctx: RequestCtx,
body: Vec<u8>,
) -> Pin<Box<dyn Future<Output = HandlerOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
_ctx: RequestCtx,
body: Vec<u8>,
) -> Pin<Box<dyn Future<Output = HandlerOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
RequestCtx::emit and return
HandlerOutcome::Streamed. Each request runs in its own task so one slow
handler cannot head-of-line-block another route.Source§fn on_hello_ack<'life0, 'life1, 'async_trait>(
&'life0 self,
_ack: &'life1 ModuleHelloAckBody,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_hello_ack<'life0, 'life1, 'async_trait>(
&'life0 self,
_ack: &'life1 ModuleHelloAckBody,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn resume_scope_sync<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 ModuleHandle,
) -> Pin<Box<dyn Future<Output = Option<ResumeScopeSync>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn resume_scope_sync<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 ModuleHandle,
) -> Pin<Box<dyn Future<Output = Option<ResumeScopeSync>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Self::on_reconnected instead.Source§fn on_reconnected<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 ModuleHandle,
_scope_sync: Option<Result<ScopeSyncReply, ScopeCallError>>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_reconnected<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 ModuleHandle,
_scope_sync: Option<Result<ScopeSyncReply, ScopeCallError>>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn control_ops(&self) -> Vec<String>
fn control_ops(&self) -> Vec<String>
consent/v1.
Read and validated once before HELLO: names must be nonempty ASCII names
using letters, digits, ., _, - or /, with no empty segments.
Duplicates and SDK-owned health.check, config.review and route.bind
are refused with SubcModuleError::InvalidControlOp before advertising.Source§fn on_control_request<'life0, 'life1, 'async_trait>(
&'life0 self,
_op: &'life1 str,
_body: Value,
_cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<Value, ErrorBody>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_control_request<'life0, 'life1, 'async_trait>(
&'life0 self,
_op: &'life1 str,
_body: Value,
_cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<Value, ErrorBody>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
op string; for a protocol-tagged request
with no op, such as consent/v1, it is the body’s protocol string.
Return a JSON RESPONSE body or an ErrorBody carrying a wire error code
and message. Runs off the reader, independently of routes, health and
config review, with at most 16 concurrent calls per connection and no
queue; overload returns resource_exhausted. There is no SDK time limit. Read moreSource§fn config_declaration(&self) -> Option<ConfigDeclareRequest>
fn config_declaration(&self) -> Option<ConfigDeclareRequest>
config.review, declares
these locations, and fetches immutable views before calling config_apply.
Returning None leaves the existing module wire and file reader unchanged.Source§fn config_review<'life0, 'async_trait>(
&'life0 self,
_request: ConfigReviewRequest,
) -> Pin<Box<dyn Future<Output = ConfigReviewReply> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn config_review<'life0, 'async_trait>(
&'life0 self,
_request: ConfigReviewRequest,
) -> Pin<Box<dyn Future<Output = ConfigReviewReply> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn config_apply<'life0, 'async_trait>(
&'life0 self,
_view: ConfigView,
) -> Pin<Box<dyn Future<Output = Result<(), Vec<String>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn config_apply<'life0, 'async_trait>(
&'life0 self,
_view: ConfigView,
) -> Pin<Box<dyn Future<Output = Result<(), Vec<String>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn config_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn config_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
config.gate, never after a gate refusal.Source§fn on_config_state<'life0, 'async_trait>(
&'life0 self,
_state: ConfigState,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_config_state<'life0, 'async_trait>(
&'life0 self,
_state: ConfigState,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn on_config_error<'life0, 'async_trait>(
&'life0 self,
error: ConfigError,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_config_error<'life0, 'async_trait>(
&'life0 self,
error: ConfigError,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn on_project_config_error<'life0, 'async_trait>(
&'life0 self,
_project_id: String,
error: ConfigError,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_project_config_error<'life0, 'async_trait>(
&'life0 self,
_project_id: String,
error: ConfigError,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Self::on_config_error.Source§fn on_bound<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 RouteHandle,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_bound<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 RouteHandle,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthReport> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthReport> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn on_route_gone<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 RouteHandle,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_route_gone<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 RouteHandle,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn request_pools(&self) -> RequestPools
fn request_pools(&self) -> RequestPools
Source§fn on_draining<'life0, 'async_trait>(
&'life0 self,
_reason: RouteCloseReason,
_deadline: SystemTime,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_draining<'life0, 'async_trait>(
&'life0 self,
_reason: RouteCloseReason,
_deadline: SystemTime,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
reason (a restart, reload, disable, or the daemon’s own shutdown), and
usually has already stopped admitting new routes to it. Modules that
opt in to accepting drains should implement Self::on_draining_notice
instead, to distinguish the two kinds of notice. Read moreSource§fn on_draining_notice<'life0, 'async_trait>(
&'life0 self,
notice: DrainNotice,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_draining_notice<'life0, 'async_trait>(
&'life0 self,
notice: DrainNotice,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Self::on_draining, with the per-notice route admission state.
The default forwards to on_draining for existing handlers.Source§fn on_connection_end<'life0, 'async_trait>(
&'life0 self,
_end: ConnectionEnd,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_connection_end<'life0, 'async_trait>(
&'life0 self,
_end: ConnectionEnd,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Closed is a
module stop. Called once, after request tasks have finished or been
cancelled. A module that wants a different exit code for an unannounced
end can decide here. Not called for handler or protocol failures. A
later, unexpected writer failure can still make serving return an error.