Skip to content

Commit 8c9fa08

Browse files
committed
Merge branch 'master' into pr/217
2 parents 6f710b5 + 7c42c7f commit 8c9fa08

File tree

14 files changed

+228
-14
lines changed

14 files changed

+228
-14
lines changed

ElasticDatabaseTools.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26730.10
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29709.97
55
MinimumVisualStudioVersion = 10.0.40219.1
66
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}"
77
EndProject

SECURITY.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->
2+
3+
## Security
4+
5+
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/).
6+
7+
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.
8+
9+
## Reporting Security Issues
10+
11+
**Please do not report security vulnerabilities through public GitHub issues.**
12+
13+
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).
14+
15+
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).
16+
17+
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).
18+
19+
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:
20+
21+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
* Full paths of source file(s) related to the manifestation of the issue
23+
* The location of the affected source code (tag/branch/commit or direct URL)
24+
* Any special configuration required to reproduce the issue
25+
* Step-by-step instructions to reproduce the issue
26+
* Proof-of-concept or exploit code (if possible)
27+
* Impact of the issue, including how an attacker might exploit the issue
28+
29+
This information will help us triage your report more quickly.
30+
31+
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.
32+
33+
## Preferred Languages
34+
35+
We prefer all communications to be in English.
36+
37+
## Policy
38+
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
40+
41+
<!-- END MICROSOFT SECURITY.MD BLOCK -->

Samples/Dapper/ElasticDapper.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ItemGroup>
88
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
99
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
10-
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" version="2.0.0" />
10+
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" version="2.3.0" />
1111
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1212
<PackageReference Include="Dapper" Version="2.0.90" />
1313
<PackageReference Include="DapperExtensions" Version="1.7.0" />

Samples/EFCodeFirst/EntityFrameworkCodeFirst.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ItemGroup>
88
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
99
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
10-
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.0.0" />
10+
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
1111
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1212
<PackageReference Include="EntityFramework" Version="6.4.4" />
1313
</ItemGroup>

Samples/EFMultiTenant/EntityFrameworkMultiTenant.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net5.0</TargetFrameworks>
44
<OutputType>Exe</OutputType>
@@ -7,7 +7,7 @@
77
<ItemGroup>
88
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
99
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
10-
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.0.0" />
10+
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
1111
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1212
<PackageReference Include="EntityFramework" Version="6.4.4" />
1313
</ItemGroup>
@@ -20,4 +20,4 @@
2020
<Content Include="EnableRLS.sql" />
2121
<Content Include="RemoveRLS.sql" />
2222
</ItemGroup>
23-
</Project>
23+
</Project>

Samples/ElasticScaleStarterKit/ElasticScaleStarterKit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ItemGroup>
88
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
99
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
10-
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.0.0" />
10+
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
1111
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1212
</ItemGroup>
1313
<ItemGroup>

Samples/ShardSqlCmd/ShardSqlCmd.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<TargetFrameworks>net5.0</TargetFrameworks>
45
<OutputType>Exe</OutputType>
@@ -10,4 +11,4 @@
1011
<ItemGroup>
1112
<None Include="LICENSE" />
1213
</ItemGroup>
13-
</Project>
14+
</Project>

Src/ElasticScale.Client/Microsoft.Azure.SqlDatabase.ElasticScale.Client.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageReleaseNotes>Updated to net5.0 and migrated from System.Data.SqlClient to Microsoft.Data.SqlClient.</PackageReleaseNotes>
1313
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
1414
<PackageProjectUrl>https://github.com/Azure/elastic-db-tools</PackageProjectUrl>
15-
<PackageLicenseUrl>https://github.com/Azure/elastic-db-tools/blob/master/LICENSE</PackageLicenseUrl>
15+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1616
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1717
<RepositoryType>git</RepositoryType>
1818
<RepositoryUrl>https://github.com/Azure/elastic-db-tools</RepositoryUrl>
@@ -28,6 +28,7 @@
2828
</ItemGroup>
2929

3030
<ItemGroup>
31+
<None Include="Properties\Icon.png" Pack="true" PackagePath="\"/>
3132
<Compile Update="ShardManagement\Errors.Designer.cs">
3233
<DesignTime>True</DesignTime>
3334
<AutoGen>True</AutoGen>
@@ -51,4 +52,10 @@
5152
</EmbeddedResource>
5253
</ItemGroup>
5354

55+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
56+
<PackageReference Include="Microsoft.Data.SqlClient">
57+
<Version>2.1.2</Version>
58+
</PackageReference>
59+
</ItemGroup>
60+
5461
</Project>

