Skip to content

Commit

Permalink
Merge branch 'master' into pr/217
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartpa committed Oct 6, 2023
2 parents 6f710b5 + 7c42c7f commit 8c9fa08
Show file tree
Hide file tree
Showing 14 changed files with 228 additions and 14 deletions.
4 changes: 2 additions & 2 deletions ElasticDatabaseTools.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.10
# Visual Studio Version 16
VisualStudioVersion = 16.0.29709.97
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.SqlDatabase.ElasticScale.Client", "Src\ElasticScale.Client\Microsoft.Azure.SqlDatabase.ElasticScale.Client.csproj", "{4C3B3EC4-5702-469E-800E-313FB27A0A2B}"
EndProject
Expand Down
41 changes: 41 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).

If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
2 changes: 1 addition & 1 deletion Samples/Dapper/ElasticDapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<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.0.0" />
<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="DapperExtensions" Version="1.7.0" />
Expand Down
2 changes: 1 addition & 1 deletion Samples/EFCodeFirst/EntityFrameworkCodeFirst.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<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.0.0" />
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="EntityFramework" Version="6.4.4" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Samples/EFMultiTenant/EntityFrameworkMultiTenant.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>net5.0</TargetFrameworks>
<OutputType>Exe</OutputType>
Expand All @@ -7,7 +7,7 @@
<ItemGroup>
<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.0.0" />
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="EntityFramework" Version="6.4.4" />
</ItemGroup>
Expand All @@ -20,4 +20,4 @@
<Content Include="EnableRLS.sql" />
<Content Include="RemoveRLS.sql" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<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.0.0" />
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions Samples/ShardSqlCmd/ShardSqlCmd.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0</TargetFrameworks>
<OutputType>Exe</OutputType>
Expand All @@ -10,4 +11,4 @@
<ItemGroup>
<None Include="LICENSE" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageReleaseNotes>Updated to net5.0 and migrated from System.Data.SqlClient to Microsoft.Data.SqlClient.</PackageReleaseNotes>
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
<PackageProjectUrl>https://github.com/Azure/elastic-db-tools</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/Azure/elastic-db-tools/blob/master/LICENSE</PackageLicenseUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/Azure/elastic-db-tools</RepositoryUrl>
Expand All @@ -28,6 +28,7 @@
</ItemGroup>

<ItemGroup>
<None Include="Properties\Icon.png" Pack="true" PackagePath="\"/>
<Compile Update="ShardManagement\Errors.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
Expand All @@ -51,4 +52,10 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.Data.SqlClient">
<Version>2.1.2</Version>
</PackageReference>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Src/ElasticScale.Client/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[assembly: InternalsVisibleTo("Microsoft.Azure.SqlDatabase.ElasticScale.Query.UnitTests, PublicKey=00240000048000009400000006020000002400005253413100040000010001007d813b35eaf89b7ae4be8a49086058380e083b58752b0a3a8323157e68b4b0f9fd78d2fe75e9ec253d8bb2225637d4c2393234e0f877bfddd7907eda8293083b7f4dbc664f09f6b62ce74266a4e79002783252559f5b23cfc682eb79b51a5f5d16dca2364413ae563b3ab6db2fc9da3ced11f9eef50421b982dfc3a08cb635a8")]
[assembly: InternalsVisibleTo("Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.UnitTests, PublicKey=00240000048000009400000006020000002400005253413100040000010001007d813b35eaf89b7ae4be8a49086058380e083b58752b0a3a8323157e68b4b0f9fd78d2fe75e9ec253d8bb2225637d4c2393234e0f877bfddd7907eda8293083b7f4dbc664f09f6b62ce74266a4e79002783252559f5b23cfc682eb79b51a5f5d16dca2364413ae563b3ab6db2fc9da3ced11f9eef50421b982dfc3a08cb635a8")]

[assembly: CLSCompliant(true)]
//[assembly: CLSCompliant(true)]

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1824:MarkAssembliesWithNeutralResourcesLanguage", Justification = "Too many dubious spelling errors.")]

Expand Down
Binary file added Src/ElasticScale.Client/Properties/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ internal static class ShardMapUtils
/// because it may not be available in the .NET framework version that we are running in
/// </summary>
internal static readonly string ActiveDirectoryInteractiveStr = "ActiveDirectoryInteractive";
internal static readonly string ActiveDirectoryServicePrincipal = "ActiveDirectoryServicePrincipal";
internal static readonly string ActiveDirectoryDeviceCodeFlow = "ActiveDirectoryDeviceCodeFlow";
internal static readonly string ActiveDirectoryManagedIdentity = "ActiveDirectoryManagedIdentity";
internal static readonly string ActiveDirectoryMSI = "ActiveDirectoryMSI";

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
static ShardMapUtils()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ internal static void EnsureCredentials(
{
string authentication = connectionString[ShardMapUtils.Authentication].ToString();
if (authentication.Equals(ShardMapUtils.ActiveDirectoryIntegratedStr, StringComparison.OrdinalIgnoreCase)
|| authentication.Equals(ShardMapUtils.ActiveDirectoryInteractiveStr, StringComparison.OrdinalIgnoreCase))
|| authentication.Equals(ShardMapUtils.ActiveDirectoryInteractiveStr, StringComparison.OrdinalIgnoreCase)
|| authentication.Equals(ShardMapUtils.ActiveDirectoryManagedIdentity, StringComparison.OrdinalIgnoreCase)
|| authentication.Equals(ShardMapUtils.ActiveDirectoryServicePrincipal, StringComparison.OrdinalIgnoreCase)
|| authentication.Equals(ShardMapUtils.ActiveDirectoryDeviceCodeFlow, StringComparison.OrdinalIgnoreCase)
|| authentication.Equals(ShardMapUtils.ActiveDirectoryMSI, StringComparison.OrdinalIgnoreCase)
)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ internal static ShardManagementException GetStoreExceptionGlobal(
category,
ShardManagementErrorCode.StorageOperationFailure,
Errors._Store_SqlExceptionGlobal,
storeException.InnerException != null ? storeException.InnerException.Message : storeException.Message,
storeException,
storeException.InnerException != null ? storeException.InnerException.Message : storeException.Message,
operationName);
}

Expand Down
156 changes: 156 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

trigger:
- master

pool:
vmImage: 'windows-latest'

variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'

- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

# - task: VSTest@2
# inputs:
# platform: '$(buildPlatform)'
# configuration: '$(buildConfiguration)'

- task: EsrpCodeSigning@2
displayName: ESRP CodeSigning - *.dll
inputs:
ConnectedServiceName: 'Code Signing'
FolderPath: src
Pattern: '*.dll'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd sha256"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [
{
"parameterName": "VerifyAll",
"parameterValue": "/all"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'

- task: DotNetCoreCLI@2
name: DotNetCoreCLI3
displayName: dotnet pack
inputs:
command: pack
searchPatternPack: Src/**/*.csproj
outputDir: $(Build.ArtifactStagingDirectory)\pkg
nobuild: true

- task: EsrpCodeSigning@2
displayName: ESRP CodeSigning - *.nupkg
inputs:
ConnectedServiceName: 'Code Signing'
FolderPath: $(Build.ArtifactStagingDirectory)\pkg
Pattern: '*.nupkg'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd sha256"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
},
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetVerify",
"parameters": [
{
"parameterName": "VerifyAll",
"parameterValue": "/all"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'

- task: PublishPipelineArtifact@1
displayName: 'Publish release'
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifactName: ElasticScaleClientLibrary

0 comments on commit 8c9fa08

Please sign in to comment.