Skip to content

Commit

Permalink
Update nugets to latest (due to CVEs)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartpa committed Jan 18, 2024
1 parent 4a1b7f2 commit 64a7490
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 33 deletions.
4 changes: 2 additions & 2 deletions Samples/Dapper/ElasticDapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" version="2.3.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="Dapper" Version="2.0.90" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageReference Include="Dapper" Version="2.1.28" />
<PackageReference Include="DapperExtensions" Version="1.7.0" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/EFCodeFirst/EntityFrameworkCodeFirst.csproj
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>
<TargetFrameworks>net6.0</TargetFrameworks>
<OutputType>Exe</OutputType>
Expand All @@ -8,7 +8,7 @@
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageReference Include="EntityFramework" Version="6.4.4" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/EFMultiTenant/EntityFrameworkMultiTenant.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageReference Include="EntityFramework" Version="6.4.4" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<None Include="LICENSE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('strongname.props'))" />

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="3.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('build.props'))" />
<Import Project="$([MSBuild]::GetPathOfFileAbove('strongname.props'))" />
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="3.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.5" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('build.props'))" />
<Import Project="$([MSBuild]::GetPathOfFileAbove('strongname.props'))" />
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="3.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.5" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.5" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Src\ElasticScale.Client\Microsoft.Azure.SqlDatabase.ElasticScale.Client.csproj" />
Expand Down
6 changes: 4 additions & 2 deletions Test/ElasticScale.Query.UnitTests/MultiShardTestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ internal static class MultiShardTestUtils
/// <summary>
/// Connection string for local shard user.
/// </summary>
internal static string ShardConnectionString = @"Integrated Security=SSPI;";
internal static string ShardConnectionString = @"Integrated Security=SSPI;TrustServerCertificate=True;";

/// <summary>
/// Connection string for global shard map manager operations.
/// </summary>
internal static string ShardMapManagerConnectionString = @"Data Source=localhost;Initial Catalog=ShardMapManager;Integrated Security=SSPI;";
internal static string ShardMapManagerConnectionString = @"Data Source=localhost;Initial Catalog=ShardMapManager;Integrated Security=SSPI;TrustServerCertificate=True;";

/// <summary>
/// Name of the database where the ShardMapManager persists its data.
Expand Down Expand Up @@ -214,6 +214,8 @@ private static string GetTestConnectionString(string database)
builder.DataSource = s_serverLocation;
builder.IntegratedSecurity = true;
builder.InitialCatalog = database;
builder.TrustServerCertificate = true;

return builder.ConnectionString;
}

Expand Down
14 changes: 7 additions & 7 deletions Test/ElasticScale.ShardManagement.UnitTests/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ internal static class Globals
/// <summary>
/// Connection string for global shard map manager for Integrated Auth
/// </summary>
private const string ShardMapManagerConnString = ShardMapManagerConnStringBase + "Integrated Security=SSPI;";
private const string ShardMapManagerConnString = ShardMapManagerConnStringBase + "Integrated Security=SSPI;TrustServerCertificate=True;";

/// <summary>
/// Connection string for global shard map manager for Sql Auth
/// </summary>
private const string ShardMapManagerConnStringForSqlAuth = ShardMapManagerConnStringBase + "Integrated Security=False;";
private const string ShardMapManagerConnStringForSqlAuth = ShardMapManagerConnStringBase + "Integrated Security=False;TrustServerCertificate=True;";

/// <summary>
/// Connect string for local shard user.
/// </summary>
private const string ShardUserConnString = @"Integrated Security=SSPI;";
private const string ShardUserConnString = @"Integrated Security=SSPI;TrustServerCertificate=True;";

/// <summary>
/// Connect string for local shard user.
/// </summary>
private const string ShardUserConnStringForSqlAuth = @"User={0};Password={1}";
private const string ShardUserConnStringForSqlAuth = @"User={0};Password={1};TrustServerCertificate=True;";

/// <summary>
/// shardMapManager datasource name for unit tests.
Expand All @@ -57,7 +57,7 @@ internal static class Globals
/// <summary>
/// Connection string for connecting to test server.
/// </summary>
internal const string ShardMapManagerTestConnectionString = @"Data Source=" + Globals.ShardMapManagerTestsDatasourceName + ";Integrated Security=SSPI;";
internal const string ShardMapManagerTestConnectionString = @"Data Source=" + Globals.ShardMapManagerTestsDatasourceName + ";Integrated Security=SSPI;TrustServerCertificate=True;";

