Repository navigation
Description
Depends on: #2526 (the loader that hands definitions to the broker)
Problem
Agent definition names accept any YAML string that is non-blank after trimming:
- file definitions take the frontmatter
name:; - driver definitions apply the same rule.
So spaces, colons, slashes, Unicode, uppercase and names of any length are all accepted. The identity broker's registry accepts only definition names matching [A-Za-z0-9._-]+, at most 63 bytes, and not . or ... Invalid names are rejected, never rewritten.
The design leaves this open: "Legacy-name compatibility is also open" (implementation.md, "SPIFFE identifier construction").
Today, with the flag on, a session whose definition name fails the grammar cannot register its agent:
- at create, the failure is logged and ignored;
- at run entry, every run is refused with a generic
identity broker call failedinternal error, with nothing telling the user or operator that the name is the cause.
Design
Decision (make it when starting this ticket)
Question: what happens to a definition whose name does not fit the registry's name grammar?
- (a) Refuse. Keep the grammar. Refuse the definition at load, with an operator-facing error naming the definition and the rule. A session on it fails with a specific reason. Users rename. The grammar stays as it is.
- (b) Encode. Map a nonconforming name to a reversible conforming name, for example a reserved prefix plus an encoding. It must define how encoded names avoid colliding with real names that use the prefix, and the length after encoding.
- (c) Alias. A definition declares a separate identity name (a frontmatter field), used for registration when its display name does not fit.
Decide at the same time:
- whether the grammar check runs in the definition loader for every origin, so the problem shows up at load and not at first run.
Who decides: Chris, with the design's author.
Requirements
- Implement the decided behavior for file and driver origins.
- A registration that fails on the definition name maps to a specific reason, not a generic internal error.
- Record the decision in the design, replacing "Legacy-name compatibility is also open".
- Flag off: nothing changes.
How it fits
Agent SPIFFE IDs are opaque and carry no definition names, but registration still refuses a name outside the registry's grammar. Until this is decided, an operator definition whose name does not fit fails to register. Loosening the grammar later is additive. #2551 owns the related rule for two sources supplying the same category and name.
Done when
- The decision is in the design.
- A definition whose name fails the grammar gets the decided behavior, tested for file and driver origins.
- With the flag on, a session on such a definition fails with a specific reason that names the cause, or works under the decided mapping. It never fails with a generic internal error.
- With the flag off, nothing changes.
Activity
rdimitrov commentedon Nov 18, 2026
#2834 made agent SPIFFE IDs opaque, so definition names are no longer part of the ID, and the problem changes:
agent-definitions.md), not as ID grammar.driver,project, oruserdefinition, or a global one the loader dropped) is still refused at run entry with a generic internal error.Options (b) "encode" and (c) "alias" existed to protect the ID grammar, so they lose most of their reason. The decision becomes: keep the rule and make the refusal specific to the user and the operator, or relax the rule now that it is not ID grammar.
[-]Agent definition names outside the SPIFFE path grammar[/-][+]Agent definition names outside the registry's name grammar[/+]