Skip to content

handler

Structs

Enums

  • DefaultAction - Policy applied to every fresh local-exec request (no approval token).
  • LocalExecDecision - Outcome of a governance decision, serialized as a snake_case string on the wire.
  • ManagementOutcome - Outcome of a management operation, serialized as a snake_case string.

firma_sidecar::local_exec::handler::DefaultAction

Section titled “firma_sidecar::local_exec::handler::DefaultAction”

Enum

Policy applied to every fresh local-exec request (no approval token).

Variants:

  • Allow - Allow all executions unconditionally.
  • Deny - Deny all executions unconditionally.
  • PendingHitl - Require human approval via the HITL token flow.

Traits: Copy, Eq

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • PartialEq
    • fn eq(self: &Self, other: &DefaultAction) -> bool
  • Deserialize
    • fn deserialize<__D>(__deserializer: __D) -> _serde::__private228::Result<Self, <__D as >::Error>
  • Clone
    • fn clone(self: &Self) -> DefaultAction

firma_sidecar::local_exec::handler::LocalExecDecision

Section titled “firma_sidecar::local_exec::handler::LocalExecDecision”

Enum

Outcome of a governance decision, serialized as a snake_case string on the wire.

Variants:

  • Allow
  • Deny
  • PendingHitl

Traits: Eq, Copy

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • PartialEq
    • fn eq(self: &Self, other: &LocalExecDecision) -> bool
  • Serialize
    • fn serialize<__S>(self: &Self, __serializer: __S) -> _serde::__private228::Result<<__S as >::Ok, <__S as >::Error>
  • Clone
    • fn clone(self: &Self) -> LocalExecDecision
  • Deserialize
    • fn deserialize<__D>(__deserializer: __D) -> _serde::__private228::Result<Self, <__D as >::Error>

firma_sidecar::local_exec::handler::LocalExecHandler

Section titled “firma_sidecar::local_exec::handler::LocalExecHandler”

Struct

Stateful handler for local-exec governance and management requests.

Holds an Arc<dyn [TokenStore]> and is safe to share across connections. The default store is [InMemoryTokenStore]; alternative backends (Redis, distributed stores, test doubles) are injected via [LocalExecHandler::with_store].

Methods:

  • fn new(config: LocalExecHandlerConfig) -> Self - Build a handler using the default [InMemoryTokenStore].
  • fn with_store(config: LocalExecHandlerConfig, store: Arc<dyn TokenStore>) -> Self - Build a handler with a custom token store.
  • fn token_store(self: &Self) -> Arc<dyn TokenStore> - Return a shared reference to the token store.
  • fn decide(self: &Self, request: &LocalExecRequest) -> LocalExecResponse - Produce a governance decision for one local-exec request.
  • fn decide_management(self: &Self, request: &LocalExecManagementRequest) -> LocalExecManagementResponse - Process an operator management command (approve or revoke).

firma_sidecar::local_exec::handler::LocalExecHandlerConfig

Section titled “firma_sidecar::local_exec::handler::LocalExecHandlerConfig”

Struct

Construction arguments for [LocalExecHandler].

Fields:

  • default_action: DefaultAction
  • token_ttl: std::time::Duration - Time-to-live for issued approval tokens. Only used by
  • retry_after_ms: u64 - Suggested retry interval returned to firma-run in pending_hitl

firma_sidecar::local_exec::handler::LocalExecManagementRequest

Section titled “firma_sidecar::local_exec::handler::LocalExecManagementRequest”

Struct

JSON request sent by an operator (or firma token CLI) to approve or revoke a pending approval token.

Fields:

  • action: String - "local.exec.approve" or "local.exec.revoke".
  • token_id: String - Opaque token ID returned in the original pending_hitl response.

Trait Implementations:

  • Deserialize
    • fn deserialize<__D>(__deserializer: __D) -> _serde::__private228::Result<Self, <__D as >::Error>
  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Serialize
    • fn serialize<__S>(self: &Self, __serializer: __S) -> _serde::__private228::Result<<__S as >::Ok, <__S as >::Error>

firma_sidecar::local_exec::handler::LocalExecManagementResponse

Section titled “firma_sidecar::local_exec::handler::LocalExecManagementResponse”

Struct

JSON response sent back to the operator after a management command.

Fields:

  • outcome: ManagementOutcome
  • reason: Option<String>

Trait Implementations:

  • Deserialize
    • fn deserialize<__D>(__deserializer: __D) -> _serde::__private228::Result<Self, <__D as >::Error>
  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Serialize
    • fn serialize<__S>(self: &Self, __serializer: __S) -> _serde::__private228::Result<<__S as >::Ok, <__S as >::Error>

firma_sidecar::local_exec::handler::LocalExecRequest

Section titled “firma_sidecar::local_exec::handler::LocalExecRequest”

Struct

JSON request received from firma-run over the local-exec UDS endpoint.

Fields:

  • action: String
  • executable: String
  • args: Vec<String>
  • sandbox_id: String
  • session_id: String
  • agent_id: Option<String>
  • profile: String
  • hitl_mode: String
  • budget_state_ref: Option<String>
  • request_fingerprint: Option<String> - SHA-256 fingerprint computed by firma-run. The sidecar recomputes
  • approval_token: Option<String> - Present only on retry attempts — the token ID issued in a prior

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Serialize
    • fn serialize<__S>(self: &Self, __serializer: __S) -> _serde::__private228::Result<<__S as >::Ok, <__S as >::Error>
  • Deserialize
    • fn deserialize<__D>(__deserializer: __D) -> _serde::__private228::Result<Self, <__D as >::Error>

firma_sidecar::local_exec::handler::LocalExecResponse

Section titled “firma_sidecar::local_exec::handler::LocalExecResponse”

Struct

JSON response sent back to firma-run.

Fields:

  • decision: LocalExecDecision
  • reason: Option<String>
  • approval_token: Option<String>
  • retry_after_ms: Option<u64>

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Serialize
    • fn serialize<__S>(self: &Self, __serializer: __S) -> _serde::__private228::Result<<__S as >::Ok, <__S as >::Error>
  • Deserialize
    • fn deserialize<__D>(__deserializer: __D) -> _serde::__private228::Result<Self, <__D as >::Error>

firma_sidecar::local_exec::handler::ManagementOutcome

Section titled “firma_sidecar::local_exec::handler::ManagementOutcome”

Enum

Outcome of a management operation, serialized as a snake_case string.

Variants:

  • Ok
  • NotFound
  • AlreadyConsumed
  • AlreadyRevoked
  • Expired
  • UnsupportedAction

Traits: Copy, Eq

Trait Implementations:

  • PartialEq
    • fn eq(self: &Self, other: &ManagementOutcome) -> bool
  • Serialize
    • fn serialize<__S>(self: &Self, __serializer: __S) -> _serde::__private228::Result<<__S as >::Ok, <__S as >::Error>
  • Clone
    • fn clone(self: &Self) -> ManagementOutcome
  • Deserialize
    • fn deserialize<__D>(__deserializer: __D) -> _serde::__private228::Result<Self, <__D as >::Error>
  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result