42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
// -----------------------------------------------------------------------------
|
|
// S3UnifiedArtifactStore.Metadata.cs
|
|
// Sprint: SPRINT_20260118_017_Evidence_artifact_store_unification
|
|
// Task: AS-002 - Implement S3-backed ArtifactStore
|
|
// Description: Metadata projection helpers for artifact store
|
|
// -----------------------------------------------------------------------------
|
|
using StellaOps.Artifact.Core;
|
|
|
|
namespace StellaOps.Artifact.Infrastructure;
|
|
|
|
public sealed partial class S3UnifiedArtifactStore
|
|
{
|
|
/// <inheritdoc />
|
|
public async Task<ArtifactMetadata?> GetMetadataAsync(
|
|
string bomRef,
|
|
string serialNumber,
|
|
string artifactId,
|
|
CancellationToken ct = default)
|
|
{
|
|
var entry = await _indexRepository.GetAsync(bomRef, serialNumber, artifactId, ct)
|
|
.ConfigureAwait(false);
|
|
return entry == null ? null : CreateMetadata(entry);
|
|
}
|
|
|
|
private static ArtifactMetadata CreateMetadata(ArtifactIndexEntry entry)
|
|
{
|
|
return new ArtifactMetadata
|
|
{
|
|
StorageKey = entry.StorageKey,
|
|
BomRef = entry.BomRef,
|
|
SerialNumber = entry.SerialNumber,
|
|
ArtifactId = entry.ArtifactId,
|
|
ContentType = entry.ContentType,
|
|
SizeBytes = entry.SizeBytes,
|
|
Sha256 = entry.Sha256,
|
|
CreatedAt = entry.CreatedAt,
|
|
Type = entry.Type,
|
|
TenantId = entry.TenantId
|
|
};
|
|
}
|
|
}
|