mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 18:57:24 +00:00
- embeds the append-only historical and deny trust lists in the API and marks matching bundled plugins as Official without blocking loading - builds and records the current plugin manifest only for official release builds - deploys the PDF native libraries for the supported Linux, macOS and Windows runtimes from the plugin dependency manifest - records release hashes by appending only missing entries to master's manifest and rejects any diff that removes a line - documents the release flow, the supported runtimes and the plugin installer limits
28 lines
1.1 KiB
C#
28 lines
1.1 KiB
C#
#region ========================================================================= USING =====================================================================================
|
|
using System;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.IO;
|
|
using System.Security.Cryptography;
|
|
#endregion
|
|
|
|
namespace Nemera.Presentation.Api.Fixtures.Core.Plugins;
|
|
|
|
/// <summary>
|
|
/// Fixture class for computing the SHA-256 checksums of bundled plugin files.
|
|
/// </summary>
|
|
[ExcludeFromCodeCoverage]
|
|
public class BundledPluginFileHashFixture
|
|
{
|
|
/// <summary>
|
|
/// Computes the SHA-256 checksum of the file at <paramref name="path"/>, in the uppercase hexadecimal form the trust manifest uses.
|
|
/// </summary>
|
|
/// <param name="path">The path of the file to hash.</param>
|
|
/// <returns>The uppercase hexadecimal SHA-256 checksum.</returns>
|
|
public string Create(string path)
|
|
{
|
|
// Convert.ToHexString returns uppercase hexadecimal, which is the form the trust manifest uses.
|
|
using (FileStream fileStream = new(path, FileMode.Open, FileAccess.Read, FileShare.Read))
|
|
return Convert.ToHexString(SHA256.HashData(fileStream));
|
|
}
|
|
}
|