Src/ElasticScale.Client/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[assembly: InternalsVisibleTo("Microsoft.Azure.SqlDatabase.ElasticScale.Query.UnitTests, PublicKey=00240000048000009400000006020000002400005253413100040000010001007d813b35eaf89b7ae4be8a49086058380e083b58752b0a3a8323157e68b4b0f9fd78d2fe75e9ec253d8bb2225637d4c2393234e0f877bfddd7907eda8293083b7f4dbc664f09f6b62ce74266a4e79002783252559f5b23cfc682eb79b51a5f5d16dca2364413ae563b3ab6db2fc9da3ced11f9eef50421b982dfc3a08cb635a8")]
1515
[assembly: InternalsVisibleTo("Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.UnitTests, PublicKey=00240000048000009400000006020000002400005253413100040000010001007d813b35eaf89b7ae4be8a49086058380e083b58752b0a3a8323157e68b4b0f9fd78d2fe75e9ec253d8bb2225637d4c2393234e0f877bfddd7907eda8293083b7f4dbc664f09f6b62ce74266a4e79002783252559f5b23cfc682eb79b51a5f5d16dca2364413ae563b3ab6db2fc9da3ced11f9eef50421b982dfc3a08cb635a8")]
1616

17-
[assembly: CLSCompliant(true)]
17+
//[assembly: CLSCompliant(true)]
1818

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

393 Bytes
Loading

Src/ElasticScale.Client/ShardManagement/ShardMap/ShardMapUtils.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ internal static class ShardMapUtils
3939
/// because it may not be available in the .NET framework version that we are running in
4040
/// </summary>
4141
internal static readonly string ActiveDirectoryInteractiveStr = "ActiveDirectoryInteractive";
42+
internal static readonly string ActiveDirectoryServicePrincipal = "ActiveDirectoryServicePrincipal";
43+
internal static readonly string ActiveDirectoryDeviceCodeFlow = "ActiveDirectoryDeviceCodeFlow";
44+
internal static readonly string ActiveDirectoryManagedIdentity = "ActiveDirectoryManagedIdentity";
45+
internal static readonly string ActiveDirectoryMSI = "ActiveDirectoryMSI";
4246

4347
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
4448
static ShardMapUtils()

Src/ElasticScale.Client/ShardManagement/SqlStore/SqlShardMapManagerCredentials.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,12 @@ internal static void EnsureCredentials(
162162
{
163163
string authentication = connectionString[ShardMapUtils.Authentication].ToString();
164164
if (authentication.Equals(ShardMapUtils.ActiveDirectoryIntegratedStr, StringComparison.OrdinalIgnoreCase)
165-
|| authentication.Equals(ShardMapUtils.ActiveDirectoryInteractiveStr, StringComparison.OrdinalIgnoreCase))
165+
|| authentication.Equals(ShardMapUtils.ActiveDirectoryInteractiveStr, StringComparison.OrdinalIgnoreCase)
166+
|| authentication.Equals(ShardMapUtils.ActiveDirectoryManagedIdentity, StringComparison.OrdinalIgnoreCase)
167+
|| authentication.Equals(ShardMapUtils.ActiveDirectoryServicePrincipal, StringComparison.OrdinalIgnoreCase)
168+
|| authentication.Equals(ShardMapUtils.ActiveDirectoryDeviceCodeFlow, StringComparison.OrdinalIgnoreCase)
169+
|| authentication.Equals(ShardMapUtils.ActiveDirectoryMSI, StringComparison.OrdinalIgnoreCase)
170+
)
166171
{
167172
return;
168173
}

Src/ElasticScale.Client/ShardManagement/Utils/ExceptionUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ internal static ShardManagementException GetStoreExceptionGlobal(
9696
category,
9797
ShardManagementErrorCode.StorageOperationFailure,
9898
Errors._Store_SqlExceptionGlobal,
99-
storeException.InnerException != null ? storeException.InnerException.Message : storeException.Message,
10099
storeException,
100+
storeException.InnerException != null ? storeException.InnerException.Message : storeException.Message,
101101
operationName);
102102
}
103103

