This repository was archived by the owner on Mar 31, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathPackageSignature.cs
More file actions
87 lines (70 loc) · 3.58 KB
/
PackageSignature.cs
File metadata and controls
87 lines (70 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.DataAnnotations;
using NuGet.Common;
using ILogger = Microsoft.Extensions.Logging.ILogger;
namespace NuGet.Insights.Worker.PackageSignatureToCsv
{
[CsvRecord]
public partial record PackageSignature : PackageRecord, IAggregatedCsvRecord<PackageSignature>
{
public PackageSignature()
{
}
public PackageSignature(Guid scanId, DateTimeOffset scanTimestamp, PackageDeleteCatalogLeaf leaf)
: base(scanId, scanTimestamp, leaf)
{
ResultType = PackageSignatureResultType.Deleted;
}
public PackageSignature(Guid scanId, DateTimeOffset scanTimestamp, PackageDetailsCatalogLeaf leaf)
: base(scanId, scanTimestamp, leaf)
{
ResultType = PackageSignatureResultType.Available;
}
[Required]
public PackageSignatureResultType ResultType { get; set; }
public HashAlgorithmName? HashAlgorithm { get; set; }
public string HashValue { get; set; }
public string AuthorSHA1 { get; set; }
public string AuthorSHA256 { get; set; }
public string AuthorSubject { get; set; }
public DateTimeOffset? AuthorNotBefore { get; set; }
public DateTimeOffset? AuthorNotAfter { get; set; }
public string AuthorIssuer { get; set; }
public string AuthorTimestampSHA1 { get; set; }
public string AuthorTimestampSHA256 { get; set; }
public string AuthorTimestampSubject { get; set; }
public DateTimeOffset? AuthorTimestampNotBefore { get; set; }
public DateTimeOffset? AuthorTimestampNotAfter { get; set; }
public string AuthorTimestampIssuer { get; set; }
public DateTimeOffset? AuthorTimestampValue { get; set; }
public bool? AuthorTimestampHasASN1Error { get; set; }
public string RepositorySHA1 { get; set; }
public string RepositorySHA256 { get; set; }
public string RepositorySubject { get; set; }
public DateTimeOffset? RepositoryNotBefore { get; set; }
public DateTimeOffset? RepositoryNotAfter { get; set; }
public string RepositoryIssuer { get; set; }
public string RepositoryTimestampSHA1 { get; set; }
public string RepositoryTimestampSHA256 { get; set; }
public string RepositoryTimestampSubject { get; set; }
public DateTimeOffset? RepositoryTimestampNotBefore { get; set; }
public DateTimeOffset? RepositoryTimestampNotAfter { get; set; }
public string RepositoryTimestampIssuer { get; set; }
public DateTimeOffset? RepositoryTimestampValue { get; set; }
public bool? RepositoryTimestampHasASN1Error { get; set; }
[KustoType("dynamic")]
public string PackageOwners { get; set; }
public static string CsvCompactMessageSchemaName => "cc.ps";
public static IEqualityComparer<PackageSignature> KeyComparer { get; } = PackageRecordIdentityComparer<PackageSignature>.Instance;
public static IReadOnlyList<string> KeyFields { get; } = PackageRecordExtensions.IdentityKeyField;
public static List<PackageSignature> Prune(List<PackageSignature> records, bool isFinalPrune, IOptions<NuGetInsightsWorkerSettings> options, ILogger logger)
{
return PackageRecordExtensions.Prune(records, isFinalPrune);
}
public int CompareTo(PackageSignature other)
{
return base.CompareTo(other);
}
}
}