feat: Fir-429 Broker dispatch, accept loop, and secret_providers config - #625
Merged
Conversation
nappa85
force-pushed
the
fir-429-v2/10-run-dispatch-config
branch
13 times, most recently
from
September 3, 2026 08:14
0614c53 to
2ba7945
Compare
added 11 commits
September 3, 2026 10:14
LukeMathWalker
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The pieces from PR08/09 (dictionary, broker transport, gateway, intercept,
shim client) are all standalone modules; this PR is where firma-run's
config layer learns to parse a
secret_providerstable and where thebroker gets an actual accept/serve loop turning shim connections into real
subprocess launches. Sandbox mounting/injection is deliberately deferred to
PR11 so this stays reviewable as "config + dispatch logic" without sandbox
concerns mixed in.
What Changed
crates/firma-run/src/config.rs:ResolvedProfile.secret_providers: BTreeMap<String, IntegrationSpec>—CLI vaults keyed by binary basename, HTTP vaults keyed by
provider_id; merged across[run.defaults]and the active profile,later entries winning (profile overrides defaults, custom overrides
built-in). Presence in this map is itself the authorization to
intercept — no separate Cedar check.
DEFAULT_SIDECAR_ENDPOINT: nowunix:///tmp/sidecar.sockon Unix(was
tcp://127.0.0.1:8080unconditionally) — cfg-gated perAGENTS.md's Unix/Windows platform-support rule.SecretMatcherConfig— TOML-friendly mirror offirma_core::SecretMatcherwith an explicit
typetag.SecretProviderSpec(Cli/Http, explicitly tagged rather thanuntagged, so a CLI-only field like
namecan never leak onto an HTTPentry) and
SecretProviderPatchfor merging.resolve_secret_providers: resolves the merged table intoIntegrationSpecvalues, looking up built-ins by name and validatingcustom matcher specs.
crates/firma-run/src/secret/accept.rs(new): the broker's accept loop— accepts shim connections from
BrokerListenerand serves eachsynchronously via
serve::serve_request. A binary only reaches thisloop because it matched a configured
secret_providersentry, so noseparate authorization decision happens here.
crates/firma-run/src/secret/serve.rs(new): per-request dispatch —turns one shim request into an actual vault CLI subprocess execution
plus the
intercepttransform (PR09), applying the integration spec'scredential env vars and extractor.
crates/firma-run/src/{routing.rs, runtime.rs, sidecar/config.rs, sidecar/supervisor.rs}: threadsecret_gateway_addrandhttp_secret_providersthroughAutostartFlags/SynthesizeRequest/SpawnRequestso the autostarted Sidecar receives the mirrored HTTPvault config and gateway address (consumed by PR07's handler).
crates/firma-run/tests/integration/sidecar_autostart_*.rs,sidecar_config_merge.rs: updated for the new fields threaded above.Risks / Notes
accept/serverun subprocess execution with forwarded credential envvars outside the sandbox — this is the actual trust boundary of the
whole CLI-vault design; worth close review even though it's "just
dispatch."
DEFAULT_SIDECAR_ENDPOINT's platform split follows the repo's Unix/Windows-only support rule (no fallback path for other targets).
AI Assistance
Generated with AI (Claude Code); human-reviewed for correctness and scope.