Skip to content

Commit eb4d8f4

Browse files
committed
Merge pull request #132 from stankovski/profile
Referencing latest Common.Authentication library
2 parents 1d30b37 + d7da22c commit eb4d8f4

File tree

346 files changed

+1245
-3322
lines changed

Some content is hidden

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

346 files changed

+1245
-3322
lines changed

setup/azurecmdfiles.wxi

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
<SpecificVersion>False</SpecificVersion>
5757
<HintPath>..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll</HintPath>
5858
</Reference>
59-
<Reference Include="Microsoft.Azure.Common.Extensions, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
59+
<Reference Include="Microsoft.Azure.Common.Authentication">
6060
<SpecificVersion>False</SpecificVersion>
61-
<HintPath>..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll</HintPath>
61+
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
6262
</Reference>
6363
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6464
<SpecificVersion>False</SpecificVersion>
@@ -77,12 +77,12 @@
7777
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7878
<HintPath>..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
7979
</Reference>
80-
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80+
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
8181
<SpecificVersion>False</SpecificVersion>
82-
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
82+
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
8383
</Reference>
8484
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
85-
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
85+
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
8686
</Reference>
8787
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
8888
<SpecificVersion>False</SpecificVersion>

src/Common/Commands.Common.Storage/WindowsAzureSubscriptionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
using System;
1616
using System.Collections.Generic;
1717
using Microsoft.WindowsAzure.Commands.Common;
18-
using Microsoft.Azure.Common.Extensions.Models;
18+
using Microsoft.Azure.Common.Authentication.Models;
1919
using Microsoft.WindowsAzure.Commands.Common.Storage;
2020
using Microsoft.WindowsAzure.Management.Storage;
2121
using Microsoft.WindowsAzure.Storage;
22-
using Microsoft.Azure.Common.Extensions;
22+
using Microsoft.Azure.Common.Authentication;
2323

