Documentation
¶
Overview ¶
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Code generated by scripts/generate/main.go. DO NOT EDIT.
Index ¶
- Variables
- func ApplyContextCommandDefaults(parent *cobra.Command, getClient ClientFactory)
- func ApplySurfaceDecisions(root *cobra.Command, decisions SurfaceDecisions)
- func CheckSnapshotComplete(snapshot, live []SurfaceEntry) error
- func CheckSurface(base, live []SurfaceEntry, decisions SurfaceDecisions) error
- func FormatSurface(entries []SurfaceEntry) string
- func PreservesRuntimeUsage(cmd *cobra.Command) bool
- func RegisterAPICommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterBughuntSubcommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterContextPushCommand(parent *cobra.Command, getClient ClientFactory)
- func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterDepsAnalyzeCommand(parent *cobra.Command, getClient ClientFactory)
- func RegisterFindingsCommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterPentestSubcommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterScanFileCommand(parent *cobra.Command)
- func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory)
- func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory)
- func Route(cmd *cobra.Command) string
- type ClientFactory
- type MovedCommand
- type RemovedCommand
- type RetiredFlag
- type SurfaceDecisions
- type SurfaceEntry
- type Verdict
Constants ¶
This section is empty.
Variables ¶
var ( ErrCommandDisappeared = errors.New("command disappeared without a recorded decision") ErrFlagDisappeared = errors.New("flag disappeared without a recorded decision") ErrArgsChanged = errors.New("positional arguments changed") ErrRouteChanged = errors.New("route changed without a recorded move") ErrNotInSnapshot = errors.New("command is not in the snapshot") )
Errors for a change to the command surface with no recorded decision.
var Decisions = SurfaceDecisions{ Moved: []MovedCommand{ {From: "nullify api asset-graph list-reachability", To: "nullify api context list-reachability"}, {From: "nullify api asset-graph list-search", To: "nullify api context list-search"}, {From: "nullify api asset-graph list-subgraph", To: "nullify api context list-subgraph"}, {From: "nullify api asset-graph list-summary", To: "nullify api context list-asset-graph-summary"}, {From: "nullify api infrastructure list-graphs", To: "nullify api context list-graphs"}, {From: "nullify api infrastructure list-info", To: "nullify api context list-info"}, {From: "nullify api infrastructure list-summary", To: "nullify api context list-infrastructure-graphs-summary"}, {From: "nullify api infrastructure get-graphs", To: "nullify api context get-graphs"}, {From: "nullify api infrastructure get-download", To: "nullify api context get-download"}, {From: "nullify api infrastructure get-graphs-versions", To: "nullify api context get-infrastructure-graphs-versions"}, {From: "nullify api infrastructure get-graphs-versions-2", To: "nullify api context get-infrastructure-graphs-versions-2"}, }, RemovedCommands: []RemovedCommand{ {Command: "nullify api admin create-initialize", Route: "POST /admin/repositories/initialize", Evidence: "#15172 deleted legacy repository enrollment; use update-repositories-scan-scope"}, {Command: "nullify api admin create-uninitialize", Route: "POST /admin/repositories/uninitialize", Evidence: "#15172 deleted legacy repository enrollment; use update-repositories-scan-scope"}, {Command: "nullify api context list-cloud-accounts", Route: "GET /context/asset-inventory/cloud-accounts", Evidence: "#2758 replaced this with per-category inventory (nullify api context list-asset-inventory), with a different response"}, {Command: "nullify api context list-cloud-resources", Route: "GET /context/asset-inventory/cloud-resources", Evidence: "#2758 replaced this with list-asset-inventory, with a different response"}, {Command: "nullify api context list-public-facing", Route: "GET /context/asset-inventory/public-facing", Evidence: "#2758 replaced this with list-public, with a different response"}, {Command: "nullify api context list-resources", Route: "GET /context/asset-inventory/resources", Evidence: "#2758 replaced this with list-asset-inventory, with a different response"}, {Command: "nullify api cspm get-diff", Route: "GET /cspm/findings/{findingId}/autofix/cache/diff", Evidence: "#12577 removed the CSPM fix cache; use get-state"}, {Command: "nullify api manager create-credits", Route: "POST /manager/credits", Evidence: "#13015 removed the legacy credits system"}, {Command: "nullify api manager list-credits", Route: "GET /manager/credits", Evidence: "#13015 removed the legacy credits system"}, {Command: "nullify api manager delete-customer-questions", Route: "DELETE /manager/customer-questions", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, {Command: "nullify api manager delete-customer-questions-2", Route: "DELETE /manager/customer-questions/{questionSetId}", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, {Command: "nullify api manager delete-questions", Route: "DELETE /manager/customer-questions/{questionSetId}/questions/{questionId}", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, {Command: "nullify api manager get-customer-questions", Route: "GET /manager/customer-questions/{questionSetId}", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, {Command: "nullify api manager list-customer-questions", Route: "GET /manager/customer-questions", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, {Command: "nullify api manager patch-answers", Route: "PATCH /manager/customer-questions/{questionSetId}/answers/{questionId}", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, {Command: "nullify api manager list-escalations", Route: "GET /manager/escalations", Evidence: "#5596 replaced escalations with action items; use list-action-items"}, {Command: "nullify api manager patch-escalations", Route: "PATCH /manager/escalations/{escalationId}", Evidence: "#5596 replaced escalations with action items; use list-action-items"}, {Command: "nullify api orchestrator create-complete", Route: "POST /orchestrator/onboarding/complete", Evidence: "the route registers only when running locally, so it can only 404 in a deployed stack"}, {Command: "nullify api sca get-sbom", Route: "GET /sca/repositories/{repositoryId}/sbom", Evidence: "#13504 moved SBOMs to context; use nullify sbom get or nullify api context get-sboms-repository-latest"}, {Command: "nullify api scpm create-cache-by-id", Route: "POST /scpm/findings/{findingId}/autofix/cache", Evidence: "#12580 retired the SCPM fix cache"}, {Command: "nullify api scpm create-create_pr-by-id", Route: "POST /scpm/findings/{findingId}/autofix/cache/create_pr", Evidence: "#12580 retired the SCPM fix cache"}, {Command: "nullify api scpm get-diff", Route: "GET /scpm/findings/{findingId}/autofix/cache/diff", Evidence: "#12580 retired the SCPM fix cache; use get-state"}, {Command: "nullify api scpm create-retriage", Route: "POST /scpm/findings/retriage", Evidence: "#5479 moved retriage to orchestrator create-retriage, with a different request body"}, {Command: "nullify api scpm list-dependencies", Route: "GET /scpm/dependencies", Evidence: "#13491 cut the SCPM schema to the SAST shape; use create-dependencies-analyze or create-batch"}, {Command: "nullify pentest get-pentest-findings-autofix-cache-diff", Route: "GET /dast/pentest/findings/{findingId}/autofix/cache/diff", Evidence: "#12688 removed retired DAST previews; use get-state"}, }, RetiredFlags: []RetiredFlag{ {Command: "nullify api asset-graph list-reachability", Flag: "account-id", Evidence: "GET /context/asset-graph/reachability has no account filter; the flag has no effect"}, {Command: "nullify api asset-graph list-subgraph", Flag: "account-id", Evidence: "GET /context/asset-graph/subgraph has no account filter; the flag has no effect"}, {Command: "nullify api cspm list-scans", Flag: "region", Evidence: "GET /cspm/scans no longer filters by region; the flag has no effect"}, {Command: "nullify api cspm list-scans", Flag: "scan-type", Evidence: "GET /cspm/scans no longer filters by scan type; the flag has no effect"}, }, }
Decisions is the record of command surface changes for this CLI. Every row has passed review. The evidence for a removal names the monorepo change that took the route away.
Functions ¶
func ApplyContextCommandDefaults ¶ added in v0.16.5
func ApplyContextCommandDefaults(parent *cobra.Command, getClient ClientFactory)
ApplyContextCommandDefaults installs CLI-side opinionated defaults on top of the generated 'context' subcommand tree. Must be called after RegisterContextCommands.
func ApplySurfaceDecisions ¶ added in v0.27.0
func ApplySurfaceDecisions(root *cobra.Command, decisions SurfaceDecisions)
ApplySurfaceDecisions adds a deprecated alias for every moved command and a deprecated no-op flag for every retired flag. Call it after all other commands are registered. A row whose target is absent has no effect here, and the surface check then reports the missing command or flag.
func CheckSnapshotComplete ¶ added in v0.27.0
func CheckSnapshotComplete(snapshot, live []SurfaceEntry) error
CheckSnapshotComplete reports a live command that the snapshot does not list.
func CheckSurface ¶ added in v0.27.0
func CheckSurface(base, live []SurfaceEntry, decisions SurfaceDecisions) error
CheckSurface reports every change from base to live that breaks a script and has no recorded decision. A new command or flag is not a break.
func FormatSurface ¶ added in v0.27.0
func FormatSurface(entries []SurfaceEntry) string
FormatSurface renders entries as the tab-separated snapshot text.
func PreservesRuntimeUsage ¶ added in v0.25.1
PreservesRuntimeUsage reports whether runtime errors should include usage.
func RegisterAPICommands ¶ added in v0.27.0
func RegisterAPICommands(parent *cobra.Command, getClient ClientFactory)
RegisterAPICommands adds the generated command group of every service to parent.
func RegisterAdminCommands ¶
func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory)
func RegisterBughuntSubcommands ¶ added in v0.12.0
func RegisterBughuntSubcommands(parent *cobra.Command, getClient ClientFactory)
RegisterBughuntSubcommands adds generated DAST API subcommands that relate to bughunt functionality to the handwritten bughunt command.
func RegisterContextCommands ¶ added in v0.14.0
func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory)
func RegisterContextPushCommand ¶ added in v0.15.1
func RegisterContextPushCommand(parent *cobra.Command, getClient ClientFactory)
RegisterContextPushCommand adds the 'push' subcommand to the existing 'context' command. Must be called after RegisterContextCommands.
func RegisterCspmCommands ¶
func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory)
func RegisterDastCommands ¶
func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory)
func RegisterDepsAnalyzeCommand ¶ added in v0.24.0
func RegisterDepsAnalyzeCommand(parent *cobra.Command, getClient ClientFactory)
RegisterDepsAnalyzeCommand attaches `deps analyze` to the given parent command. api.Client is reused for auth (BaseURL + Token) — even though the scpm calls aren't in the generated surface yet, credentials and host come from the same source as every other nullify command.
func RegisterFindingsCommands ¶ added in v0.27.0
func RegisterFindingsCommands(parent *cobra.Command, getClient ClientFactory)
func RegisterManagerCommands ¶
func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory)
func RegisterOrchestratorCommands ¶
func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory)
func RegisterPentestSubcommands ¶ added in v0.12.0
func RegisterPentestSubcommands(parent *cobra.Command, getClient ClientFactory)
RegisterPentestSubcommands adds generated DAST API subcommands that relate to pentest functionality to the handwritten pentest command.
func RegisterSastCommands ¶
func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory)
func RegisterScaCommands ¶
func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory)
func RegisterScanFileCommand ¶ added in v0.27.0
RegisterScanFileCommand adds a local secret scan command to parent.
func RegisterScpmCommands ¶ added in v0.18.0
func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory)
func RegisterSecretsCommands ¶
func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory)
Types ¶
type ClientFactory ¶ added in v0.25.1
ClientFactory creates an authenticated API client for a command context.
type MovedCommand ¶ added in v0.27.0
MovedCommand records a command whose API route moved. The old name stays as a deprecated alias that calls the new route.
type RemovedCommand ¶ added in v0.27.0
RemovedCommand records a command whose route the API no longer serves.
type RetiredFlag ¶ added in v0.27.0
RetiredFlag records a flag whose query parameter the API no longer accepts. The flag stays accepted with a deprecation notice, so a script that passes it still runs, and it has no effect.
type SurfaceDecisions ¶ added in v0.27.0
type SurfaceDecisions struct {
Moved []MovedCommand
RemovedCommands []RemovedCommand
RetiredFlags []RetiredFlag
}
SurfaceDecisions is the record of every approved change to the command surface.
type SurfaceEntry ¶ added in v0.27.0
SurfaceEntry is one line of the command surface snapshot.
func ParseSurface ¶ added in v0.27.0
func ParseSurface(text string) ([]SurfaceEntry, error)
ParseSurface reads the snapshot text.
func Surface ¶ added in v0.27.0
func Surface(root *cobra.Command) []SurfaceEntry
Surface walks a command tree and returns every command, sorted by path.
type Verdict ¶ added in v0.24.0
type Verdict string
Verdict is a dependency malware-analysis verdict as returned by vuln-database (passed through scpm). The recognised set is below; any other non-empty verdict is treated as unknown and fails closed (see classifyVerdict) so a server-side rename can't silently bypass the gate.