Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ NuGet.Jobs Public archive

Commit

Permalink
Merge branch 'dev' into loshar-revalidate-startup
Browse files Browse the repository at this point in the history
  • Loading branch information
loic-sharma authored Apr 16, 2018
2 parents 5e75c48 + c67227e commit 57ded38
Show file tree
Hide file tree
Showing 24 changed files with 947 additions and 259 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="NuGet.Services.Validation.Issues">
<Version>2.22.0</Version>
<Version>2.23.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ private Task<PackageSignature> FindSignatureAsync(IValidationRequest request)
.PackageSignatures
.Include(s => s.EndCertificate)
.Include(s => s.TrustedTimestamps.Select(t => t.EndCertificate))
.Where(s => s.Type == PackageSignatureType.Author)
.SingleAsync(s => s.PackageKey == request.PackageKey);
}

Expand Down
10 changes: 0 additions & 10 deletions src/Validation.Common.Job/Storage/ValidatorStateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using NuGet.Services.Validation;
using NuGet.Services.Validation.Orchestrator;

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

public ValidatorStateService(
IValidationEntitiesContext validationContext,
IValidatorProvider validatorProvider,
string validatorName,
ILogger<ValidatorStateService> logger)
{
_validationContext = validationContext ?? throw new ArgumentNullException(nameof(validationContext));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
if (validatorProvider == null)
{
throw new ArgumentNullException(nameof(validatorProvider));
}
if (!validatorProvider.IsValidator(validatorName))
{
throw new ArgumentException($"\"{validatorName}\" is not a proper validator alias.", nameof(validatorName));
}
_validatorName = validatorName ?? throw new ArgumentNullException(nameof(validatorName));
}

Expand Down
10 changes: 5 additions & 5 deletions src/Validation.Common.Job/Validation.Common.Job.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@
<Version>1.1.2</Version>
</PackageReference>
<PackageReference Include="NuGet.Packaging">
<Version>4.7.0-preview1.5029</Version>
<Version>4.7.0-preview4.5067</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Configuration">
<Version>2.22.0</Version>
<Version>2.23.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Logging">
<Version>2.22.0</Version>
<Version>2.23.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Storage">
<Version>2.22.0</Version>
<Version>2.23.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Validation">
<Version>2.22.0</Version>
<Version>2.23.0</Version>
</PackageReference>
<PackageReference Include="NuGetGallery.Core">
<Version>4.4.4-dev-26726</Version>
Expand Down
10 changes: 5 additions & 5 deletions src/Validation.Common.Job/Validation.Common.Job.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<dependency id="Microsoft.ApplicationInsights" version="2.2.0" />
<dependency id="Microsoft.Extensions.DependencyInjection" version="1.1.1" />
<dependency id="Microsoft.Extensions.Options.ConfigurationExtensions" version="1.1.2" />
<dependency id="NuGet.Packaging" version="4.7.0-preview1.5029" />
<dependency id="NuGet.Services.Configuration" version="2.22.0" />
<dependency id="NuGet.Services.Logging" version="2.22.0" />
<dependency id="NuGet.Services.Storage" version="2.22.0" />
<dependency id="NuGet.Services.Validation" version="2.22.0" />
<dependency id="NuGet.Packaging" version="4.7.0-preview4.5067" />
<dependency id="NuGet.Services.Configuration" version="2.23.0" />
<dependency id="NuGet.Services.Logging" version="2.23.0" />
<dependency id="NuGet.Services.Storage" version="2.23.0" />
<dependency id="NuGet.Services.Validation" version="2.23.0" />
<dependency id="NuGetGallery.Core" version="4.4.4-dev-26726" />
<dependency id="Serilog" version="2.5.0" />
<dependency id="System.Net.Http" version="4.3.3" />
Expand Down
4 changes: 4 additions & 0 deletions src/Validation.Common/Validators/Vcs/VcsCallbackServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public VcsCallbackServerStartup()

public void Configuration(IAppBuilder app)
{
// Ensure that SSLv3 is disabled and that Tls v1.2 is enabled.
ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Ssl3;
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;

if (Services.Logging.ApplicationInsights.Initialized)
{
app.Use<RequestTrackingMiddleware>();
Expand Down
4 changes: 0 additions & 4 deletions src/Validation.PackageSigning.ProcessSignature/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ protected override void ConfigureAutofacServices(ContainerBuilder containerBuild
(pi, ctx) => ValidatorName.PackageSigning)
.As<IValidatorStateService>();

containerBuilder
.RegisterType<PackageSigningStateService>()
.As<IPackageSigningStateService>();

containerBuilder
.RegisterType<ScopedMessageHandler<SignatureValidationMessage>>()
.Keyed<IMessageHandler<SignatureValidationMessage>>(validateSignatureBindingKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public Task<PackageVerificationResult> GetTrustResultAsync(
CancellationToken token)
{
var result = new SignedPackageVerificationResult(
SignatureVerificationStatus.Trusted,
SignatureVerificationStatus.Valid,
signature,
Enumerable.Empty<SignatureLog>());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static IPackageSignatureVerifier CreateMinimal()

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

var settings = new SignedPackageVerifierSettings(
allowUnsigned: false,
allowIllegal: false,
allowUntrusted: false,
allowUntrustedSelfIssuedCertificate: false,
allowIgnoreTimestamp: false,
Expand Down
Loading

0 comments on commit 57ded38

Please sign in to comment.