/// <summary>
/// Query to create database.
Expand Down Expand Up @@ -111,13 +111,13 @@ internal static string ShardMapManagerConnectionString
/// <summary>
/// SMM shard connection string.
/// </summary>
internal static string ShardUserConnectionStringForSqlAuth(string username) =>
internal static string ShardUserConnectionStringForSqlAuth(string username) =>
string.Format(Globals.ShardUserConnStringForSqlAuth, username, SqlLoginTestPassword);

/// <summary>
/// The shard user credential for sql auth.
/// </summary>
internal static SqlCredential ShardUserCredentialForSqlAuth(string username) =>
internal static SqlCredential ShardUserCredentialForSqlAuth(string username) =>
new SqlCredential(username, GenerateSecureString(SqlLoginTestPassword));

/// <summary>
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>
<TargetFrameworks>net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
Expand All @@ -8,9 +8,9 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('strongname.props'))" />
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.5" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Src\ElasticScale.Client\Microsoft.Azure.SqlDatabase.ElasticScale.Client.csproj" />
Expand Down
10 changes: 5 additions & 5 deletions Test/ElasticScale.ShardManagement.UnitTests/ScenarioTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,14 @@ public void BasicScenarioDefaultShardMaps()
{
// Also verify we can connect to the shard with Sql Auth, and Sql Auth using a secure credential
using (shardForConnection.OpenConnectionAsync(
string.Empty,
"TrustServerCertificate=True;",
Globals.ShardUserCredentialForSqlAuth(sqlAuthLogin.UniquifiedUserName),
ConnectionOptions.None).Result)
{
}

using (shardForConnection.OpenConnectionAsync(
string.Empty,
"TrustServerCertificate=True;",
Globals.ShardUserCredentialForSqlAuth(sqlAuthLogin.UniquifiedUserName)).Result)
{
}
Expand Down Expand Up @@ -1142,7 +1142,7 @@ public void BasicScenarioRangeShardMaps()
// Cover the OpenConnectionForKey overloads
using (SqlConnection conn = newMultiTenantShardMap.OpenConnectionForKey(
20,
string.Empty,
"TrustServerCertificate=True;",
Globals.ShardUserCredentialForSqlAuth(sqlAuthLogin.UniquifiedUserName)))
{
}
Expand Down Expand Up @@ -1237,15 +1237,15 @@ public void BasicScenarioRangeShardMaps()
// Cover the OpenConnectionForKeyAsync overloads
using (SqlConnection conn = multiTenantShardMap.OpenConnectionForKeyAsync(
20,
string.Empty,
"TrustServerCertificate=True;",
Globals.ShardUserCredentialForSqlAuth(sqlAuthLogin.UniquifiedUserName),
ConnectionOptions.None).Result)
{
}

using (SqlConnection conn = multiTenantShardMap.OpenConnectionForKeyAsync(
20,
string.Empty,
"TrustServerCertificate=True;",
Globals.ShardUserCredentialForSqlAuth(sqlAuthLogin.UniquifiedUserName)).Result)
{
}
Expand Down
4 changes: 2 additions & 2 deletions Test/ElasticScale.ShardManagement.UnitTests/ShardMapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ public void CreateShardDefault()
}

// Validate that we can connect to the shard using a secure Sql Auth Credential
using (sNew.OpenConnection(string.Empty, Globals.ShardUserCredentialForSqlAuth(sqlAuthLogin.UniquifiedUserName)))
using (sNew.OpenConnection("TrustServerCertificate=True;", Globals.ShardUserCredentialForSqlAuth(sqlAuthLogin.UniquifiedUserName)))
{
}

using (sNew.OpenConnection(
string.Empty,
"TrustServerCertificate=True;",
Globals.ShardUserCredentialForSqlAuth(sqlAuthLogin.UniquifiedUserName),
ConnectionOptions.Validate))
{
Expand Down

0 comments on commit 64a7490

Please sign in to comment.