Repository navigation
Scaffold shared governance service for SendBox governed sessions - #1
Merged
Merged
Conversation
Tables for principals, projects, project roles, signed profile revisions, minimum revisions, sessions, credential grants, revocations, exceptions, and an append-only hash-chained audit log, with constraints for identifier grammar, bounded lifetimes, separation of duties, and grant-to-session identity binding.
Actix Web service binary sendbox-fleet with environment configuration, JSON logging to stdout and a daily-rotated log file with 30-day retention, health and readiness probes, and versioned /v1 routes. Every /v1 route requires a bearer token before routing, validates bodies against the pinned sendbox-governance contract, and returns an RFC 9457 501 problem naming the increment-2 capability.
Multi-stage Dockerfile with digest-pinned bases and a non-root runtime, compose stack with a health-checked PostgreSQL, and CI for formatting, Clippy, SQLite tests, PostgreSQL migrations plus a server smoke run, and cargo audit with documented exceptions.
Cargo.toml tracks sendbox main; Cargo.lock keeps the exact commit (9817251, the increment-1 merge). Dependabot moves the lockfile daily and an auto-merge workflow merges those updates once required CI passes. SECURITY.md now points to GitHub private vulnerability reporting.
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.
Summary
Scaffold for the shared governance service of SendBox governed sessions, increment 2 of sendbox-dev/sendbox#87 (authenticated multi-user management API, project-scoped roles, session admission, credential grants and revocation, expiring exceptions, central audit).
This is a scaffold: every
/v1endpoint returns501 Not Implemented. No governance decision is made yet, and the service must not be deployed as an authority. Provider credentials never reach this service; injection stays in the SendBox host broker.What is included
unsafe_code = "forbid",clippy::all = "deny". Cratecrates/fleet-server, binarysendbox-fleet.sendbox-governanceas a git dependency pinned tobd7498ab24c3c9cfd98f80349bee31fed667539b. Request and response bodies reuse the contract types (GovernanceBinding,GrantRequest,CredentialGrant,RequestContext,Decision,RevocationReason, identifiers,ProfileRef,GovernanceProfile::parse).FLEET_BIND,FLEET_DATABASE_URL,FLEET_LOG_DIR,FLEET_LOG_LEVEL,FLEET_LOG_RETENTION_DAYS), graceful shutdown on SIGINT/SIGTERM,GET /healthz,GET /readyz(database ping)./v1stubs:POST /v1/sessions:admit,POST /v1/grants,POST /v1/grants/{grant_id}:renew,POST /v1/grants/{grant_id}:revoke,POST /v1/authorize,GET/PUT /v1/profiles/{profile_id},GET/POST /v1/projects/{project_id}/roles,POST /v1/exceptions,GET /v1/audit/events. Order of checks: bearer authentication middleware (401) before routing, then contract validation (400), then RFC 9457application/problem+json501 with acapabilitymember. Identity headers are never treated as authentication; the production authenticator rejects every token withauthentication provider not configured.sendbox-fleet.YYYY-MM-DD.log(UTC daily rotation), retention of 30 days applied at startup and hourly, non-lossy bounded writer, no bodies, headers, or query strings logged.Dockerfile(digest-pinned bases, uid 10001),docker-compose.ymlwith a health-checked PostgreSQL (digest-pinned), read-only root filesystem, dropped capabilities,.env.example.-D warnings, tests on SQLite; PostgreSQL service job running the migration tests plus a server start, probe, and graceful stop;cargo audit. Actions pinned by commit SHA,permissions: contents: read, concurrency group.docs/architecture.md,docs/contract.md,docs/threat-model.md,docs/roadmap.md(work items mapped to the issue's acceptance criteria),docs/development.md, plusCONTRIBUTING.mdandSECURITY.md.Testing
cargo fmt --all -- --check,cargo clippy --locked --workspace --all-targets -- -D warnings,cargo test --locked --workspace(18 tests: config validation, bearer grammar, log retention boundaries, probes, 401 on every route, 501 with a mocked token, 400 for invalid contract bodies, transport errors, migrations and schema invariants).docker compose build --no-cacheanddocker compose upverified locally (see the note on Porto below).rust:1.93.1-slim-trixieLinux container against PostgreSQL 18.7: fmt, Clippy, SQLite tests, PostgreSQL migration tests, and the server start, probe, and graceful stop all passed, andcargo audit --deny warningspassed with cargo-audit 0.23.0. The workflow also passesactionlint.Known limitations and accepted risks
cargo auditignores two advisories, documented in.cargo/audit.toml:RUSTSEC-2026-0459(bundled SQLite older than 3.54, used only for local development and tests; the fix needs sqlx 0.9, which requires Rust 1.94) andRUSTSEC-2023-0071(rsa, present inCargo.lockonly and never compiled).mainonce that work merges.image: name:tag@sha256:...references (Porto stores the pulled image without its digest), so the local Compose run used a temporary tag-only override for PostgreSQL. Standard Docker and GitHub Actions resolve the pinned digest.Follow-ups