Skip to content

Commit

Permalink
Update to latest ServerCommon (v2.123.0) (#10108)
Browse files Browse the repository at this point in the history
The enablePublicAccess values were determined based on current PROD container public access.
  • Loading branch information
joelverhagen authored Aug 2, 2024
1 parent a782405 commit d8c3780
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
<EnablePackageVersionOverride>true</EnablePackageVersionOverride>
<NuGetClientPackageVersion>6.9.1</NuGetClientPackageVersion>
<ServerCommonPackageVersion>2.122.0</ServerCommonPackageVersion>
<ServerCommonPackageVersion>2.123.0</ServerCommonPackageVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="4.4.0" />
Expand Down
5 changes: 3 additions & 2 deletions src/Gallery.CredentialExpiration/Job.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// 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;
Expand Down Expand Up @@ -56,6 +56,7 @@ public override void Init(IServiceContainer serviceContainer, IDictionary<string
var storageFactory = new AzureStorageFactory(
storageAccount,
InitializationConfiguration.ContainerName,
enablePublicAccess: false,
LoggerFactory.CreateLogger<AzureStorage>());
Storage = storageFactory.Create();
}
Expand Down Expand Up @@ -182,4 +183,4 @@ protected override void ConfigureJobServices(IServiceCollection services, IConfi
ConfigureInitializationSection<InitializationConfiguration>(services, configurationRoot);
}
}
}
}
1 change: 1 addition & 0 deletions src/GitHubVulnerabilities2Db/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ protected void ConfigureCollectorServices(ContainerBuilder containerBuilder)
return new AzureStorageFactory(
ctx.Resolve<BlobServiceClient>(),
ctx.Resolve<GitHubVulnerabilities2DbConfiguration>().CursorContainerName,
enablePublicAccess: true,
ctx.Resolve<ILogger<AzureStorage>>());
})
.As<StorageFactory>()
Expand Down
1 change: 1 addition & 0 deletions src/GitHubVulnerabilities2v3/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ protected void ConfigureCollectorServices(ContainerBuilder containerBuilder)
return new AzureStorageFactory(
ctx.Resolve<BlobServiceClient>(),
ctx.Resolve<GitHubVulnerabilities2v3Configuration>().V3VulnerabilityContainerName,
enablePublicAccess: true,
ctx.Resolve<ILogger<AzureStorage>>());
})
.As<StorageFactory>()
Expand Down
5 changes: 4 additions & 1 deletion src/Stats.PostProcessReports/Job.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// 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.Threading.Tasks;
Expand Down Expand Up @@ -50,6 +50,7 @@ protected override void ConfigureAutofacServices(ContainerBuilder containerBuild
var factory = new AzureStorageFactory(
c.Resolve<BlobServiceClient>(),
cfg.SourceContainerName,
enablePublicAccess: false,
c.Resolve<ILogger<AzureStorage>>(),
cfg.SourcePath + cfg.DetailedReportDirectoryName,
initializeContainer: false);
Expand All @@ -66,6 +67,7 @@ protected override void ConfigureAutofacServices(ContainerBuilder containerBuild
var factory = new AzureStorageFactory(
c.Resolve<BlobServiceClient>(),
cfg.WorkContainerName,
enablePublicAccess: false,
c.Resolve<ILogger<AzureStorage>>(),
cfg.WorkPath,
initializeContainer: false);
Expand All @@ -82,6 +84,7 @@ protected override void ConfigureAutofacServices(ContainerBuilder containerBuild
var factory = new AzureStorageFactory(
c.Resolve<BlobServiceClient>(),
cfg.DestinationContainerName,
enablePublicAccess: true,
c.Resolve<ILogger<AzureStorage>>(),
cfg.DestinationPath,
initializeContainer: false);
Expand Down
6 changes: 5 additions & 1 deletion src/Validation.PackageSigning.ProcessSignature/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ protected override void ConfigureJobServices(IServiceCollection services, IConfi
var config = p.GetRequiredService<IOptionsSnapshot<CertificateStoreConfiguration>>().Value;
var targetStorageAccount = new BlobServiceClient(AzureStorageFactory.PrepareConnectionString(config.DataStorageAccount));

var storageFactory = new AzureStorageFactory(targetStorageAccount, config.ContainerName, LoggerFactory.CreateLogger<AzureStorage>());
var storageFactory = new AzureStorageFactory(
targetStorageAccount,
config.ContainerName,
enablePublicAccess: false,
LoggerFactory.CreateLogger<AzureStorage>());
var storage = storageFactory.Create();

return new CertificateStore(storage, LoggerFactory.CreateLogger<CertificateStore>());
Expand Down
6 changes: 5 additions & 1 deletion src/Validation.PackageSigning.ValidateCertificate/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ protected override void ConfigureJobServices(IServiceCollection services, IConfi
var config = p.GetRequiredService<IOptionsSnapshot<CertificateStoreConfiguration>>().Value;
var targetStorageAccount = new BlobServiceClient(AzureStorageFactory.PrepareConnectionString(config.DataStorageAccount));

var storageFactory = new AzureStorageFactory(targetStorageAccount, config.ContainerName, LoggerFactory.CreateLogger<AzureStorage>());
var storageFactory = new AzureStorageFactory(
targetStorageAccount,
config.ContainerName,
enablePublicAccess: false,
LoggerFactory.CreateLogger<AzureStorage>());
var storage = storageFactory.Create();

return new CertificateStore(storage, LoggerFactory.CreateLogger<CertificateStore>());
Expand Down

0 comments on commit d8c3780

Please sign in to comment.