up the blokcing tasks
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Manifest Integrity / Validate Schema Integrity (push) Has been cancelled
Manifest Integrity / Validate Contract Documents (push) Has been cancelled
Manifest Integrity / Validate Pack Fixtures (push) Has been cancelled
Manifest Integrity / Audit SHA256SUMS Files (push) Has been cancelled
Manifest Integrity / Verify Merkle Roots (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Risk Bundle CI / risk-bundle-build (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Risk Bundle CI / risk-bundle-offline-kit (push) Has been cancelled
Risk Bundle CI / publish-checksums (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
devportal-offline / build-offline (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Manifest Integrity / Validate Schema Integrity (push) Has been cancelled
Manifest Integrity / Validate Contract Documents (push) Has been cancelled
Manifest Integrity / Validate Pack Fixtures (push) Has been cancelled
Manifest Integrity / Audit SHA256SUMS Files (push) Has been cancelled
Manifest Integrity / Verify Merkle Roots (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Risk Bundle CI / risk-bundle-build (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Risk Bundle CI / risk-bundle-offline-kit (push) Has been cancelled
Risk Bundle CI / publish-checksums (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
devportal-offline / build-offline (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
This commit is contained in:
@@ -57,6 +57,7 @@ internal static class CommandFactory
|
||||
root.Add(BuildVulnCommand(services, verboseOption, cancellationToken));
|
||||
root.Add(BuildVexCommand(services, options, verboseOption, cancellationToken));
|
||||
root.Add(BuildCryptoCommand(services, verboseOption, cancellationToken));
|
||||
root.Add(BuildExportCommand(services, verboseOption, cancellationToken));
|
||||
root.Add(BuildAttestCommand(services, verboseOption, cancellationToken));
|
||||
root.Add(BuildRiskProfileCommand(verboseOption, cancellationToken));
|
||||
root.Add(BuildAdvisoryCommand(services, verboseOption, cancellationToken));
|
||||
@@ -8713,6 +8714,261 @@ internal static class CommandFactory
|
||||
return sbom;
|
||||
}
|
||||
|
||||
private static Command BuildExportCommand(IServiceProvider services, Option<bool> verboseOption, CancellationToken cancellationToken)
|
||||
{
|
||||
var export = new Command("export", "Manage export profiles and runs.");
|
||||
|
||||
var jsonOption = new Option<bool>("--json")
|
||||
{
|
||||
Description = "Emit output in JSON."
|
||||
};
|
||||
|
||||
var profiles = new Command("profiles", "Manage export profiles.");
|
||||
|
||||
var profilesList = new Command("list", "List export profiles.");
|
||||
var profileLimitOption = new Option<int?>("--limit")
|
||||
{
|
||||
Description = "Maximum number of profiles to return."
|
||||
};
|
||||
var profileCursorOption = new Option<string?>("--cursor")
|
||||
{
|
||||
Description = "Pagination cursor."
|
||||
};
|
||||
profilesList.Add(profileLimitOption);
|
||||
profilesList.Add(profileCursorOption);
|
||||
profilesList.Add(jsonOption);
|
||||
profilesList.Add(verboseOption);
|
||||
profilesList.SetAction((parseResult, _) =>
|
||||
{
|
||||
var limit = parseResult.GetValue(profileLimitOption);
|
||||
var cursor = parseResult.GetValue(profileCursorOption);
|
||||
var json = parseResult.GetValue(jsonOption);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleExportProfilesListAsync(
|
||||
services,
|
||||
limit,
|
||||
cursor,
|
||||
json,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
var profilesShow = new Command("show", "Show export profile details.");
|
||||
var profileIdArg = new Argument<string>("profile-id")
|
||||
{
|
||||
Description = "Export profile identifier."
|
||||
};
|
||||
profilesShow.Add(profileIdArg);
|
||||
profilesShow.Add(jsonOption);
|
||||
profilesShow.Add(verboseOption);
|
||||
profilesShow.SetAction((parseResult, _) =>
|
||||
{
|
||||
var profileId = parseResult.GetValue(profileIdArg) ?? string.Empty;
|
||||
var json = parseResult.GetValue(jsonOption);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleExportProfileShowAsync(
|
||||
services,
|
||||
profileId,
|
||||
json,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
profiles.Add(profilesList);
|
||||
profiles.Add(profilesShow);
|
||||
export.Add(profiles);
|
||||
|
||||
var runs = new Command("runs", "Manage export runs.");
|
||||
|
||||
var runsList = new Command("list", "List export runs.");
|
||||
var runProfileOption = new Option<string?>("--profile-id")
|
||||
{
|
||||
Description = "Filter runs by profile ID."
|
||||
};
|
||||
var runLimitOption = new Option<int?>("--limit")
|
||||
{
|
||||
Description = "Maximum number of runs to return."
|
||||
};
|
||||
var runCursorOption = new Option<string?>("--cursor")
|
||||
{
|
||||
Description = "Pagination cursor."
|
||||
};
|
||||
runsList.Add(runProfileOption);
|
||||
runsList.Add(runLimitOption);
|
||||
runsList.Add(runCursorOption);
|
||||
runsList.Add(jsonOption);
|
||||
runsList.Add(verboseOption);
|
||||
runsList.SetAction((parseResult, _) =>
|
||||
{
|
||||
var profileId = parseResult.GetValue(runProfileOption);
|
||||
var limit = parseResult.GetValue(runLimitOption);
|
||||
var cursor = parseResult.GetValue(runCursorOption);
|
||||
var json = parseResult.GetValue(jsonOption);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleExportRunsListAsync(
|
||||
services,
|
||||
profileId,
|
||||
limit,
|
||||
cursor,
|
||||
json,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
var runIdArg = new Argument<string>("run-id")
|
||||
{
|
||||
Description = "Export run identifier."
|
||||
};
|
||||
var runsShow = new Command("show", "Show export run details.");
|
||||
runsShow.Add(runIdArg);
|
||||
runsShow.Add(jsonOption);
|
||||
runsShow.Add(verboseOption);
|
||||
runsShow.SetAction((parseResult, _) =>
|
||||
{
|
||||
var runId = parseResult.GetValue(runIdArg) ?? string.Empty;
|
||||
var json = parseResult.GetValue(jsonOption);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleExportRunShowAsync(
|
||||
services,
|
||||
runId,
|
||||
json,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
var runsDownload = new Command("download", "Download an export bundle for a run.");
|
||||
runsDownload.Add(runIdArg);
|
||||
var runOutputOption = new Option<string>("--output", new[] { "-o" })
|
||||
{
|
||||
Description = "Path to write the export bundle.",
|
||||
IsRequired = true
|
||||
};
|
||||
var runOverwriteOption = new Option<bool>("--overwrite")
|
||||
{
|
||||
Description = "Overwrite output file if it exists."
|
||||
};
|
||||
var runVerifyHashOption = new Option<string?>("--verify-hash")
|
||||
{
|
||||
Description = "Optional SHA256 hash to verify after download."
|
||||
};
|
||||
var runTypeOption = new Option<string>("--type")
|
||||
{
|
||||
Description = "Run type: evidence (default) or attestation."
|
||||
};
|
||||
runTypeOption.SetDefaultValue("evidence");
|
||||
|
||||
runsDownload.Add(runOutputOption);
|
||||
runsDownload.Add(runOverwriteOption);
|
||||
runsDownload.Add(runVerifyHashOption);
|
||||
runsDownload.Add(runTypeOption);
|
||||
runsDownload.Add(verboseOption);
|
||||
runsDownload.SetAction((parseResult, _) =>
|
||||
{
|
||||
var runId = parseResult.GetValue(runIdArg) ?? string.Empty;
|
||||
var output = parseResult.GetValue(runOutputOption) ?? string.Empty;
|
||||
var overwrite = parseResult.GetValue(runOverwriteOption);
|
||||
var verifyHash = parseResult.GetValue(runVerifyHashOption);
|
||||
var runType = parseResult.GetValue(runTypeOption) ?? "evidence";
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleExportRunDownloadAsync(
|
||||
services,
|
||||
runId,
|
||||
output,
|
||||
overwrite,
|
||||
verifyHash,
|
||||
runType,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
runs.Add(runsList);
|
||||
runs.Add(runsShow);
|
||||
runs.Add(runsDownload);
|
||||
export.Add(runs);
|
||||
|
||||
var start = new Command("start", "Start export jobs.");
|
||||
var startProfileOption = new Option<string>("--profile-id")
|
||||
{
|
||||
Description = "Export profile identifier.",
|
||||
IsRequired = true
|
||||
};
|
||||
var startSelectorOption = new Option<string[]?>("--selector", new[] { "-s" })
|
||||
{
|
||||
Description = "Selector key=value filters (repeatable).",
|
||||
AllowMultipleArgumentsPerToken = true
|
||||
};
|
||||
var startCallbackOption = new Option<string?>("--callback-url")
|
||||
{
|
||||
Description = "Optional callback URL for completion notifications."
|
||||
};
|
||||
|
||||
var startEvidence = new Command("evidence", "Start an evidence export run.");
|
||||
startEvidence.Add(startProfileOption);
|
||||
startEvidence.Add(startSelectorOption);
|
||||
startEvidence.Add(startCallbackOption);
|
||||
startEvidence.Add(jsonOption);
|
||||
startEvidence.Add(verboseOption);
|
||||
startEvidence.SetAction((parseResult, _) =>
|
||||
{
|
||||
var profileId = parseResult.GetValue(startProfileOption) ?? string.Empty;
|
||||
var selectors = parseResult.GetValue(startSelectorOption);
|
||||
var callback = parseResult.GetValue(startCallbackOption);
|
||||
var json = parseResult.GetValue(jsonOption);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleExportStartEvidenceAsync(
|
||||
services,
|
||||
profileId,
|
||||
selectors,
|
||||
callback,
|
||||
json,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
var startAttestation = new Command("attestation", "Start an attestation export run.");
|
||||
startAttestation.Add(startProfileOption);
|
||||
startAttestation.Add(startSelectorOption);
|
||||
var startTransparencyOption = new Option<bool>("--include-transparency")
|
||||
{
|
||||
Description = "Include transparency log entries."
|
||||
};
|
||||
startAttestation.Add(startTransparencyOption);
|
||||
startAttestation.Add(startCallbackOption);
|
||||
startAttestation.Add(jsonOption);
|
||||
startAttestation.Add(verboseOption);
|
||||
startAttestation.SetAction((parseResult, _) =>
|
||||
{
|
||||
var profileId = parseResult.GetValue(startProfileOption) ?? string.Empty;
|
||||
var selectors = parseResult.GetValue(startSelectorOption);
|
||||
var includeTransparency = parseResult.GetValue(startTransparencyOption);
|
||||
var callback = parseResult.GetValue(startCallbackOption);
|
||||
var json = parseResult.GetValue(jsonOption);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleExportStartAttestationAsync(
|
||||
services,
|
||||
profileId,
|
||||
selectors,
|
||||
includeTransparency,
|
||||
callback,
|
||||
json,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
start.Add(startEvidence);
|
||||
start.Add(startAttestation);
|
||||
export.Add(start);
|
||||
|
||||
return export;
|
||||
}
|
||||
|
||||
// CLI-PARITY-41-002: Notify command group
|
||||
private static Command BuildNotifyCommand(IServiceProvider services, Option<bool> verboseOption, CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -9038,6 +9294,79 @@ internal static class CommandFactory
|
||||
|
||||
notify.Add(deliveries);
|
||||
|
||||
// notify simulate
|
||||
var simulate = new Command("simulate", "Simulate notification rules against events.");
|
||||
|
||||
var simulateEventsFileOption = new Option<string?>("--events-file")
|
||||
{
|
||||
Description = "Path to JSON file containing events array for simulation."
|
||||
};
|
||||
var simulateRulesFileOption = new Option<string?>("--rules-file")
|
||||
{
|
||||
Description = "Optional JSON file containing rules array to evaluate (overrides server rules)."
|
||||
};
|
||||
var simulateEnabledOnlyOption = new Option<bool>("--enabled-only")
|
||||
{
|
||||
Description = "Only evaluate enabled rules."
|
||||
};
|
||||
var simulateLookbackOption = new Option<int?>("--lookback-minutes")
|
||||
{
|
||||
Description = "Historical lookback window for events."
|
||||
};
|
||||
var simulateMaxEventsOption = new Option<int?>("--max-events")
|
||||
{
|
||||
Description = "Maximum events to evaluate."
|
||||
};
|
||||
var simulateEventKindOption = new Option<string?>("--event-kind")
|
||||
{
|
||||
Description = "Filter simulation to a specific event kind."
|
||||
};
|
||||
var simulateIncludeNonMatchesOption = new Option<bool>("--include-non-matches")
|
||||
{
|
||||
Description = "Include non-match explanations."
|
||||
};
|
||||
|
||||
simulate.Add(tenantOption);
|
||||
simulate.Add(simulateEventsFileOption);
|
||||
simulate.Add(simulateRulesFileOption);
|
||||
simulate.Add(simulateEnabledOnlyOption);
|
||||
simulate.Add(simulateLookbackOption);
|
||||
simulate.Add(simulateMaxEventsOption);
|
||||
simulate.Add(simulateEventKindOption);
|
||||
simulate.Add(simulateIncludeNonMatchesOption);
|
||||
simulate.Add(jsonOption);
|
||||
simulate.Add(verboseOption);
|
||||
|
||||
simulate.SetAction((parseResult, _) =>
|
||||
{
|
||||
var tenant = parseResult.GetValue(tenantOption);
|
||||
var eventsFile = parseResult.GetValue(simulateEventsFileOption);
|
||||
var rulesFile = parseResult.GetValue(simulateRulesFileOption);
|
||||
var enabledOnly = parseResult.GetValue(simulateEnabledOnlyOption);
|
||||
var lookback = parseResult.GetValue(simulateLookbackOption);
|
||||
var maxEvents = parseResult.GetValue(simulateMaxEventsOption);
|
||||
var eventKind = parseResult.GetValue(simulateEventKindOption);
|
||||
var includeNonMatches = parseResult.GetValue(simulateIncludeNonMatchesOption);
|
||||
var json = parseResult.GetValue(jsonOption);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleNotifySimulateAsync(
|
||||
services,
|
||||
tenant,
|
||||
eventsFile,
|
||||
rulesFile,
|
||||
enabledOnly,
|
||||
lookback,
|
||||
maxEvents,
|
||||
eventKind,
|
||||
includeNonMatches,
|
||||
json,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
notify.Add(simulate);
|
||||
|
||||
// notify send
|
||||
var send = new Command("send", "Send a notification.");
|
||||
|
||||
@@ -9112,6 +9441,61 @@ internal static class CommandFactory
|
||||
|
||||
notify.Add(send);
|
||||
|
||||
// notify ack
|
||||
var ack = new Command("ack", "Acknowledge a notification or incident.");
|
||||
var ackTenantOption = new Option<string?>("--tenant")
|
||||
{
|
||||
Description = "Tenant identifier (header)."
|
||||
};
|
||||
var ackIncidentOption = new Option<string?>("--incident-id")
|
||||
{
|
||||
Description = "Incident identifier to acknowledge."
|
||||
};
|
||||
var ackTokenOption = new Option<string?>("--token")
|
||||
{
|
||||
Description = "Signed acknowledgment token."
|
||||
};
|
||||
var ackByOption = new Option<string?>("--by")
|
||||
{
|
||||
Description = "Actor performing the acknowledgment."
|
||||
};
|
||||
var ackCommentOption = new Option<string?>("--comment")
|
||||
{
|
||||
Description = "Optional acknowledgment comment."
|
||||
};
|
||||
|
||||
ack.Add(ackTenantOption);
|
||||
ack.Add(ackIncidentOption);
|
||||
ack.Add(ackTokenOption);
|
||||
ack.Add(ackByOption);
|
||||
ack.Add(ackCommentOption);
|
||||
ack.Add(jsonOption);
|
||||
ack.Add(verboseOption);
|
||||
|
||||
ack.SetAction((parseResult, _) =>
|
||||
{
|
||||
var tenant = parseResult.GetValue(ackTenantOption);
|
||||
var incidentId = parseResult.GetValue(ackIncidentOption);
|
||||
var token = parseResult.GetValue(ackTokenOption);
|
||||
var by = parseResult.GetValue(ackByOption);
|
||||
var comment = parseResult.GetValue(ackCommentOption);
|
||||
var json = parseResult.GetValue(jsonOption);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return CommandHandlers.HandleNotifyAckAsync(
|
||||
services,
|
||||
tenant,
|
||||
incidentId,
|
||||
token,
|
||||
by,
|
||||
comment,
|
||||
json,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
notify.Add(ack);
|
||||
|
||||
return notify;
|
||||
}
|
||||
|
||||
@@ -10682,4 +11066,3 @@ internal static class CommandFactory
|
||||
return devportal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user