Skip to content

Commit 4cfb77c

Browse files
committed
Merge remote-tracking branch 'Azure/dev' into dev
2 parents 7ae09c6 + 5d5b475 commit 4cfb77c

File tree

43 files changed

+1642
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1642
-13
lines changed

src/ResourceManager/KeyVault/Commands.KeyVault.Test/Scripts/Common.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,31 @@ function Get-ImportKeyFile([string]$filesuffix, [bool] $exists=$true)
8686
}
8787
}
8888

89+
<#
90+
.SYNOPSIS
91+
Get 1024 bit key file path to be imported
92+
#>
93+
function Get-ImportKeyFile1024([string]$filesuffix, [bool] $exists=$true)
94+
{
95+
if ($exists)
96+
{
97+
$file = "$filesuffix"+"test1024.$filesuffix"
98+
}
99+
else
100+
{
101+
$file = "notexist" + ".$filesuffix"
102+
}
103+
104+
if ($global:testEnv -eq 'BVT')
105+
{
106+
return Join-Path $invocationPath "bvtdata\$file"
107+
}
108+
else
109+
{
110+
return Join-Path $invocationPath "proddata\$file"
111+
}
112+
}
113+
89114
<#
90115
.SYNOPSIS
91116
Remove log file under a folder

src/ResourceManager/KeyVault/Commands.KeyVault.Test/Scripts/RunKeyVaultTests.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ Run-TestProtected { Run-KeyTest {Test_CreateSoftwareKeyWithCustomAttributes} "Te
7979
Run-TestProtected { Run-KeyTest {Test_CreateHsmKeyWithDefaultAttributes} "Test_CreateHsmKeyWithDefaultAttributes" } "Test_CreateHsmKeyWithDefaultAttributes"
8080
Run-TestProtected { Run-KeyTest {Test_CreateHsmKeyWithCustomAttributes} "Test_CreateHsmKeyWithCustomAttributes" } "Test_CreateHsmKeyWithCustomAttributes"
8181
Run-TestProtected { Run-KeyTest {Test_ImportPfxWithDefaultAttributes} "Test_ImportPfxWithDefaultAttributes" } "Test_ImportPfxWithDefaultAttributes"
82+
Run-TestProtected { Run-KeyTest {Test_ImportPfxWith1024BitKey} "Test_ImportPfxWith1024BitKey" } "Test_ImportPfxWith1024BitKey"
8283
Run-TestProtected { Run-KeyTest {Test_ImportPfxWithCustomAttributes} "Test_ImportPfxWithCustomAttributes" } "Test_ImportPfxWithCustomAttributes"
8384
Run-TestProtected { Run-KeyTest {Test_ImportPfxAsHsmWithDefaultAttributes} "Test_ImportPfxAsHsmWithDefaultAttributes" } "Test_ImportPfxAsHsmWithDefaultAttributes"
8485
Run-TestProtected { Run-KeyTest {Test_ImportPfxAsHsmWithCustomAttributes} "Test_ImportPfxAsHsmWithCustomAttributes" } "Test_ImportPfxAsHsmWithCustomAttributes"
8586
Run-TestProtected { Run-KeyTest {Test_ImportByokWithDefaultAttributes} "Test_ImportByokWithDefaultAttributes" } "Test_ImportByokWithDefaultAttributes"
87+
Run-TestProtected { Run-KeyTest {Test_ImportByokWith1024BitKey} "Test_ImportByokWith1024BitKey" } "Test_ImportByokWith1024BitKey"
8688
Run-TestProtected { Run-KeyTest {Test_ImportByokWithCustomAttributes} "Test_ImportByokWithCustomAttributes" } "Test_ImportByokWithCustomAttributes"
8789
Run-TestProtected { Run-KeyTest {Test_AddKeyPositionalParameter} "Test_AddKeyPositionalParameter" } "Test_AddKeyPositionalParameter"
8890
Run-TestProtected { Run-KeyTest {Test_AddKeyAliasParameter} "Test_AddKeyAliasParameter" } "Test_AddKeyAliasParameter"

src/ResourceManager/KeyVault/Commands.KeyVault.Test/Scripts/VaultKeyTests.ps1

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ $delta=[TimeSpan]::FromMinutes(2)
1010
$tags=@{"tag1"="value1"; "tag2"=""; "tag3"=$null}
1111
$newtags= @{"tag1"="value1"; "tag2"="value2"; "tag3"="value3"; "tag4"="value4"}
1212
$emptytags=@{}
13+
$defaultKeySizeInBytes = 256
1314

1415

1516

@@ -67,6 +68,7 @@ function Test_CreateSoftwareKeyWithDefaultAttributes
6768
Assert-NotNull $key
6869
$global:createdKeys += $keyname
6970
Assert-KeyAttributes $key.Attributes 'RSA' $true $null $null $null $null
71+
Assert-AreEqual $key.Key.N.Length $defaultKeySizeInBytes
7072
}
7173

