Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit aad31a4

Browse files
committed
Persist repository signature information in database (#401)
Progress on NuGet/NuGetGallery#5754
1 parent c182bac commit aad31a4

17 files changed

Lines changed: 674 additions & 238 deletions

File tree

src/NuGet.Services.Validation.Orchestrator/NuGet.Services.Validation.Orchestrator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
</ItemGroup>
108108
<ItemGroup>
109109
<PackageReference Include="NuGet.Services.Validation.Issues">
110-
<Version>2.22.0</Version>
110+
<Version>2.23.0</Version>
111111
</PackageReference>
112112
</ItemGroup>
113113
<ItemGroup>

src/Validation.Common.Job/Storage/ValidatorStateService.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using System.Threading.Tasks;
1010
using Microsoft.Extensions.Logging;
1111
using NuGet.Services.Validation;
12-
using NuGet.Services.Validation.Orchestrator;
1312

1413
namespace NuGet.Jobs.Validation.PackageSigning.Storage
1514
{
@@ -21,20 +20,11 @@ public class ValidatorStateService : IValidatorStateService
2120

2221
public ValidatorStateService(
2322
IValidationEntitiesContext validationContext,
24-
IValidatorProvider validatorProvider,
2523
string validatorName,
2624
ILogger<ValidatorStateService> logger)
2725
{
2826
_validationContext = validationContext ?? throw new ArgumentNullException(nameof(validationContext));
2927
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
30-
if (validatorProvider == null)
31-
{
32-
throw new ArgumentNullException(nameof(validatorProvider));
33-
}
34-
if (!validatorProvider.IsValidator(validatorName))
35-
{
36-
throw new ArgumentException($"\"{validatorName}\" is not a proper validator alias.", nameof(validatorName));
37-
}
3828
_validatorName = validatorName ?? throw new ArgumentNullException(nameof(validatorName));
3929
}
4030

src/Validation.Common.Job/Validation.Common.Job.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,19 @@
8888
<Version>1.1.2</Version>
8989
</PackageReference>
9090
<PackageReference Include="NuGet.Packaging">
91-
<Version>4.7.0-preview1.5029</Version>
91+
<Version>4.7.0-preview4.5067</Version>
9292
</PackageReference>
9393
<PackageReference Include="NuGet.Services.Configuration">
94-
<Version>2.22.0</Version>
94+
<Version>2.23.0</Version>
9595
</PackageReference>
9696
<PackageReference Include="NuGet.Services.Logging">
97-
<Version>2.22.0</Version>
97+
<Version>2.23.0</Version>
9898
</PackageReference>
9999
<PackageReference Include="NuGet.Services.Storage">
100-
<Version>2.22.0</Version>
100+
<Version>2.23.0</Version>
101101
</PackageReference>
102102
<PackageReference Include="NuGet.Services.Validation">
103-
<Version>2.22.0</Version>
103+
<Version>2.23.0</Version>
104104
</PackageReference>
105105
<PackageReference Include="NuGetGallery.Core">
106106
<Version>4.4.4-dev-26726</Version>

src/Validation.Common.Job/Validation.Common.Job.nuspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<dependency id="Microsoft.ApplicationInsights" version="2.2.0" />
1616
<dependency id="Microsoft.Extensions.DependencyInjection" version="1.1.1" />
1717
<dependency id="Microsoft.Extensions.Options.ConfigurationExtensions" version="1.1.2" />
18-
<dependency id="NuGet.Packaging" version="4.7.0-preview1.5029" />
19-
<dependency id="NuGet.Services.Configuration" version="2.22.0" />
20-
<dependency id="NuGet.Services.Logging" version="2.22.0" />
21-
<dependency id="NuGet.Services.Storage" version="2.22.0" />
22-
<dependency id="NuGet.Services.Validation" version="2.22.0" />
18+
<dependency id="NuGet.Packaging" version="4.7.0-preview4.5067" />
19+
<dependency id="NuGet.Services.Configuration" version="2.23.0" />
20+
<dependency id="NuGet.Services.Logging" version="2.23.0" />
21+
<dependency id="NuGet.Services.Storage" version="2.23.0" />
22+
<dependency id="NuGet.Services.Validation" version="2.23.0" />
2323
<dependency id="NuGetGallery.Core" version="4.4.4-dev-26726" />
2424
<dependency id="Serilog" version="2.5.0" />
2525
<dependency id="System.Net.Http" version="4.3.3" />

src/Validation.PackageSigning.ProcessSignature/Job.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ protected override void ConfigureAutofacServices(ContainerBuilder containerBuild
7878
(pi, ctx) => ValidatorName.PackageSigning)
7979
.As<IValidatorStateService>();
8080

81-
containerBuilder
82-
.RegisterType<PackageSigningStateService>()
83-
.As<IPackageSigningStateService>();
84-
8581
containerBuilder
8682
.RegisterType<ScopedMessageHandler<SignatureValidationMessage>>()
8783
.Keyed<IMessageHandler<SignatureValidationMessage>>(validateSignatureBindingKey);

src/Validation.PackageSigning.ProcessSignature/MinimalSignatureVerificationProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public Task<PackageVerificationResult> GetTrustResultAsync(
2121
CancellationToken token)
2222
{
2323
var result = new SignedPackageVerificationResult(
24-
SignatureVerificationStatus.Trusted,
24+
SignatureVerificationStatus.Valid,
2525
signature,
2626
Enumerable.Empty<SignatureLog>());
2727

src/Validation.PackageSigning.ProcessSignature/PackageSignatureVerifierFactory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public static IPackageSignatureVerifier CreateMinimal()
2323

2424
var settings = new SignedPackageVerifierSettings(
2525
allowUnsigned: true,
26+
allowIllegal: false,
2627
allowUntrusted: false, // Invalid format of the signature uses this flag to determine success.
2728
allowUntrustedSelfIssuedCertificate: true,
2829
allowIgnoreTimestamp: true,
@@ -48,6 +49,7 @@ public static IPackageSignatureVerifier CreateFull()
4849

4950
var settings = new SignedPackageVerifierSettings(
5051
allowUnsigned: false,
52+
allowIllegal: false,
5153
allowUntrusted: false,
5254
allowUntrustedSelfIssuedCertificate: false,
5355
allowIgnoreTimestamp: false,

0 commit comments

Comments
 (0)