Documentation
¶
Overview ¶
Package validate holds shared input checks for agent-supplied identifiers.
Index ¶
Constants ¶
const MaxNameLength = 50
MaxNameLength is the longest accepted name, in characters.
const MaxPathSegmentLength = 200
MaxPathSegmentLength bounds one path or object-key segment.
Variables ¶
This section is empty.
Functions ¶
func Name ¶
Name trims value and rejects it if empty, longer than MaxNameLength, or containing anything outside [a-zA-Z0-9_-]. It returns the trimmed value.
func PathSegment ¶
PathSegment rejects value if it could escape or corrupt the location it is interpolated into: empty, "." or "..", a path separator, a control character, or a leading dash that would read as a flag. It returns the trimmed value.
Distinct from Name deliberately. Name encodes the agent naming rules, which are stricter than safety requires and would reject a legitimate platform-generated identifier containing a dot or longer than 50 characters.
func SanitizeName ¶
SanitizeName coerces value into a valid Name: first dot-separated label, unsupported runs collapsed to "-", dashes trimmed, truncated to MaxNameLength. Returns "" when nothing usable remains.
Types ¶
This section is empty.