2424
namespace Microsoft.WindowsAzure.Commands.Utilities.Common
2525
{

src/Common/Commands.Common.Storage/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<package id="Hyak.Common" version="1.0.1" targetFramework="net45" />
44
<package id="Microsoft.Azure.Common" version="2.0.1" targetFramework="net45" />
55
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
6-
<package id="Microsoft.Azure.Common.Extensions" version="0.13.0-preview" targetFramework="net45" />
6+
<package id="Microsoft.Azure.Common.Authentication" version="1.0.4-preview" targetFramework="net45" />
77
<package id="Microsoft.Azure.Management.Resources" version="2.12.0-preview" targetFramework="net45" />
88
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
99
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
1010
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
1111
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
1212
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
1313
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net45" />
14-
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.11.10918.1222" targetFramework="net45" />
14+
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.12.111071459" targetFramework="net45" />
1515
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1616
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
1717
<package id="Microsoft.WindowsAzure.Management" version="4.0.0" targetFramework="net45" />

src/Common/Commands.Common.Test/Commands.Common.Test.csproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
<Reference Include="Microsoft.Azure.Common">
5555
<HintPath>..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll</HintPath>
5656
</Reference>
57-
<Reference Include="Microsoft.Azure.Common.Extensions, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
57+
<Reference Include="Microsoft.Azure.Common.Authentication">
5858
<SpecificVersion>False</SpecificVersion>
59-
<HintPath>..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll</HintPath>
59+
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
6060
</Reference>
6161
<Reference Include="Microsoft.Azure.Common.NetFramework">
6262
<HintPath>..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
@@ -77,13 +77,13 @@
7777
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7878
<HintPath>..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
7979
</Reference>
80-
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80+
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.12.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8181
<SpecificVersion>False</SpecificVersion>
82-
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
82+
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
8383
</Reference>
84-
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
84+
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.12.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8585
<SpecificVersion>False</SpecificVersion>
86-
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
86+
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
8787
</Reference>
8888
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
8989
<SpecificVersion>False</SpecificVersion>
@@ -154,7 +154,6 @@
154154
<ItemGroup>
155155
<Compile Include="Common\AuthenticationFactoryTests.cs" />
156156
<Compile Include="Common\ProfileCmdltsTests.cs" />
157-
<Compile Include="Common\ProfileClientTests.cs" />
158157
<Compile Include="Common\ServicePrincipalStoreTests.cs" />
159158
<Compile Include="Common\GeneralUtilitiesTests.cs" />
160159
<Compile Include="Common\Data.cs" />

src/Common/Commands.Common.Test/Common/AuthenticationFactoryTests.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
using System.Collections.Generic;
1616
using Xunit;
1717
using System;
18-
using Microsoft.Azure.Common.Extensions.Factories;
18+
using Microsoft.Azure.Common.Authentication.Factories;
1919
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
20-
using Microsoft.Azure.Common.Extensions.Authentication;
21-
using Microsoft.Azure.Common.Extensions.Models;
20+
using Microsoft.Azure.Common.Authentication;
21+
using Microsoft.Azure.Common.Authentication.Models;
2222

2323
namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
2424
{
@@ -34,10 +34,16 @@ public void VerifySubscriptionTokenCacheRemove()
3434

3535
var subscriptionId = Guid.NewGuid();
3636

37-
var credential = authFactory.GetSubscriptionCloudCredentials(new AzureContext
38-
{
39-
Environment = AzureEnvironment.PublicEnvironments["AzureCloud"],
40-
Account = new AzureAccount
37+
var credential = authFactory.GetSubscriptionCloudCredentials(new AzureContext(
38+
new AzureSubscription
39+
{
40+
Id = subscriptionId,
41+
Properties = new Dictionary<AzureSubscription.Property, string>
42+
{
43+
{ AzureSubscription.Property.Tenants, "123"}
44+
}
45+
},
46+
new AzureAccount
4147
{
4248
Id = "testuser",
4349
Type = AzureAccount.AccountType.User,
@@ -46,16 +52,9 @@ public void VerifySubscriptionTokenCacheRemove()
4652
{ AzureAccount.Property.Tenants, "123" }
4753
}
4854
},
49-
Subscription = new AzureSubscription
50-
{
51-
Id = subscriptionId,
52-
Properties = new Dictionary<AzureSubscription.Property, string>
53-
{
54-
{ AzureSubscription.Property.Tenants, "123"}
55-
}
56-
}
55+
AzureEnvironment.PublicEnvironments["AzureCloud"]
5756

58-
});
57+
));
5958

6059
Assert.True(credential is AccessTokenCredential);
6160
Assert.Equal(subscriptionId, new Guid(((AccessTokenCredential)credential).SubscriptionId));

src/Common/Commands.Common.Test/Common/ConversionUtilitiesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
using System.Collections.Generic;
1616
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1717
using Xunit;
18-
using Microsoft.Azure.Common.Extensions;
18+
using Microsoft.Azure.Common.Authentication;
1919

2020
namespace Microsoft.WindowsAzure.Commands.Common.Test
2121
{

src/Common/Commands.Common.Test/Common/Data.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
2121
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2222
using Microsoft.WindowsAzure.Commands.Common;
23-
using Microsoft.Azure.Common.Extensions;
23+
using Microsoft.Azure.Common.Authentication;
2424

2525
namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
2626
{
@@ -66,7 +66,7 @@ public static class Data
6666

6767
static Data()
6868
{
69-
AzureAppDir = Path.Combine(Directory.GetCurrentDirectory(), Resources.AzureDirectoryName);
69+
AzureAppDir = AzureSession.ProfileDirectory;
7070
AzureSdkAppDir = Path.Combine(Directory.GetCurrentDirectory(), "Microsoft Azure PowerShell");
7171
TestResultDirectory = FileUtilities.GetAssemblyDirectory();
7272

src/Common/Commands.Common.Test/Common/GeneralTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using System.IO;
1717
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1818
using Xunit;
19-
using Microsoft.Azure.Common.Extensions;
19+
using Microsoft.Azure.Common.Authentication;
2020

2121
namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
2222
{

src/Common/Commands.Common.Test/Common/JsonUtilitiesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
using Newtonsoft.Json;
2020
using Newtonsoft.Json.Linq;
2121
using Xunit;
22-
using Microsoft.Azure.Common.Extensions;
22+
using Microsoft.Azure.Common.Authentication;
2323

2424
namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
2525
{

0 commit comments

Comments
 (0)