pub struct SqliteStorage { /* private fields */ }Implementations§
Source§impl SqliteStorage
impl SqliteStorage
pub fn new(db_path: String, keyfile: String) -> Result<Self, String>
Sourcepub fn calculate_canonical_hash(
parent_id: &str,
actor_id: &str,
timestamp: u64,
payload: &str,
rules_evaluated: &str,
) -> Result<[u8; 32], String>
pub fn calculate_canonical_hash( parent_id: &str, actor_id: &str, timestamp: u64, payload: &str, rules_evaluated: &str, ) -> Result<[u8; 32], String>
Compute the canonical SHA-256 hash for a decision (matches main.rs logic).
pub fn validate_ledger(&self) -> Result<String, String>
Sourcepub fn register_agent(
&self,
public_key: &str,
alias: &str,
metadata: &str,
) -> Result<String, String>
pub fn register_agent( &self, public_key: &str, alias: &str, metadata: &str, ) -> Result<String, String>
Register an agent through a signed, immutable delegation event.
The first registration bootstraps the gate key itself. Every later registration must be signed by an active agent with delegation rights.
Sourcepub fn verify_agent(&self, public_key: &str) -> Result<bool, String>
pub fn verify_agent(&self, public_key: &str) -> Result<bool, String>
Verify that an agent has a valid signed registration and is active.
Sourcepub fn list_agents(&self) -> Result<String, String>
pub fn list_agents(&self) -> Result<String, String>
List registered agents and the validity of their registration receipts.
Sourcepub fn get_agent(&self, public_key: &str) -> Result<String, String>
pub fn get_agent(&self, public_key: &str) -> Result<String, String>
Get a single registered agent.
Sourcepub fn rotate_agent(
&self,
current_public_key: &str,
new_public_key: &str,
) -> Result<String, String>
pub fn rotate_agent( &self, current_public_key: &str, new_public_key: &str, ) -> Result<String, String>
Rotate an identity to a new Ed25519 verification key while retaining its stable ID.
Sourcepub fn revoke_agent(
&self,
public_key: &str,
reason: &str,
) -> Result<String, String>
pub fn revoke_agent( &self, public_key: &str, reason: &str, ) -> Result<String, String>
Revoke an active identity key and invalidate its unconsumed permits.
Sourcepub fn list_identity_events(&self) -> Result<String, String>
pub fn list_identity_events(&self) -> Result<String, String>
List signed rotation and revocation events.
Sourcepub fn request_action(
&self,
intent: &str,
agent_keyfile: &str,
ttl_seconds: u64,
) -> Result<String, String>
pub fn request_action( &self, intent: &str, agent_keyfile: &str, ttl_seconds: u64, ) -> Result<String, String>
Ask the Tempus gate for a single-use authorization receipt.
Sourcepub fn request_action_signed(
&self,
intent: &str,
agent_id: &str,
agent_signature: &str,
ttl_seconds: u64,
) -> Result<String, String>
pub fn request_action_signed( &self, intent: &str, agent_id: &str, agent_signature: &str, ttl_seconds: u64, ) -> Result<String, String>
Lower-level transport-neutral authorization API for signed requests.
Sourcepub fn commit_outcome(
&self,
authorization_id: &str,
outcome: &str,
executor_keyfile: &str,
) -> Result<String, String>
pub fn commit_outcome( &self, authorization_id: &str, outcome: &str, executor_keyfile: &str, ) -> Result<String, String>
Consume an allowed permit exactly once and append the executor outcome.
Sourcepub fn commit_outcome_signed(
&self,
authorization_id: &str,
outcome: &str,
) -> Result<String, String>
pub fn commit_outcome_signed( &self, authorization_id: &str, outcome: &str, ) -> Result<String, String>
Consume an allowed permit exactly once with an already signed outcome.
Sourcepub fn get_trace(&self, action_id: &str) -> Result<String, String>
pub fn get_trace(&self, action_id: &str) -> Result<String, String>
Return the authorization and optional execution receipt for an action.
Sourcepub fn verify_trace(&self, action_id: &str) -> Result<String, String>
pub fn verify_trace(&self, action_id: &str) -> Result<String, String>
Cryptographically verify an action trace end to end.
Sourcepub fn verify_trace_pinned(
&self,
action_id: &str,
gate_public_key: &str,
executor_public_keys: &[String],
) -> Result<String, String>
pub fn verify_trace_pinned( &self, action_id: &str, gate_public_key: &str, executor_public_keys: &[String], ) -> Result<String, String>
Verify an action trace against a gate public key pinned by the verifier (and optionally pinned executor keys). Does not trust the database’s own trusted root.
Sourcepub fn export_bundle(
&self,
action_id: &str,
max_stream_events: Option<u64>,
) -> Result<String, String>
pub fn export_bundle( &self, action_id: &str, max_stream_events: Option<u64>, ) -> Result<String, String>
Export a self-contained evidence bundle for one action (see
tempus.evidence-bundle.v1). Contains no private key material.
Sourcepub fn install_policy(&self, policy_spec: &str) -> Result<String, String>
pub fn install_policy(&self, policy_spec: &str) -> Result<String, String>
Install and activate a deterministic policy bundle signed by the gate.
Sourcepub fn install_allow_all_dev_policy(&self) -> Result<String, String>
pub fn install_allow_all_dev_policy(&self) -> Result<String, String>
DEVELOPMENT ONLY. Explicitly install a signed policy that allows every action,
resource and executor for every tenant without its own policy. Nothing installs
this implicitly: without it (or a real policy) the gate answers BLOCKED with
POLICY_NOT_INSTALLED. Idempotent while a current dev policy is active. A stored
dev policy whose allowed_currencies is not a list of exact codes is left in
place and refused on load (TEMPUS_POLICY_INVALID); only this call replaces it.
Sourcepub fn list_policies(&self) -> Result<String, String>
pub fn list_policies(&self) -> Result<String, String>
List active and retired policy bundles.
Sourcepub fn signer_conformance(&self) -> Result<String, String>
pub fn signer_conformance(&self) -> Result<String, String>
Exercise the configured local or remote signer with an offline-verifiable fixture.