Files
git.stella-ops.org/src/Cli/StellaOps.Cli/Services/Models/SymbolBundleModels.cs
StellaOps Bot 233873f620
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Reachability Corpus Validation / validate-corpus (push) Has been cancelled
Reachability Corpus Validation / validate-ground-truths (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Reachability Corpus Validation / determinism-check (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
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
up
2025-12-14 15:50:38 +02:00

131 lines
6.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace StellaOps.Cli.Services.Models;
// SYMS-BUNDLE-401-014: Symbol bundle CLI models
/// <summary>
/// Request to build a symbol bundle.
/// </summary>
internal sealed record SymbolBundleBuildRequest(
[property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("version")] string Version,
[property: JsonPropertyName("sourceDir")] string SourceDir,
[property: JsonPropertyName("outputDir")] string OutputDir,
[property: JsonPropertyName("platform")] string? Platform = null,
[property: JsonPropertyName("tenantId")] string? TenantId = null,
[property: JsonPropertyName("sign")] bool Sign = false,
[property: JsonPropertyName("signingKeyPath")] string? SigningKeyPath = null,
[property: JsonPropertyName("keyId")] string? KeyId = null,
[property: JsonPropertyName("signingAlgorithm")] string SigningAlgorithm = "ecdsa-p256",
[property: JsonPropertyName("submitRekor")] bool SubmitRekor = false,
[property: JsonPropertyName("rekorUrl")] string RekorUrl = "https://rekor.sigstore.dev",
[property: JsonPropertyName("format")] string Format = "zip",
[property: JsonPropertyName("compressionLevel")] int CompressionLevel = 6);
/// <summary>
/// Result of symbol bundle build operation.
/// </summary>
internal sealed record SymbolBundleBuildResult(
[property: JsonPropertyName("success")] bool Success,
[property: JsonPropertyName("bundlePath")] string? BundlePath = null,
[property: JsonPropertyName("manifestPath")] string? ManifestPath = null,
[property: JsonPropertyName("bundleId")] string? BundleId = null,
[property: JsonPropertyName("entryCount")] int EntryCount = 0,
[property: JsonPropertyName("totalSizeBytes")] long TotalSizeBytes = 0,
[property: JsonPropertyName("signed")] bool Signed = false,
[property: JsonPropertyName("rekorLogIndex")] long? RekorLogIndex = null,
[property: JsonPropertyName("error")] string? Error = null,
[property: JsonPropertyName("warnings")] IReadOnlyList<string>? Warnings = null,
[property: JsonPropertyName("durationMs")] long DurationMs = 0);
/// <summary>
/// Request to verify a symbol bundle.
/// </summary>
internal sealed record SymbolBundleVerifyRequest(
[property: JsonPropertyName("bundlePath")] string BundlePath,
[property: JsonPropertyName("publicKeyPath")] string? PublicKeyPath = null,
[property: JsonPropertyName("verifyRekorOffline")] bool VerifyRekorOffline = true,
[property: JsonPropertyName("rekorPublicKeyPath")] string? RekorPublicKeyPath = null,
[property: JsonPropertyName("verifyBlobHashes")] bool VerifyBlobHashes = true);
/// <summary>
/// Result of symbol bundle verification.
/// </summary>
internal sealed record SymbolBundleVerifyResult(
[property: JsonPropertyName("valid")] bool Valid,
[property: JsonPropertyName("bundleId")] string? BundleId = null,
[property: JsonPropertyName("name")] string? Name = null,
[property: JsonPropertyName("version")] string? Version = null,
[property: JsonPropertyName("signatureStatus")] string SignatureStatus = "unsigned",
[property: JsonPropertyName("rekorStatus")] string? RekorStatus = null,
[property: JsonPropertyName("hashStatus")] SymbolBundleHashStatus? HashStatus = null,
[property: JsonPropertyName("errors")] IReadOnlyList<string>? Errors = null,
[property: JsonPropertyName("warnings")] IReadOnlyList<string>? Warnings = null);
/// <summary>
/// Hash verification status for a bundle.
/// </summary>
internal sealed record SymbolBundleHashStatus(
[property: JsonPropertyName("bundleHashValid")] bool BundleHashValid,
[property: JsonPropertyName("validEntries")] int ValidEntries,
[property: JsonPropertyName("invalidEntries")] int InvalidEntries,
[property: JsonPropertyName("totalEntries")] int TotalEntries,
[property: JsonPropertyName("invalidEntryIds")] IReadOnlyList<string>? InvalidEntryIds = null);
/// <summary>
/// Request to extract a symbol bundle.
/// </summary>
internal sealed record SymbolBundleExtractRequest(
[property: JsonPropertyName("bundlePath")] string BundlePath,
[property: JsonPropertyName("outputDir")] string OutputDir,
[property: JsonPropertyName("verifyFirst")] bool VerifyFirst = true,
[property: JsonPropertyName("platform")] string? Platform = null,
[property: JsonPropertyName("overwrite")] bool Overwrite = false,
[property: JsonPropertyName("manifestsOnly")] bool ManifestsOnly = false);
/// <summary>
/// Result of symbol bundle extraction.
/// </summary>
internal sealed record SymbolBundleExtractResult(
[property: JsonPropertyName("success")] bool Success,
[property: JsonPropertyName("extractedCount")] int ExtractedCount = 0,
[property: JsonPropertyName("skippedCount")] int SkippedCount = 0,
[property: JsonPropertyName("totalBytesExtracted")] long TotalBytesExtracted = 0,
[property: JsonPropertyName("verificationPassed")] bool? VerificationPassed = null,
[property: JsonPropertyName("error")] string? Error = null,
[property: JsonPropertyName("durationMs")] long DurationMs = 0);
/// <summary>
/// Symbol bundle manifest info for inspection.
/// </summary>
internal sealed record SymbolBundleInfo(
[property: JsonPropertyName("bundleId")] string BundleId,
[property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("version")] string Version,
[property: JsonPropertyName("createdAt")] DateTimeOffset CreatedAt,
[property: JsonPropertyName("platform")] string? Platform = null,
[property: JsonPropertyName("tenantId")] string? TenantId = null,
[property: JsonPropertyName("entryCount")] int EntryCount = 0,
[property: JsonPropertyName("totalSizeBytes")] long TotalSizeBytes = 0,
[property: JsonPropertyName("hashAlgorithm")] string HashAlgorithm = "blake3",
[property: JsonPropertyName("signed")] bool Signed = false,
[property: JsonPropertyName("signatureAlgorithm")] string? SignatureAlgorithm = null,
[property: JsonPropertyName("signatureKeyId")] string? SignatureKeyId = null,
[property: JsonPropertyName("rekorLogIndex")] long? RekorLogIndex = null,
[property: JsonPropertyName("entries")] IReadOnlyList<SymbolBundleEntryInfo>? Entries = null);
/// <summary>
/// Individual entry in a symbol bundle.
/// </summary>
internal sealed record SymbolBundleEntryInfo(
[property: JsonPropertyName("debugId")] string DebugId,
[property: JsonPropertyName("binaryName")] string BinaryName,
[property: JsonPropertyName("platform")] string? Platform = null,
[property: JsonPropertyName("format")] string? Format = null,
[property: JsonPropertyName("blobHash")] string? BlobHash = null,
[property: JsonPropertyName("blobSizeBytes")] long BlobSizeBytes = 0,
[property: JsonPropertyName("symbolCount")] int SymbolCount = 0);