Skip to content

Commit 9c88a6d

Browse files
authored
Shrink Gallery secret caching to 6 hours and update dependencies. (#7873)
* Shrink to 6 hours and update dependencies * Remove comment
1 parent 986b752 commit 9c88a6d

10 files changed

Lines changed: 21 additions & 18 deletions

File tree

src/AccountDeleter/AccountDeleter.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<PrivateAssets>all</PrivateAssets>
108108
</PackageReference>
109109
<PackageReference Include="NuGet.Services.Validation.Common.Job">
110-
<Version>4.3.0-dev-3453620</Version>
110+
<Version>4.3.0-dev-3555917</Version>
111111
</PackageReference>
112112
</ItemGroup>
113113
<ItemGroup>

src/AccountDeleter/Job.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
namespace NuGetGallery.AccountDeleter
3232
{
33-
public class Job : SubcriptionProcessorJob<AccountDeleteMessage>
33+
public class Job : SubscriptionProcessorJob<AccountDeleteMessage>
3434
{
3535
private const string AccountDeleteConfigurationSectionName = "AccountDeleteSettings";
3636
private const string DebugArgumentName = "Debug";

src/DatabaseMigrationTools/DatabaseMigrationTools.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<PrivateAssets>all</PrivateAssets>
6565
</PackageReference>
6666
<PackageReference Include="NuGet.Services.Validation">
67-
<Version>2.70.0</Version>
67+
<Version>2.71.0</Version>
6868
</PackageReference>
6969
</ItemGroup>
7070
<ItemGroup>

src/GitHubVulnerabilities2Db/GitHubVulnerabilities2Db.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@
8686
<PrivateAssets>all</PrivateAssets>
8787
</PackageReference>
8888
<PackageReference Include="NuGet.Jobs.Common">
89-
<Version>4.3.0-dev-3453620</Version>
89+
<Version>4.3.0-dev-3555917</Version>
9090
</PackageReference>
9191
<PackageReference Include="NuGet.Services.Cursor">
92-
<Version>2.70.0</Version>
92+
<Version>2.71.0</Version>
9393
</PackageReference>
9494
</ItemGroup>
9595
<ItemGroup>

src/NuGet.Services.DatabaseMigration/NuGet.Services.DatabaseMigration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<Version>4.8.0</Version>
7878
</PackageReference>
7979
<PackageReference Include="NuGet.Jobs.Common">
80-
<Version>4.3.0-dev-3453620</Version>
80+
<Version>4.3.0-dev-3555917</Version>
8181
</PackageReference>
8282
</ItemGroup>
8383
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

src/NuGetGallery.Core/NuGetGallery.Core.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,16 @@
242242
</ItemGroup>
243243
<ItemGroup>
244244
<PackageReference Include="NuGet.Services.FeatureFlags">
245-
<Version>2.70.0</Version>
245+
<Version>2.71.0</Version>
246246
</PackageReference>
247247
<PackageReference Include="NuGet.Services.Messaging.Email">
248-
<Version>2.70.0</Version>
248+
<Version>2.71.0</Version>
249249
</PackageReference>
250250
<PackageReference Include="NuGet.Services.Validation">
251-
<Version>2.70.0</Version>
251+
<Version>2.71.0</Version>
252252
</PackageReference>
253253
<PackageReference Include="NuGet.Services.Validation.Issues">
254-
<Version>2.70.0</Version>
254+
<Version>2.71.0</Version>
255255
</PackageReference>
256256
<PackageReference Include="NuGet.StrongName.AnglicanGeek.MarkdownMailer">
257257
<Version>1.2.0</Version>

src/NuGetGallery.Services/Configuration/ConfigurationService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public class ConfigurationService : IGalleryConfigurationService, IConfiguration
3131
private readonly Lazy<FeatureConfiguration> _lazyFeatureConfiguration;
3232
private readonly Lazy<IServiceBusConfiguration> _lazyServiceBusConfiguration;
3333
private readonly Lazy<IPackageDeleteConfiguration> _lazyPackageDeleteConfiguration;
34-
private readonly HashSet<string> _NotInjectedSettingNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase) {
34+
35+
private static readonly HashSet<string> NotInjectedSettingNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase) {
3536
SettingPrefix + "SqlServer",
3637
SettingPrefix + "SqlServerReadOnlyReplica",
3738
SettingPrefix + "SupportRequestSqlServer",
@@ -140,7 +141,7 @@ public async Task<string> ReadSettingAsync(string settingName)
140141
{
141142
var value = ReadRawSetting(settingName);
142143

143-
if (!string.IsNullOrEmpty(value) && !_NotInjectedSettingNames.Contains(settingName))
144+
if (!string.IsNullOrEmpty(value) && !NotInjectedSettingNames.Contains(settingName))
144145
{
145146
value = await SecretInjector.InjectAsync(value);
146147
}

src/NuGetGallery.Services/Configuration/SecretReader/SecretReaderFactory.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public class SecretReaderFactory : ISecretReaderFactory
1717
internal const string CertificateThumbprintConfigurationKey = "CertificateThumbprint";
1818
internal const string CertificateStoreLocation = "StoreLocation";
1919
internal const string CertificateStoreName = "StoreName";
20+
21+
private const int SecretCachingRefreshInterval = 60 * 60 * 6;
2022
private IGalleryConfigurationService _configurationService;
2123

2224
public SecretReaderFactory(IGalleryConfigurationService configurationService)
@@ -71,7 +73,7 @@ public ISecretReader CreateSecretReader()
7173
secretReader = new EmptySecretReader();
7274
}
7375

74-
return new CachingSecretReader(secretReader);
76+
return new CachingSecretReader(secretReader, refreshIntervalSec: SecretCachingRefreshInterval);
7577
}
7678

7779
private bool GetOptionalKeyVaultBoolSettingValue(string settingName, bool defaultValue)

src/NuGetGallery.Services/NuGetGallery.Services.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@
294294
<Version>5.0.0-preview1.5665</Version>
295295
</PackageReference>
296296
<PackageReference Include="NuGet.Services.Configuration">
297-
<Version>2.70.0</Version>
297+
<Version>2.71.0</Version>
298298
</PackageReference>
299299
<PackageReference Include="NuGet.Services.Logging">
300-
<Version>2.70.0</Version>
300+
<Version>2.71.0</Version>
301301
</PackageReference>
302302
<PackageReference Include="NuGet.StrongName.WebBackgrounder">
303303
<Version>0.2.0</Version>

src/NuGetGallery/NuGetGallery.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,13 +2297,13 @@
22972297
<Version>5.0.0-preview1.5665</Version>
22982298
</PackageReference>
22992299
<PackageReference Include="NuGet.Services.Licenses">
2300-
<Version>2.70.0</Version>
2300+
<Version>2.71.0</Version>
23012301
</PackageReference>
23022302
<PackageReference Include="NuGet.Services.Owin">
2303-
<Version>2.70.0</Version>
2303+
<Version>2.71.0</Version>
23042304
</PackageReference>
23052305
<PackageReference Include="NuGet.Services.Sql">
2306-
<Version>2.70.0</Version>
2306+
<Version>2.71.0</Version>
23072307
</PackageReference>
23082308
<PackageReference Include="Owin">
23092309
<Version>1.0.0</Version>

0 commit comments

Comments
 (0)