79 lines
2.4 KiB
C#
79 lines
2.4 KiB
C#
// <copyright file="FacetExtractionOptions.cs" company="StellaOps">
|
|
// Copyright (c) StellaOps. Licensed under BUSL-1.1.
|
|
// </copyright>
|
|
|
|
using System.Collections.Immutable;
|
|
|
|
namespace StellaOps.Facet;
|
|
|
|
/// <summary>
|
|
/// Options for facet extraction operations.
|
|
/// </summary>
|
|
public sealed record FacetExtractionOptions
|
|
{
|
|
/// <summary>
|
|
/// Gets the facets to extract. If empty, all built-in facets are used.
|
|
/// </summary>
|
|
public ImmutableArray<IFacet> Facets { get; init; } = [];
|
|
|
|
/// <summary>
|
|
/// Gets whether to include individual file entries in the result.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// When false, only Merkle roots are computed (more compact).
|
|
/// When true, all file details are preserved for audit.
|
|
/// </remarks>
|
|
public bool IncludeFileDetails { get; init; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets whether to compute Merkle proofs for each file.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Enabling proofs allows individual file verification against the facet root.
|
|
/// </remarks>
|
|
public bool ComputeMerkleProofs { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets glob patterns for files to exclude from extraction.
|
|
/// </summary>
|
|
public ImmutableArray<string> ExcludePatterns { get; init; } = [];
|
|
|
|
/// <summary>
|
|
/// Gets the hash algorithm to use (default: SHA256).
|
|
/// </summary>
|
|
public string HashAlgorithm { get; init; } = "SHA256";
|
|
|
|
/// <summary>
|
|
/// Gets whether to follow symlinks.
|
|
/// </summary>
|
|
public bool FollowSymlinks { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the maximum file size to hash (larger files are skipped with placeholder).
|
|
/// </summary>
|
|
public long MaxFileSizeBytes { get; init; } = 100 * 1024 * 1024; // 100MB
|
|
|
|
/// <summary>
|
|
/// Gets the default options.
|
|
/// </summary>
|
|
public static FacetExtractionOptions Default { get; } = new();
|
|
|
|
/// <summary>
|
|
/// Gets options for compact sealing (no file details, just roots).
|
|
/// </summary>
|
|
public static FacetExtractionOptions Compact { get; } = new()
|
|
{
|
|
IncludeFileDetails = false,
|
|
ComputeMerkleProofs = false
|
|
};
|
|
|
|
/// <summary>
|
|
/// Gets options for full audit (all details and proofs).
|
|
/// </summary>
|
|
public static FacetExtractionOptions FullAudit { get; } = new()
|
|
{
|
|
IncludeFileDetails = true,
|
|
ComputeMerkleProofs = true
|
|
};
|
|
}
|