pub struct HttpReceipt {Show 23 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 receipt_kind: ReceiptKind,
pub boundary_class: BoundaryClass,
pub observation_outcome: Option<ObservationOutcome>,
pub tool_origin: ToolOrigin,
pub redaction_mode: RedactionMode,
pub actor_chain: Vec<ActorRef>,
pub evidence: Vec<GuardEvidence>,
pub response_status: u16,
pub timestamp: u64,
pub content_hash: String,
pub policy_hash: String,
pub trust_level: TrustLevel,
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: StringAuthoritative content-addressed receipt id.
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.
receipt_kind: ReceiptKindSigned semantic class for this HTTP receipt.
boundary_class: BoundaryClassSigned boundary class for this HTTP receipt.
observation_outcome: Option<ObservationOutcome>Observation outcome. Mediated HTTP receipts must omit this field.
tool_origin: ToolOriginWhere the protected effect executes relative to Chio.
redaction_mode: RedactionModeRedaction mode applied to signed receipt details.
actor_chain: Vec<ActorRef>Actor chain associated with the HTTP decision.
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.
trust_level: TrustLevelTrust level of the signed decision.
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 recompute_id(&self) -> Result<String>
pub fn recompute_id(&self) -> Result<String>
Recompute the content-addressed HTTP receipt id.
Sourcepub fn receipt_id_valid(&self) -> Result<bool>
pub fn receipt_id_valid(&self) -> Result<bool>
Whether this receipt id matches the canonical body fields.
Sourcepub fn is_allowed(&self) -> bool
pub fn is_allowed(&self) -> bool
Whether this receipt records an authoritative allow.
Whether this receipt is an authoritative Chio authorization.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HttpReceipt
impl Debug for HttpReceipt
Source§impl<'de> Deserialize<'de> for HttpReceipt
impl<'de> Deserialize<'de> for HttpReceipt
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for HttpReceipt
impl RefUnwindSafe for HttpReceipt
impl Send for HttpReceipt
impl Sync for HttpReceipt
impl Unpin for HttpReceipt
impl UnsafeUnpin for HttpReceipt
impl UnwindSafe for HttpReceipt
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more