Skip to main content

SqliteStorage

Struct SqliteStorage 

Source
pub struct SqliteStorage { /* private fields */ }

Implementations§

Source§

impl SqliteStorage

Source

pub fn new(db_path: String, keyfile: String) -> Result<Self, String>

Source

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).

Source

pub fn validate_ledger(&self) -> Result<String, String>

Source

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.

Source

pub fn verify_agent(&self, public_key: &str) -> Result<bool, String>

Verify that an agent has a valid signed registration and is active.

Source

pub fn list_agents(&self) -> Result<String, String>

List registered agents and the validity of their registration receipts.

Source

pub fn get_agent(&self, public_key: &str) -> Result<String, String>

Get a single registered agent.

Source

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.

Source

pub fn revoke_agent( &self, public_key: &str, reason: &str, ) -> Result<String, String>

Revoke an active identity key and invalidate its unconsumed permits.

Source

pub fn list_identity_events(&self) -> Result<String, String>

List signed rotation and revocation events.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn get_trace(&self, action_id: &str) -> Result<String, String>

Return the authorization and optional execution receipt for an action.

Source

pub fn verify_trace(&self, action_id: &str) -> Result<String, String>

Cryptographically verify an action trace end to end.

Source

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.

Source

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.

Source

pub fn install_policy(&self, policy_spec: &str) -> Result<String, String>

Install and activate a deterministic policy bundle signed by the gate.

Source

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.

Source

pub fn list_policies(&self) -> Result<String, String>

List active and retired policy bundles.

Source

pub fn signer_conformance(&self) -> Result<String, String>

Exercise the configured local or remote signer with an offline-verifiable fixture.

Source

pub fn create_checkpoint(&self, tenant_id: &str) -> Result<String, String>

Source

pub fn export_event_stream( &self, tenant_id: &str, from_sequence: u64, limit: u32, ) -> Result<String, String>

Source

pub fn verify_checkpoint_stream( &self, checkpoint_json: &str, stream_json: &str, expected_public_key: Option<&str>, ) -> Result<String, String>

Trait Implementations§

Source§

impl StorageLayer for SqliteStorage

Available on non-WebAssembly only.
Source§

fn insert_decision( &mut self, payload: &str, rules: &str, genesis: bool, ) -> Result<(), String>

Source§

fn insert_decision_batch( &mut self, decisions: Vec<(&str, &str)>, genesis: bool, ) -> Result<(), String>

Source§

fn get_latest_hash(&self) -> Result<String, String>

Source§

fn export_ledger(&self) -> Result<String, String>

Source§

fn list_decisions(&self, limit: u32, offset: u32) -> Result<String, String>

Source§

fn count_decisions(&self) -> Result<u64, String>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V