pub struct HttpReceipt {Show 16 fields
pub id: String,
pub request_id: String,
pub route_pattern: String,
pub method: HttpMethod,
pub caller_identity_hash: String,
pub session_id: Option<String>,
pub verdict: Verdict,
pub evidence: Vec<GuardEvidence>,
pub response_status: u16,
pub timestamp: u64,
pub content_hash: String,
pub policy_hash: String,
pub capability_id: Option<String>,
pub metadata: Option<Value>,
pub kernel_key: PublicKey,
pub signature: Signature,
}Expand description
Signed receipt for an HTTP request evaluation. Binds the request identity, route, method, verdict, and guard evidence under an Ed25519 signature from the kernel.
Fields§
§id: StringUnique receipt ID (UUIDv7 recommended).
request_id: StringUnique request ID this receipt covers.
route_pattern: StringThe matched route pattern (e.g., “/pets/{petId}”).
method: HttpMethodHTTP method of the evaluated request.
caller_identity_hash: StringSHA-256 hash of the caller identity.
session_id: Option<String>Session ID the request belonged to.
verdict: VerdictThe kernel’s verdict.
evidence: Vec<GuardEvidence>Per-guard evidence collected during evaluation.
response_status: u16HTTP status Chio associated with the evaluation outcome at receipt-signing time.
For deny receipts this is the concrete error status Chio will emit. For allow receipts produced before an upstream or inner response exists, this is evaluation-time status metadata rather than guaranteed downstream response evidence.
timestamp: u64Unix timestamp (seconds) when the receipt was created.
content_hash: StringSHA-256 hash binding the request content to this receipt.
policy_hash: StringSHA-256 hash of the policy that was applied.
capability_id: Option<String>Capability ID that was exercised, if any.
metadata: Option<Value>Optional metadata for extensibility.
kernel_key: PublicKeyThe kernel’s public key (for verification without out-of-band lookup).
signature: SignatureEd25519 signature over canonical JSON of the body fields.
Implementations§
Source§impl HttpReceipt
impl HttpReceipt
Sourcepub fn sign(body: HttpReceiptBody, keypair: &Keypair) -> Result<Self>
pub fn sign(body: HttpReceiptBody, keypair: &Keypair) -> Result<Self>
Sign a receipt body with the kernel’s keypair.
Sourcepub fn body(&self) -> HttpReceiptBody
pub fn body(&self) -> HttpReceiptBody
Extract the body for re-verification.
Sourcepub fn verify_signature(&self) -> Result<bool>
pub fn verify_signature(&self) -> Result<bool>
Verify the receipt signature against the embedded kernel key.
Sourcepub fn is_allowed(&self) -> bool
pub fn is_allowed(&self) -> bool
Whether this receipt records an allow verdict.
Sourcepub fn to_chio_receipt_with_keypair(
&self,
keypair: &Keypair,
) -> Result<ChioReceipt>
pub fn to_chio_receipt_with_keypair( &self, keypair: &Keypair, ) -> Result<ChioReceipt>
Convert this HTTP receipt into a signed core ChioReceipt for unified storage.
Sourcepub fn to_chio_receipt(&self) -> Result<ChioReceipt>
pub fn to_chio_receipt(&self) -> Result<ChioReceipt>
Convert this HTTP receipt into a core ChioReceipt for unified storage.
This method fails closed because a valid ChioReceipt signature cannot be derived from an HttpReceipt without the kernel signing keypair.
Trait Implementations§
Source§impl Clone for HttpReceipt
impl Clone for HttpReceipt
Source§fn clone(&self) -> HttpReceipt
fn clone(&self) -> HttpReceipt
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more