azure-pipelines.yml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# .NET Desktop
2+
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
3+
# Add steps that publish symbols, save build artifacts, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
5+
6+
trigger:
7+
- master
8+
9+
pool:
10+
vmImage: 'windows-latest'
11+
12+
variables:
13+
solution: '**/*.sln'
14+
buildPlatform: 'Any CPU'
15+
buildConfiguration: 'Release'
16+
17+
steps:
18+
- task: NuGetToolInstaller@1
19+
20+
- task: NuGetCommand@2
21+
inputs:
22+
restoreSolution: '$(solution)'
23+
24+
- task: VSBuild@1
25+
inputs:
26+
solution: '$(solution)'
27+
platform: '$(buildPlatform)'
28+
configuration: '$(buildConfiguration)'
29+
30+
# - task: VSTest@2
31+
# inputs:
32+
# platform: '$(buildPlatform)'
33+
# configuration: '$(buildConfiguration)'
34+
35+
- task: EsrpCodeSigning@2
36+
displayName: ESRP CodeSigning - *.dll
37+
inputs:
38+
ConnectedServiceName: 'Code Signing'
39+
FolderPath: src
40+
Pattern: '*.dll'
41+
signConfigType: 'inlineSignParams'
42+
inlineOperation: |
43+
[
44+
{
45+
"keyCode": "CP-230012",
46+
"operationSetCode": "SigntoolSign",
47+
"parameters": [
48+
{
49+
"parameterName": "OpusName",
50+
"parameterValue": "Microsoft"
51+
},
52+
{
53+
"parameterName": "OpusInfo",
54+
"parameterValue": "http://www.microsoft.com"
55+
},
56+
{
57+
"parameterName": "PageHash",
58+
"parameterValue": "/NPH"
59+
},
60+
{
61+
"parameterName": "FileDigest",
62+
"parameterValue": "/fd sha256"
63+
},
64+
{
65+
"parameterName": "TimeStamp",
66+
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
67+
}
68+
],
69+
"toolName": "signtool.exe",
70+
"toolVersion": "6.2.9304.0"
71+
},
72+
{
73+
"keyCode": "CP-230012",
74+
"operationSetCode": "SigntoolVerify",
75+
"parameters": [
76+
{
77+
"parameterName": "VerifyAll",
78+
"parameterValue": "/all"
79+
}
80+
],
81+
"toolName": "signtool.exe",
82+
"toolVersion": "6.2.9304.0"
83+
}
84+
]
85+
SessionTimeout: '60'
86+
MaxConcurrency: '50'
87+
MaxRetryAttempts: '5'
88+
89+
- task: DotNetCoreCLI@2
90+
name: DotNetCoreCLI3
91+
displayName: dotnet pack
92+
inputs:
93+
command: pack
94+
searchPatternPack: Src/**/*.csproj
95+
outputDir: $(Build.ArtifactStagingDirectory)\pkg
96+
nobuild: true
97+
98+
- task: EsrpCodeSigning@2
99+
displayName: ESRP CodeSigning - *.nupkg
100+
inputs:
101+
ConnectedServiceName: 'Code Signing'
102+
FolderPath: $(Build.ArtifactStagingDirectory)\pkg
103+
Pattern: '*.nupkg'
104+
signConfigType: 'inlineSignParams'
105+
inlineOperation: |
106+
[
107+
{
108+
"keyCode": "CP-401405",
109+
"operationSetCode": "NuGetSign",
110+
"parameters": [
111+
{
112+
"parameterName": "OpusName",
113+
"parameterValue": "Microsoft"
114+
},
115+
{
116+
"parameterName": "OpusInfo",
117+
"parameterValue": "http://www.microsoft.com"
118+
},
119+
{
120+
"parameterName": "PageHash",
121+
"parameterValue": "/NPH"
122+
},
123+
{
124+
"parameterName": "FileDigest",
125+
"parameterValue": "/fd sha256"
126+
},
127+
{
128+
"parameterName": "TimeStamp",
129+
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
130+
}
131+
],
132+
"toolName": "signtool.exe",
133+
"toolVersion": "6.2.9304.0"
134+
},
135+
{
136+
"keyCode": "CP-401405",
137+
"operationSetCode": "NuGetVerify",
138+
"parameters": [
139+
{
140+
"parameterName": "VerifyAll",
141+
"parameterValue": "/all"
142+
}
143+
],
144+
"toolName": "signtool.exe",
145+
"toolVersion": "6.2.9304.0"
146+
}
147+
]
148+
SessionTimeout: '60'
149+
MaxConcurrency: '50'
150+
MaxRetryAttempts: '5'
151+
152+
- task: PublishPipelineArtifact@1
153+
displayName: 'Publish release'
154+
inputs:
155+
targetPath: $(Build.ArtifactStagingDirectory)
156+
artifactName: ElasticScaleClientLibrary

0 commit comments

Comments
 (0)