7274
<#
@@ -95,6 +97,7 @@ function Test_CreateHsmKeyWithDefaultAttributes
9597
Assert-NotNull $key
9698
$global:createdKeys += $keyname
9799
Assert-KeyAttributes $key.Attributes 'RSA-HSM' $true $null $null $null $null
100+
Assert-AreEqual $key.Key.N.Length $defaultKeySizeInBytes
98101
}
99102

100103
<#
@@ -124,6 +127,23 @@ function Test_ImportPfxWithDefaultAttributes
124127
Assert-NotNull $key
125128
$global:createdKeys += $keyname
126129
Assert-KeyAttributes $key.Attributes 'RSA' $true $null $null $null $null
130+
Assert-AreEqual $key.Key.N.Length $defaultKeySizeInBytes
131+
}
132+
133+
<#
134+
.SYNOPSIS
135+
Tests import pfx with default attributes
136+
#>
137+
function Test_ImportPfxWith1024BitKey
138+
{
139+
$keyVault = Get-KeyVault
140+
$keyname=Get-KeyName 'pfx1024'
141+
$pfxpath = Get-ImportKeyFile1024 'pfx'
142+
$key=Add-AzureKeyVaultKey -VaultName $keyVault -Name $keyname -KeyFilePath $pfxpath -KeyFilePassword $securepfxpwd
143+
Assert-NotNull $key
144+
$global:createdKeys += $keyname
145+
Assert-KeyAttributes $key.Attributes 'RSA' $true $null $null $null $null
146+
Assert-AreEqual $key.Key.N.Length 128
127147
}
128148

129149
<#
@@ -184,6 +204,23 @@ function Test_ImportByokWithDefaultAttributes
184204
Assert-NotNull $key
185205
$global:createdKeys += $keyname
186206
Assert-KeyAttributes $key.Attributes 'RSA-HSM' $true $null $null $null $null
207+
Assert-AreEqual $key.Key.N.Length $defaultKeySizeInBytes
208+
}
209+
210+
<#
211+
.SYNOPSIS
212+
Tests import byok with default attributes
213+
#>
214+
function Test_ImportByokWith1024BitKey
215+
{
216+
$keyVault = Get-KeyVault
217+
$keyname=Get-KeyName 'byok1024'
218+
$byokpath = Get-ImportKeyFile1024 'byok'
219+
$key=Add-AzureKeyVaultKey -VaultName $keyVault -Name $keyname -KeyFilePath $byokpath
220+
Assert-NotNull $key
221+
$global:createdKeys += $keyname
222+
Assert-KeyAttributes $key.Attributes 'RSA-HSM' $true $null $null $null $null
223+
Assert-AreEqual $key.Key.N.Length 128
187224
}
188225

189226
<#

src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
101101
</Reference>
102102
<Reference Include="Microsoft.WindowsAzure.Management.Network">
103-
<SpecificVersion>False</SpecificVersion>
104-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
103+
<SpecificVersion>False</SpecificVersion>
104+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.2\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
105105
</Reference>
106106
<Reference Include="Moq, Version=4.2.1402.2112, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
107107
<SpecificVersion>False</SpecificVersion>

src/ServiceManagement/Network/Commands.Network.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1818
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
1919
<package id="Microsoft.WindowsAzure.Management.Compute" version="12.2.0-preview" targetFramework="net45" />
20-
<package id="Microsoft.WindowsAzure.Management.Network" version="7.0.0" targetFramework="net45" />
20+
<package id="Microsoft.WindowsAzure.Management.Network" version="7.0.2" targetFramework="net45" />
2121
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
2222
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
2323
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />

