Documentation
¶
Overview ¶
Package garm embeds the contract this repository publishes.
The annotations are vendored into a consumer's tree by `garm init` rather than fetched from a registry. That is deliberate: a registry is one more thing an enterprise build has to be allowed to reach, and the annotations are small, stable, and worth reading by the people writing tool schemas against them.
The bytes here are the same bytes `garm init` writes, verbatim and with no added header, so a later drift check is a byte comparison rather than a parse.
Index ¶
Constants ¶
const AnnotationSchemaVersion = 1
AnnotationSchemaVersion is the version of the garm.tool.v1 vocabulary this build speaks, stamped into every catalogue it produces.
A daemon reads the current version and the two previous and refuses anything outside that window at boot. It is an integer rather than a semver because the only question asked of it is "can this binary read that catalogue", and a range check wants a number.
Bump it when a change to the annotations means an older daemon would misread a declaration — not when a field is added that an older daemon can safely ignore.
const VendoredAgentAnnotationsPath = "third_party/proto/garm/agent/v1/agent.proto"
VendoredAgentAnnotationsPath is where AgentAnnotationsProto belongs in a consumer's tree.
The same third_party module as the tool annotations, for the same reason: every module in a buf v2 workspace is an input, so annotations under proto/ would have Go generated for them, and two packages registering one proto file panic at init. The tail of the path is part of the contract — an import of "garm/agent/v1/agent.proto" has to resolve.
const VendoredAnnotationsPath = "third_party/proto/garm/tool/v1/tool.proto"
VendoredAnnotationsPath is where AnnotationsProto belongs in a consumer's tree.
Under third_party rather than beside your own protos, and that is not cosmetic: every module in a buf v2 workspace is an input, so annotations living under proto/ get Go generated for them — output that is never usable, because the real one is in this module's contracts package and two packages registering one proto file panic at init.
The tail of the path is part of the contract: an import of "garm/tool/v1/tool.proto" has to resolve, so only the root is a choice.
Variables ¶
var AgentAnnotationsProto []byte
AgentAnnotationsProto is proto/garm/agent/v1/agent.proto, exactly as published.
var AnnotationsProto []byte
AnnotationsProto is proto/garm/tool/v1/tool.proto, exactly as published.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
garm
command
Command garm is the garm command line tool: it scaffolds a proto tree, compiles governed tool declarations, and refuses the bad ones.
|
Command garm is the garm command line tool: it scaffolds a proto tree, compiles governed tool declarations, and refuses the bad ones. |
|
protoc-gen-garm-go
command
Command protoc-gen-garm-go is the garm tool generator for Go, in the shape protoc and buf expect to find it: a standalone binary named protoc-gen-<name>, discoverable on PATH.
|
Command protoc-gen-garm-go is the garm tool generator for Go, in the shape protoc and buf expect to find it: a standalone binary named protoc-gen-<name>, discoverable on PATH. |
|
Package contracts is the root of garm's generated tool contracts.
|
Package contracts is the root of garm's generated tool contracts. |
|
audit
Package audit is the durable, separately-retained half of the record.
|
Package audit is the durable, separately-retained half of the record. |
|
callctx
Package callctx encodes the InvocationContext for the NATS hop.
|
Package callctx encodes the InvocationContext for the NATS hop. |
|
grant
Package grant computes what a human approved.
|
Package grant computes what a human approved. |
|
ledger
Package ledger is the shape of a governed call's record.
|
Package ledger is the shape of a governed call's record. |
|
wire
Package wire is how a route becomes a NATS address.
|
Package wire is how a route becomes a NATS address. |
|
internal
|
|
|
claimscheck
Package claimscheck reads the vocabulary a claims policy references — the compartments and tool sets its roles grant — so a CI gate can compare that vocabulary against what a tool catalogue declares.
|
Package claimscheck reads the vocabulary a claims policy references — the compartments and tool sets its roles grant — so a CI gate can compare that vocabulary against what a tool catalogue declares. |
|
cli
Package cli holds the cobra conventions every garm binary shares.
|
Package cli holds the cobra conventions every garm binary shares. |
|
compile
Package compile turns proto source into descriptors, in process.
|
Package compile turns proto source into descriptors, in process. |
|
compiler
Package toolgen reads garm tool annotations off descriptors and validates them.
|
Package toolgen reads garm tool annotations off descriptors and validates them. |
|
plugin
Package plugin is the protoc plugin that emits garm tool bindings and fails the build on any error-level lint diagnostic.
|
Package plugin is the protoc plugin that emits garm tool bindings and fails the build on any error-level lint diagnostic. |
|
policydiff
Package policydiff reports what changed about POLICY between two catalogues, and which direction it moved.
|
Package policydiff reports what changed about POLICY between two catalogues, and which direction it moved. |
|
Package toolpolicy resolves what a principal may see, from annotations on the schema.
|
Package toolpolicy resolves what a principal may see, from annotations on the schema. |
|
redact
Package redact turns a denied field value into what the caller may see.
|
Package redact turns a denied field value into what the caller may see. |