Documentation
¶
Overview ¶
Package manifest loads and merges YAML command registries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SubcommandCommands = map[string]bool{ "docker": true, "kubectl": true, "svn": true, "systemctl": true, "aws": true, "abaqus": true, "apachectl": true, "openssl": true, }
SubcommandCommands identifies commands that use subcommand-style dispatch (e.g. "docker ps", "kubectl get"). Both the validator and server packages reference this map so they stay in sync.
Functions ¶
func LoadEmbedded ¶
Types ¶
type Manifest ¶
type Manifest struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Category string `yaml:"category"`
Timeout int `yaml:"timeout"`
Deny bool `yaml:"deny"`
Reason string `yaml:"reason"`
Flags []Flag `yaml:"flags"`
AllowsPathArgs bool `yaml:"allows_path_args"`
RestrictedPaths []string `yaml:"restricted_paths"`
Stdin bool `yaml:"stdin"`
Stdout bool `yaml:"stdout"`
RegexArgPosition *int `yaml:"regex_arg_position"`
Shell string `yaml:"shell"` // "powershell" or "" (bash)
RequiresOneOf []string `yaml:"requires_one_of"`
// PositionalAllowlist constrains one positional argument to a fixed set of
// values. Flag validation cannot reach tools that dispatch on a positional
// word rather than a flag -- jcmd's diagnostic command sits at positional 1
// (after the pid), and jcmd GC.run, VM.set_flag, and JVMTI.agent_load all
// change the target JVM. Without this, such a tool is all-or-nothing.
PositionalAllowlist *PositionalAllowlist `yaml:"positional_allowlist"`
// AllowsFlagBundling re-enables POSIX-style short-flag bundling for a
// manifest that declares shell: powershell. Native Windows executables
// (netstat, tracert, ping) run on a Windows host but use DOS-style bundled
// switches — `netstat -ano` is -a -n -o — whereas PowerShell cmdlets do not
// bundle at all and must not be split (`-Match` is one parameter, never
// -M -a -t -c -h). `shell: powershell` conflates "runs on Windows" with
// "uses PowerShell parameter conventions"; this field separates them.
AllowsFlagBundling bool `yaml:"allows_flag_bundling"`
// contains filtered or unexported fields
}
type ManifestError ¶
type ManifestError struct {
Message string
}
func (*ManifestError) Error ¶
func (e *ManifestError) Error() string
type PositionalAllowlist ¶ added in v0.9.4
PositionalAllowlist restricts the positional argument at Index (0-based, counting only non-flag arguments) to one of Values. Positional arguments at other indexes are unaffected, and an invocation with fewer positionals than Index is not constrained -- the tool itself rejects those.
func (*PositionalAllowlist) Allows ¶ added in v0.9.4
func (p *PositionalAllowlist) Allows(value string) bool
Allows reports whether value is permitted at the constrained position. Matching is case-sensitive: jcmd's diagnostic command names are.
Click to show internal directories.
Click to hide internal directories.