src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@
8383
<Reference Include="Microsoft.WindowsAzure.Management.Compute">
8484
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.2.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
8585
</Reference>
86-
<Reference Include="Microsoft.WindowsAzure.Management.Network, Version=7.0.0.0, Culture=neutral, processorArchitecture=MSIL">
86+
<Reference Include="Microsoft.WindowsAzure.Management.Network, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8787
<SpecificVersion>False</SpecificVersion>
88-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
88+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.2\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
8989
</Reference>
9090
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9191
<SpecificVersion>False</SpecificVersion>
@@ -147,6 +147,10 @@
147147
<Compile Include="ApplicationGateway\StartApplicationGateway.cs" />
148148
<Compile Include="ApplicationGateway\StopApplicationGateway.cs" />
149149
<Compile Include="ApplicationGateway\UpdateApplicationGateway.cs" />
150+
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayConnection.cs" />
151+
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayDiagnostics.cs" />
152+
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayIPsecParameters.cs" />
153+
<Compile Include="Gateway\GetAzureVirtualNetworkGatewayKey.cs" />
150154
<Compile Include="Gateway\GetAzureVNetConnection.cs" />
151155
<Compile Include="Gateway\GetAzureVNetGateway.cs" />
152156
<Compile Include="Gateway\GetAzureVNetGatewayDiagnostics.cs" />
@@ -157,17 +161,39 @@
157161
<Compile Include="Gateway\Model\SharedKeyContext.cs" />
158162
<Compile Include="Gateway\Model\VirtualNetworkDiagnosticsContext.cs" />
159163
<Compile Include="Gateway\Model\VirtualNetworkGatewayContext.cs" />
164+
<Compile Include="Gateway\Model\GetLocalNetworkGatewayContext.cs" />
165+
<Compile Include="Gateway\Model\GetVirtualNetworkGatewayConnectionContext.cs" />
166+
<Compile Include="Gateway\Model\GetVirtualNetworkGatewayContext.cs" />
167+
<Compile Include="Gateway\Model\LocalNetwrokGatewayContext.cs" />
168+
<Compile Include="Gateway\Model\ValidateGuid.cs" />
169+
<Compile Include="Gateway\NewAzureVirtualNetworkGateway.cs" />
170+
<Compile Include="Gateway\NewAzureVirtualNetworkGatewayConnection.cs" />
160171
<Compile Include="Gateway\NewAzureVNetGateway.cs" />
161172
<Compile Include="Gateway\RemoveAzureVNetGateway.cs" />
162173
<Compile Include="Gateway\RemoveAzureVNetGatewayDefaultSite.cs" />
174+
<Compile Include="Gateway\ResetAzureVirtualNetworkGatewayKey.cs" />
163175
<Compile Include="Gateway\ResetAzureVNetGateway.cs" />
164176
<Compile Include="Gateway\ResizeAzureVNetGateway.cs" />
177+
<Compile Include="Gateway\SetAzureVirtualNetworkGatewayIPsecParameters.cs" />
178+
<Compile Include="Gateway\SetAzureVirtualNetworkGatewayKey.cs" />
165179
<Compile Include="Gateway\SetAzureVNetGateway.cs" />
166180
<Compile Include="Gateway\SetAzureVNetGatewayDefaultSite.cs" />
167181
<Compile Include="Gateway\SetAzureVNetGatewayIPsecParameters.cs" />
168182
<Compile Include="Gateway\SetAzureVNetGatewayKey.cs" />
183+
<Compile Include="Gateway\StartAzureVirtualNetworkGatewayDiagnostics.cs" />
169184
<Compile Include="Gateway\StartAzureVNetGatewayDiagnostics.cs" />
185+
<Compile Include="Gateway\StopAzureVirtualNetworkGatewayDiagnostics.cs" />
170186
<Compile Include="Gateway\StopAzureVNetGatewayDiagnostics.cs" />
187+
<Compile Include="Gateway\GetAzureLocalNetworkGateway.cs" />
188+
<Compile Include="Gateway\GetAzureVirtualNetworkGateway.cs" />
189+
<Compile Include="Gateway\NewAzureLocalNetworkGateway.cs" />
190+
<Compile Include="Gateway\RemoveAzureLocalNetworkGateway.cs" />
191+
<Compile Include="Gateway\RemoveAzureVirtualNetworkGateway.cs" />
192+
<Compile Include="Gateway\RemoveAzureVirtualNetworkGatewayConnection.cs" />
193+
<Compile Include="Gateway\ResetAzureVirtualNetworkGateway.cs" />
194+
<Compile Include="Gateway\ResizeAzureVirtualNetworkGateway.cs" />
195+
<Compile Include="Gateway\UpdateAzureLocalNetworkGateway.cs" />
196+
<Compile Include="Gateway\UpdateAzureVirtualNetworkGatewayConnection.cs" />
171197
<Compile Include="IPForwarding\GetAzureIPForwarding.cs" />
172198
<Compile Include="IPForwarding\Model\IPForwardingState.cs" />
173199
<Compile Include="IPForwarding\SetAzureIPForwarding.cs" />
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
16+
using System.Management.Automation;
17+
18+
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
19+
{
20+
[Cmdlet(VerbsCommon.Get, "AzureLocalNetworkGateway"), OutputType(typeof(GetLocalNetworkGatewayContext))]
21+
public class GetAzureLocalNetworkGateway : NetworkCmdletBase
22+
{
23+
[Parameter(Position = 0, Mandatory = false, HelpMessage = "Local network gateway Id.")]
24+
[ValidateGuid]
25+
[ValidateNotNullOrEmpty]
26+
public string GatewayId
27+
{
28+
get;
29+
set;
30+
}
31+
32+
public override void ExecuteCmdlet()
33+
{
34+
if (!string.IsNullOrEmpty(GatewayId))
35+
{
36+
WriteObject(Client.GetLocalNetworkGateway(GatewayId));
37+
}
38+
else
39+
{
40+
WriteObject(Client.ListLocalNetworkGateways());
41+
}
42+
}
43+
}
44+
}

