Skip to content

handler

Structs

Enums


Enum

CONNECT-specific decision surface used by the HTTP proxy interceptor.

Variants:

  • Allow - CONNECT target is allowed and tunneling may proceed.
  • Deny{ reason: firma_core::DenyReason, detail: String } - CONNECT target is denied before tunnel establishment.
  • Abort{ reason: firma_core::AbortReason, detail: String } - CONNECT target was authorized, then blocked by a post-ALLOW abort.

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result

Enum

Structural context of a denial.

Derived from the NormalizedEnvelope carried on [EnforcementDecision::Deny]. Interceptors select the transport response shape from this value without re-inspecting the envelope.

See FEP §5.1–§5.2 for the behavioural contract:

  • Tool: agent loop continues; body is a structured tool result.
  • Api: synchronous terminal failure; body is the canonical deny JSON (HTTP 403 for HTTP interceptors).

Variants:

  • Tool - Denial originated from a tool-call transport.
  • Api - Denial originated from an API-class transport (HTTP, DB, etc.)

Traits: Eq, Copy

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • PartialEq
    • fn eq(self: &Self, other: &DenialContext) -> bool
  • Clone
    • fn clone(self: &Self) -> DenialContext

firma_sidecar::handler::DispatchedResponse

Section titled “firma_sidecar::handler::DispatchedResponse”

Struct

Response returned by the current raw-forward placeholder.

Traits: Eq

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Clone
    • fn clone(self: &Self) -> DispatchedResponse
  • PartialEq
    • fn eq(self: &Self, other: &DispatchedResponse) -> bool

Enum

Response produced by the transport-agnostic request handler.

Variants:

  • Ok(DispatchedResponse) - Request was allowed and the target replied.
  • Passthrough(DispatchedResponse) - Non-protected request was forwarded without enforcement.
  • Deny{ reason: firma_core::DenyReason, detail: String, context: DenialContext } - Request was blocked before dispatch.
  • Aborted{ reason: firma_core::AbortReason, detail: String } - Request was approved by enforcement but the dispatch could not

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result

Struct

Shared handler used by every interceptor.

Methods:

  • fn new(pipeline: Arc<EnforcementPipeline>, connector_registry: Arc<ConnectorRegistry>, audit_sink_sender: mpsc::Sender<AuditPayload>) -> Self - Constructs a request handler from the enforcement pipeline, the
  • fn with_max_decompressed_body_bytes(self: Self, max_decompressed_body_bytes: usize) -> Self - Overrides the cap on decompressed request/response body size (see
  • fn with_gateway_client(self: Self, gc: GatewayClient) -> Self - Enable secret placeholder rehydration via the firma-run secret gateway.
  • fn with_http_secret_providers(self: Self, providers: Vec<HttpIntegrationSpec<CompiledMatcher>>) -> Self - Enable HTTP-origin secret interception for the given providers (the
  • fn with_composio_catalogs(self: Self, catalogs: Arc<ComposioCatalogs>) -> Self - Install validated pinned Composio catalogs.
  • fn handle(self: &Self, request: RawRequest, session_id: &str) -> HandledResponse - Handles one normalized transport request.
  • fn authorize_upgrade(self: &Self, request: RawRequest, session_id: &str) -> UpgradeAuthorization - Authorizes an HTTP upgrade request without dispatching via the connector

firma_sidecar::handler::UpgradeAuthorization

Section titled “firma_sidecar::handler::UpgradeAuthorization”

Enum

Authorization result for HTTP upgrade requests (for example WebSocket handshakes) where the interceptor owns upstream byte relay.

Variants:

  • Allow{ credentials: firma_core::InjectedCredentials, audit_payload: Box<crate::audit::AuditPayload> } - Upgrade request is authorized. The interceptor must complete upstream
  • Deny{ reason: firma_core::DenyReason, detail: String } - Upgrade request denied by policy pipeline.
  • Abort{ reason: firma_core::AbortReason, detail: String } - Upgrade request blocked by a post-ALLOW abort.

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result