< Summary

Information
Class: AsiBackbone.Core.Serialization.GovernanceSchemaVersions
Assembly: AsiBackbone.Core
File(s): /home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.Core/Serialization/GovernanceSchemaVersions.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 33
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Normalize(...)100%22100%

File(s)

/home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.Core/Serialization/GovernanceSchemaVersions.cs

#LineLine coverage
 1namespace AsiBackbone.Core.Serialization;
 2
 3/// <summary>
 4/// Defines schema version constants for persisted or exported AsiBackbone governance artifacts.
 5/// </summary>
 6public static class GovernanceSchemaVersions
 7{
 8    /// <summary>
 9    /// Gets the initial stable schema version for persisted or exported AsiBackbone governance artifacts.
 10    /// </summary>
 11    public const string StableArtifactsV1 = "1.0.0";
 12
 13    /// <summary>
 14    /// Gets the second stable schema version, which adds the issuer-bound capability grant use limit.
 15    /// </summary>
 16    /// <remarks>
 17    /// A grant recording <see cref="StableArtifactsV1" /> is canonicalized without the use limit, so grants signed befo
 18    /// this version continue to verify unchanged. Only a grant recording this version binds a use limit into its signat
 19    /// </remarks>
 20    public const string StableArtifactsV2 = "2.0.0";
 21
 22    /// <summary>
 23    /// Normalizes a caller-supplied schema version to the current stable artifact schema version when none is supplied.
 24    /// </summary>
 25    /// <param name="schemaVersion">The caller-supplied schema version.</param>
 26    /// <returns>The normalized schema version.</returns>
 27    public static string Normalize(string? schemaVersion)
 28    {
 158029        return string.IsNullOrWhiteSpace(schemaVersion)
 158030            ? StableArtifactsV1
 158031            : schemaVersion.Trim();
 32    }
 33}

Methods/Properties

Normalize(System.String)