src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVNetGatewayIPsecParameters.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,23 @@
1414

1515
using System.Management.Automation;
1616
using Microsoft.WindowsAzure.Management.Network.Models;
17+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
1718

1819
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
1920
{
2021
[Cmdlet(VerbsCommon.Get, "AzureVNetGatewayIPsecParameters"), OutputType(typeof(IPsecParameters))]
2122
public class GetAzureVNetGatewayIPsecParameters : NetworkCmdletBase
2223
{
2324
[Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network name.")]
25+
[ValidateGuid]
2426
[ValidateNotNullOrEmpty]
2527
public string VNetName
2628
{
2729
get; set;
2830
}
2931

3032
[Parameter(Position = 1, Mandatory = true, HelpMessage = "The local network site name.")]
33+
[ValidateGuid]
3134
[ValidateNotNullOrEmpty]
3235
public string LocalNetworkSiteName
3336
{
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
16+
using System.Management.Automation;
17+
18+
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
19+
{
20+
[Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGateway"), OutputType(typeof(GetVirtualNetworkGatewayContext))]
21+
public class GetAzureVirtualNetworkGateway : NetworkCmdletBase
22+
{
23+
[Parameter(Position = 0, Mandatory = false, HelpMessage = "Virtual network gateway Id.")]
24+
[ValidateGuid]
25+
[ValidateNotNullOrEmpty]
26+
public string GatewayId
27+
{
28+
get;
29+
set;
30+
}
31+
32+
public override void ExecuteCmdlet()
33+
{
34+
if (!string.IsNullOrEmpty(GatewayId))
35+
{
36+
WriteObject(Client.GetVirtualNetworkGateway(GatewayId));
37+
}
38+
else
39+
{
40+
WriteObject(Client.ListVirtualNetworkGateways());
41+
}
42+
}
43+
}
44+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.Model;
16+
using System.Management.Automation;
17+
18+
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
19+
{
20+
[Cmdlet(VerbsCommon.Get, "AzureVirtualNetworkGatewayConnection"), OutputType(typeof(GetVirtualNetworkGatewayConnectionContext))]
21+
public class GetAzureVirtualNetworkConnectionGateway : NetworkCmdletBase
22+
{
23+
[Parameter(Position = 0, Mandatory = false, HelpMessage = "Virtual network gateway Id.")]
24+
[ValidateGuid]
25+
[ValidateNotNullOrEmpty]
26+
public string GatewayId
27+
{
28+
get;
29+
set;
30+
}
31+
32+
[Parameter(Position = 1, Mandatory = false, HelpMessage = "Virtual network gateway Connected entityId.")]
33+
[ValidateGuid]
34+
[ValidateNotNullOrEmpty]
35+
public string ConnectedEntityId
36+
{
37+
get;
38+
set;
39+
}
40+
41+
public override void ExecuteCmdlet()
42+
{
43+
if (!string.IsNullOrEmpty(GatewayId) && !string.IsNullOrEmpty(ConnectedEntityId))
44+
{
45+
WriteObject(Client.GetVirtualNetworkGatewayConnection(GatewayId, ConnectedEntityId));
46+
}
47+
else
48+
{
49+
WriteObject(Client.ListVirtualNetworkGatewayConnections());
50+
}
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)