Skip to content

Commit

Permalink
Integrating Lab Api package (#2352)
Browse files Browse the repository at this point in the history
* integrating Lab Api package

* Revert "integrating Lab Api package"

This reverts commit 1988005.

* Resolving build issues

* Updating lab api credential acquisition

* Resolving keyvault error

* Updating to latest package.

Removing UserInformationFieldIds implementation

* Removing dead code from previous lab infrastructure

* Centralizing MSID Lab api package version

* Updating MicrosoftIdentityLabApiVersion

* Moving MicrosoftIdentityLabApiVersion to the correct props file

---------

Co-authored-by: trwalke <trwalke@microsoft.com>
  • Loading branch information
trwalke and trwalke authored Aug 3, 2023
1 parent e9e015e commit 0825aec
Show file tree
Hide file tree
Showing 26 changed files with 22 additions and 977 deletions.
7 changes: 0 additions & 7 deletions Microsoft.Identity.Web.sln
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{B4E72F1C
tests\Directory.Build.props = tests\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web.Test.LabInfrastructure", "tests\Microsoft.Identity.Web.Test.LabInfrastructure\Microsoft.Identity.Web.Test.LabInfrastructure.csproj", "{65D4033E-70D4-4399-BBEB-18A629BC67D9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web.Test.Common", "tests\Microsoft.Identity.Web.Test.Common\Microsoft.Identity.Web.Test.Common.csproj", "{28D01B8A-CD4C-4886-BD5E-4BF1B6C0A4C1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web.Test", "tests\Microsoft.Identity.Web.Test\Microsoft.Identity.Web.Test.csproj", "{2B1E8B69-D74F-4D0C-B80B-78ACA1DD4E77}"
Expand Down Expand Up @@ -218,10 +216,6 @@ Global
{20535D28-C2F4-4975-9982-A18E7141DA53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20535D28-C2F4-4975-9982-A18E7141DA53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20535D28-C2F4-4975-9982-A18E7141DA53}.Release|Any CPU.Build.0 = Release|Any CPU
{65D4033E-70D4-4399-BBEB-18A629BC67D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65D4033E-70D4-4399-BBEB-18A629BC67D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65D4033E-70D4-4399-BBEB-18A629BC67D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65D4033E-70D4-4399-BBEB-18A629BC67D9}.Release|Any CPU.Build.0 = Release|Any CPU
{28D01B8A-CD4C-4886-BD5E-4BF1B6C0A4C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28D01B8A-CD4C-4886-BD5E-4BF1B6C0A4C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28D01B8A-CD4C-4886-BD5E-4BF1B6C0A4C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -412,7 +406,6 @@ Global
{A423DCA3-BEB8-4D1B-8A4D-63B21950F388} = {1DDE1AAC-5AE6-4725-94B6-A26C58D3423F}
{2467D9A0-045B-4B45-8CCB-1AA229093F9F} = {1DDE1AAC-5AE6-4725-94B6-A26C58D3423F}
{20535D28-C2F4-4975-9982-A18E7141DA53} = {1DDE1AAC-5AE6-4725-94B6-A26C58D3423F}
{65D4033E-70D4-4399-BBEB-18A629BC67D9} = {B4E72F1C-603F-437C-AAA1-153A604CD34A}
{28D01B8A-CD4C-4886-BD5E-4BF1B6C0A4C1} = {B4E72F1C-603F-437C-AAA1-153A604CD34A}
{2B1E8B69-D74F-4D0C-B80B-78ACA1DD4E77} = {B4E72F1C-603F-437C-AAA1-153A604CD34A}
{E664F890-8EB7-4CB6-8469-17CF8E3D3F33} = {B4E72F1C-603F-437C-AAA1-153A604CD34A}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web.Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web.Test.Integration", "..\Microsoft.Identity.Web.Test.Integration\Microsoft.Identity.Web.Test.Integration.csproj", "{6FF55920-9619-4C1F-9633-D1623648C888}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web.Test.LabInfrastructure", "..\Microsoft.Identity.Web.Test.LabInfrastructure\Microsoft.Identity.Web.Test.LabInfrastructure.csproj", "{1441C485-F284-4CCA-BD9C-57B877B67BA1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
1 change: 1 addition & 0 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<StackExchangeRedisVersion>2.2.4</StackExchangeRedisVersion>
<!--CVE-2021-24112-->
<SystemDrawingCommonVersion>5.0.3</SystemDrawingCommonVersion>
<MicrosoftIdentityLabApiVersion>0.12.0</MicrosoftIdentityLabApiVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ProjectReference Include="..\..\..\src\Microsoft.Identity.Web.MicrosoftGraph\Microsoft.Identity.Web.MicrosoftGraph.csproj" />
<ProjectReference Include="..\..\..\src\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj" />
<ProjectReference Include="..\..\Microsoft.Identity.Web.Test.Common\Microsoft.Identity.Web.Test.Common.csproj" />
<ProjectReference Include="..\..\Microsoft.Identity.Web.Test.LabInfrastructure\Microsoft.Identity.Web.Test.LabInfrastructure.csproj" />
<PackageReference Include="Microsoft.Identity.Lab.Api" Version="$(MicrosoftIdentityLabApiVersion)" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
Expand Down
4 changes: 2 additions & 2 deletions tests/IntegrationTests/IntegrationTestService/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Identity.Web;
using Microsoft.Identity.Web.Test.Common;
using Microsoft.Identity.Web.Test.LabInfrastructure;
using Microsoft.Identity.Lab.Api;
using Microsoft.Identity.Web.TokenCacheProviders.InMemory;

namespace IntegrationTestService
Expand All @@ -26,7 +26,7 @@ public Startup(IConfiguration configuration)
public void ConfigureServices(IServiceCollection services)
{
KeyVaultSecretsProvider keyVaultSecretsProvider = new();
string secret = keyVaultSecretsProvider.GetMsidLabSecret(TestConstants.OBOClientKeyVaultUri).Value;
string secret = keyVaultSecretsProvider.GetSecretByName(TestConstants.OBOClientKeyVaultUri).Value;

services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(Configuration, jwtBearerScheme: JwtBearerDefaults.AuthenticationScheme, subscribeToJwtBearerMiddlewareDiagnosticsEvents: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System;
using Microsoft.Identity.Web.Test.LabInfrastructure;
using Microsoft.Identity.Lab.Api;
using Microsoft.Identity.Web.Test.Common;
using OpenQA.Selenium.Edge;
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
using System.Globalization;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Microsoft.Identity.Lab.Api;
using Microsoft.Identity.Web.Test.Common;
using Microsoft.Identity.Web.Test.LabInfrastructure;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;
Expand Down Expand Up @@ -50,7 +50,7 @@ internal static void PerformLogin(
IWebDriver driver,
LabUser user)
{
UserInformationFieldIds fields = new UserInformationFieldIds();
UserInformationFieldIds fields = new UserInformationFieldIds(user);

EnterUsername(driver, user, fields);
EnterPassword(driver, user, fields);
Expand Down
4 changes: 3 additions & 1 deletion tests/IntegrationTests/WebAppUiTests/WebAppUiTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(MicrosoftAspNetCoreMvcTestingVersion)" />
<PackageReference Include="Microsoft.Identity.Lab.Api" Version="$(MicrosoftIdentityLabApiVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNetTestSdkVersion)" />
<PackageReference Include="Selenium.WebDriver" Version="$(SeleniumWebDriverVersion)" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="$(SeleniumWebDriverChromeDriverVersion)" />
Expand All @@ -25,7 +26,8 @@

<ItemGroup>
<ProjectReference Include="..\..\DevApps\WebAppCallsMicrosoftGraph\WebAppCallsMicrosoftGraph.csproj" />
<ProjectReference Include="..\..\Microsoft.Identity.Web.Test.LabInfrastructure\Microsoft.Identity.Web.Test.LabInfrastructure.csproj" />
<ProjectReference Include="..\..\Microsoft.Identity.Web.Test.Common\Microsoft.Identity.Web.Test.Common.csproj" />
<ProjectReference Include="..\..\Microsoft.Identity.Web.Test\Microsoft.Identity.Web.Test.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Identity.Lab.Api" Version="$(MicrosoftIdentityLabApiVersion)" />
<PackageReference Include="NSubstitute" Version="$(NSubstituteVersion)" />
<PackageReference Include="xunit.assert" Version="$(XunitAssertVersion)" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
using Microsoft.Identity.Web.Test.Common;
using Microsoft.Identity.Web.Test.Common.Mocks;
using Microsoft.Identity.Web.Test.Common.TestHelpers;
using Microsoft.Identity.Web.Test.LabInfrastructure;
using Microsoft.Identity.Lab.Api;
using Microsoft.Identity.Web.TokenCacheProviders.InMemory;
using Xunit;
using Xunit.Abstractions;
using Microsoft.Identity.Client.Platforms.Features.DesktopOs.Kerberos;
using System.Threading;

namespace Microsoft.Identity.Web.Test.Integration
{
Expand All @@ -46,8 +48,8 @@ public AcquireTokenForAppIntegrationTests(ITestOutputHelper output) // test set-
{
_output = output;

KeyVaultSecretsProvider keyVaultSecretsProvider = new();
_ccaSecret = keyVaultSecretsProvider.GetKeyVaultSecret().Value;
KeyVaultSecretsProvider keyVaultSecretsProvider = new KeyVaultSecretsProvider(TestConstants.BuildAutomationKeyVaultName);
_ccaSecret = keyVaultSecretsProvider.GetSecretByName(TestConstants.AzureADIdentityDivisionTestAgentSecret).Value;

// Need the secret before building the services
if (!string.IsNullOrEmpty(_ccaSecret))
Expand All @@ -60,7 +62,7 @@ public AcquireTokenForAppIntegrationTests(ITestOutputHelper output) // test set-
throw new ArgumentNullException(message: "No secret returned from Key Vault. ", null);
}
}

[Theory]
[InlineData(true, Constants.Bearer)]
[InlineData(true, "PoP")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Identity.Client;
using Microsoft.Identity.Web.Test.Common;
using Microsoft.Identity.Lab.Api;
using Microsoft.Identity.Web.Test.Common.TestHelpers;
using Microsoft.Identity.Web.Test.LabInfrastructure;
using Microsoft.Identity.Web.TokenCacheProviders.Distributed;
using Microsoft.Identity.Web.TokenCacheProviders.InMemory;
using Xunit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(MicrosoftAspNetCoreMvcTestingVersion)" />
<PackageReference Include="Microsoft.Identity.Lab.Api" Version="$(MicrosoftIdentityLabApiVersion)" />
<PackageReference Include="NSubstitute" Version="$(NSubstituteVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualStudioVersion)">
Expand All @@ -33,7 +34,6 @@
<ProjectReference Include="..\..\src\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj" />
<ProjectReference Include="..\IntegrationTests\IntegrationTestService\IntegrationTestService.csproj" />
<ProjectReference Include="..\Microsoft.Identity.Web.Test.Common\Microsoft.Identity.Web.Test.Common.csproj" />
<ProjectReference Include="..\Microsoft.Identity.Web.Test.LabInfrastructure\Microsoft.Identity.Web.Test.LabInfrastructure.csproj" />
</ItemGroup>

</Project>

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0825aec

Please sign in to comment.