FastMesh is an embeddable Go SDK for authenticated TCP, HTTP and gRPC between services. Controllers distribute signed authorization and discovery plans; application traffic travels directly between Nodes.
The next release is v0.1.0, with one plan contract: fastmesh.plan.v1.
This checkout is the source of truth. Use the Go toolchain declared in go.mod.
FastMesh fits Go services that can explicitly integrate a communication SDK. It provides SPIFFE mTLS, service discovery, publication and consumption permissions, and local recovery of signed policy. Applications communicate directly; the Controller coordinates enrollment, endpoint leases and policy updates.
Host configuration → Controller → signed plan → Node verification + durable apply
↓
application ↔ mTLS ↔ application
Nodes verify the original signed bytes, recipient, expiry and revision before publishing execution state. Restart recovery reauthenticates saved policy and preserves its original deadlines. A disconnected Node can use valid last-good policy; expired policy cannot authorize new connections or HTTP/gRPC requests. Established raw TCP connections are not reauthorized on every read or write; policy updates reconcile their owner permissions.
| Capability | Current behavior |
|---|---|
| TCP | Authenticated direct connections, endpoint selection and circuit breaking |
| HTTP | Per-request method/path authorization, including segment-aware prefixes |
| gRPC | Method authorization for unary and streaming RPCs |
| Discovery | Complete signed plans, ACK/NACK, endpoint leases and reconnect backoff |
| Storage | Memory for volatile state; exclusively owned file store for one Controller; shared etcd for HA |
| Observability | Status and observer hooks; applications supply exporters |
The mesh uses fastmesh.plan.v1. Its ADS-style API is a project-specific contract;
mesh delta responses still carry complete signed plans. The node and controller
production package dependency graphs do not include etcd; the backend is selected
by the host. The root Go module currently includes the etcd adapter and its tests.
Enrollment commits the token use, complete Node and retry result atomically. When enrolling with an existing certificate, Nodes persist a request ID before registration so they can recover the same active Node while the token remains valid. The signed plan body is limited to 3 MiB, the complete mesh protobuf response to 4 MiB, and decoded local snapshot/journal JSON to 64 MiB. Oversized plans fail closed; existing last-good policy keeps its original expiry. Compiler cache retention defaults to 64 MiB of serialized topology; this is not a process memory limit.
GOWORK=off go build -o /tmp/fastmesh-config ./examples/app-config
/tmp/fastmesh-config -role setup -dir /tmp/fastmesh-demo
/tmp/fastmesh-config -role controller -dir /tmp/fastmesh-demo/controllerAfter controller-ready, deliver the token and start the separate config server in another terminal:
cp /tmp/fastmesh-demo/controller/join-token /tmp/fastmesh-demo/config-server/join-token
cp /tmp/fastmesh-demo/controller/join-token /tmp/fastmesh-demo/app-1/join-token
cp /tmp/fastmesh-demo/controller/join-token /tmp/fastmesh-demo/app-2/join-token
/tmp/fastmesh-config -role config-server -dir /tmp/fastmesh-demo/config-serverWait for config-server-ready, then run each app in its own terminal:
/tmp/fastmesh-config -role app -name app-1 -dir /tmp/fastmesh-demo/app-1 -http 127.0.0.1:8081
/tmp/fastmesh-config -role app -name app-2 -dir /tmp/fastmesh-demo/app-2 -http 127.0.0.1:8082
curl -fsS http://127.0.0.1:8081/configSetup requires a new directory and creates four independent deployment directories with demo credentials valid for 24 hours.
See the configuration example for updates and deployment.
After the release tag is published, applications can install it with
go get github.com/fastabc/fastmesh@v0.1.0.
- On the Controller, enable
controller.WithEnrollmentwith a trusted SVID issuer and mountEnrollmentHandler()on the host application's HTTPS server. - On the active Controller, call
CreateEnrollmentTokenwith the Node name, tenant and SPIFFE workload ID. The single-use token defaults to a 15-minute lifetime. - On the new host, pass the enrollment HTTPS URL and token to
node.Join. The Node generates and stores its private key locally. The Controller verifies the certificate signing request, registers the Node, and returns its SVID, mesh trust bundle and Controller settings.
cfg, err := node.Join(ctx, node.EnrollmentOptions{
URL: "https://control.example.org/mesh/enroll",
Token: token,
StateDir: stateDir,
})
if err != nil {
return err
}Use the same state directory when retrying a lost response. The original key
recovers the committed Node while the token is valid. After joining, call
node.Join with only StateDir to reload the saved configuration on restart.
The application schedules node.RenewEnrollment before the SVID expires.
Renewal uses the current SVID and requires no token.
Controller and HTTPS setup
For deployments with preprovisioned credentials, construct node.Config with
the SPIFFE identity source, Controller addresses and identity allowlist, trust
domain, tenant, join token and exclusive state directory.
Call node.New with the configuration, then Start to connect over SPIFFE mTLS
and apply a signed plan. Bind a service with Listen, HTTPHandler or
NewGRPCServer; clients use Dial, HTTPClient or GRPCDialOptions. Always call Close.
The Controller owns Services, BindGrants, ServiceAccess rules and WorkloadGroups.
Providers register independent Endpoint leases through the authenticated Catalog API.
Close client idle connections when finished, and close a shared identity Source
after the Nodes using it have stopped. Observer callbacks must return promptly.
| Goal | Guide |
|---|---|
| Example overview | Independent deployment directories |
| HTTP service calls | Orders and payments |
| gRPC methods | gRPC |
| Application configuration | App configuration |
| Observer hooks | Observability example |
| SDK configuration and ownership | Integration |
| Runtime and package boundaries | Architecture |
| Trust, authorization and recovery | Security |
| Wire contracts and generation | API |
| Local and CI checks | Testing |
| Release criteria | v0.1.0 |
FastMesh requires explicit Go SDK integration. It provides method/path HTTP predicates, including segment-aware prefixes; it does not provide header/query/body predicates or transparent interception. Controller HA uses shared etcd. Memory is volatile; file storage has a single exclusive owner. Applications own business configuration validation, persistence and rollout acknowledgements. SDK upgrades ship with applications. Transparent cross-language interception, general traffic routing and header/query/body policy are outside the current scope. Deployment checks are in the testing guide. Release criteria are in the release guide.
GOWORK=off go test ./...
GOWORK=off go test -race ./...
GOWORK=off go vet ./...
python3 test/smoke/examples.pySee testing for the required real-etcd and fuzz checks.