Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/saars/upgrade packages to avoid vulnerable #376

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
</PropertyGroup>

<ItemGroup>
<!-- Explicit reference Microsoft.AspNetCore.Hosting even though it would be brought in by dependencies. -->
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.7" />

<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Features>IOperation</Features>
</PropertyGroup>
Expand All @@ -18,15 +18,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="KubernetesClient" Version="12.1.1" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.21.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="3.1.27" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.4" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.6.2" />
<PackageReference Include="KubernetesClient" />
<PackageReference Include="Microsoft.ApplicationInsights" />
<PackageReference Include="Microsoft.Extensions.Configuration" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<Project>
<!-- <Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> -->
<!--Build-->
<PropertyGroup>
Expand Down Expand Up @@ -32,7 +32,7 @@
<RepositoryType />
</PropertyGroup>
<ItemGroup Condition=" '$(IsCIBuild)' == 'true' ">
<PackageReference Include="MicroBuild.Core" Version="0.3.0">
<PackageReference Include="MicroBuild.Core">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
19 changes: 19 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="KubernetesClient" Version="12.1.1" />
<PackageVersion Include="MicroBuild.Core" Version="0.3.0" />
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageVersion Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.DiagnosticAdapter" Version="3.1.32" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.3.0" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions tests/UnitTests/PodInfoManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task GetMyPodAsyncShouldGetCorrectPod()
containerIdHolderMock.Setup(c => c.ContainerId).Returns("containerId");

PodInfoManager target = new PodInfoManager(k8sQueryClientMock.Object, containerIdHolderMock.Object, new IPodNameProvider[] { podNameProviderMock.Object });
V1Pod result = await target.GetMyPodAsync(default).ConfigureAwait(false);
V1Pod result = await target.GetMyPodAsync(default);

Assert.NotNull(result);
Assert.Single(result.Status.ContainerStatuses);
Expand All @@ -58,7 +58,7 @@ public async Task GetMyPodAsyncShouldLeveragePodNameProviders()
k8sQueryClientMock.Setup(c => c.GetPodByNameAsync(It.IsAny<string>(), It.IsAny<CancellationToken>())).Returns(Task.FromResult(podsArray.FirstOrDefault(item => item.Metadata.Name == providerPodName)));

PodInfoManager target = new PodInfoManager(k8sQueryClientMock.Object, containerIdHolderMock.Object, new IPodNameProvider[] { podNameProviderMock.Object });
V1Pod result = await target.GetMyPodAsync(default).ConfigureAwait(false);
V1Pod result = await target.GetMyPodAsync(default);

Assert.NotNull(result);
Assert.Single(result.Status.ContainerStatuses);
Expand Down Expand Up @@ -88,7 +88,7 @@ public async Task GetMyPodAsyncShouldFallbackToUseContainerIdWhenProvidedPodName
containerIdHolderMock.Setup(c => c.ContainerId).Returns(targetContainerId);

PodInfoManager target = new PodInfoManager(k8sQueryClientMock.Object, containerIdHolderMock.Object, new IPodNameProvider[] { podNameProviderMock.Object });
V1Pod result = await target.GetMyPodAsync(default).ConfigureAwait(false);
V1Pod result = await target.GetMyPodAsync(default);

Assert.NotNull(result);
Assert.Single(result.Status.ContainerStatuses);
Expand Down Expand Up @@ -119,7 +119,7 @@ public async Task GetMyPodAsyncShouldSupportMultipleIPodNameProviders()
podNameProviderMock2.Setup(p => p.TryGetPodName(out providerPodName2)).Returns(true); // the provider returns true with pod name.

PodInfoManager target = new PodInfoManager(k8sQueryClientMock.Object, containerIdHolderMock.Object, new IPodNameProvider[] { podNameProviderMock.Object, podNameProviderMock2.Object });
V1Pod result = await target.GetMyPodAsync(default).ConfigureAwait(false);
V1Pod result = await target.GetMyPodAsync(default);

Assert.NotNull(result);
Assert.Single(result.Status.ContainerStatuses);
Expand Down
2 changes: 1 addition & 1 deletion tests/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="Moq" Version="4.*" />
<PackageReference Include="xunit" Version="2.8.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.*" />
Expand Down