Skip to content

Commit

Permalink
Publish EntraCP v27.0 (#283)
Browse files Browse the repository at this point in the history
* Merge changes for EntraCP v27.0 to release branch (#282)

* Update Yvand.EntraCP.nuspec

* Fix missing group members when only users members of some groups can be found (#273)

* Update Populate-EntraIDTenant.ps1

* Update EntraIDEntityProvider.cs

* add pagination to get all group members

* fix init of lists

* improve tests

* update tests

* return entities cloned from their source list

* Update CHANGELOG.md

* Update tests (#276)

* start work

* in progress

* continue work

* progress

* work

* rename types

* Update UnitTestsHelper.cs

* Update UnitTestsHelper.cs

* Update UnitTestsHelper.cs

* work

* Add sample of a custom claims provider (#278)

* publish sample

* Add README files

* update README

* Add a Bruno collection to replay requests to Microsoft Graph (#280)

* initial commit

* rename files

* set auth to inherit

* remove tests

* update doc

* Update README.md

* Update get access token.bru

* Update CHANGELOG.md

* reorganize folders

* Update UnitTestsHelper.cs

* remove outdated pipelines

* Improve tests (#281)

* work

* work

* work

* Update Populate-EntraIDTenant.ps1

* work

* work

* work;

* work

* Update Populate-EntraIDTenant.ps1

* Update reusable-prepare-dtl-env.yml

* Update reusable-prepare-dtl-env.yml

* Update run-tests.yml

* simplify the setup of tests

* Update run-tests.yml

* Update run-tests.yml

* Update Yvand.EntraCP.sln

* update workflows

* update workflows

* Update Yvand.EntraCP.Tests.csproj

* Update CHANGELOG.md

* Update reusable-build.yml

* Revert "Update reusable-build.yml"

This reverts commit d4b71d6.

* update build settings

* Update prepare-dtl-env.yml

* Update prepare-dtl-env.yml

* Update CHANGELOG.md
  • Loading branch information
Yvand authored Aug 21, 2024
1 parent 4f2fcf0 commit 1012465
Show file tree
Hide file tree
Showing 67 changed files with 1,503 additions and 770 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Verify PRs and commits
name: Build solution

on:
workflow_dispatch:
push:
branches: [ "master", "dev" ]
branches:
- dev
- 'releases/**'
pull_request:
branches: [ "master", "dev" ]
branches: [ "dev", "master", "releases/**" ]

jobs:
call-build:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/prepare-dtl-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ jobs:
dtl-env-addAzureBastion: ${{ vars.dtl_addAzureBastion == 'true' }}
test-prepareSharePointVmScriptUris: ${{ vars.DTL_PrepareSharePointVmScriptUris }}
test-claimsProviderPackageUri: ${{ vars.DTL_ClaimsProviderPackageUri }}
unittestfiles-storageAccountSourceRelativePath: ${{ vars.unittestfiles_storageAccountSourceRelativePath }}
test_registerRunner_scriptUrl: ${{ vars.test_registerRunner_scriptUrl }}
unittestfiles_azure_storage_share_relative_path: ${{ vars.unittestfiles_azure_storage_share_relative_path }}
test_registerRunner_scriptUrl: ""
secrets:
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
azdevops-pat-registerAgent: ${{ secrets.dtl_azdevopsPassword }}
dtl-env-accountsPassword: ${{ secrets.dtl_accountsPassword }}
unittestfiles-storageAccountEndpoint: ${{ secrets.unittestfiles_storageAccountEndpoint }}
unittestfiles-storageAccountShareName: ${{ secrets.unittestfiles_storageAccountShareName }}
GH_TOKEN_ADD_RUNNER: ${{ secrets.GH_TOKEN_ADD_RUNNER }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
ADO_PAT_REGISTERAGENT: ${{ secrets.ADO_PAT_REGISTERAGENT }}
DTL_ACCOUNTSPASSWORD: ${{ secrets.DTL_ACCOUNTSPASSWORD }}
UNITTESTFILES_AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.UNITTESTFILES_AZURE_STORAGE_CONNECTION_STRING }}
UNITTESTFILES_AZURE_STORAGE_SHARE_NAME: ${{ secrets.UNITTESTFILES_AZURE_STORAGE_SHARE_NAME }}
GH_TOKEN_ADD_RUNNER: ""
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
permissions:
issues: write
pull-requests: write
actions: write

jobs:
stale:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change log for ~~AzureCP~~ EntraCP

## EntraCP v27.0 - enhancements & bug-fixes - Published in August 21, 2024

* Ensure that restrict searchable users feature works for all members, instead of only 100 members maximum - https://github.com/Yvand/EntraCP/issues/264
* Update the script that provisions tenant with test users and groups, to be more reliable and provision 999 users (instead of 50), so tests are more realistics
* Improve tests
* Publish a sample project that developers can use to create a custom version of EntraCP, for specific needs
* Add a [Bruno](https://www.usebruno.com/) collection to replay the requests sent to Microsoft Graph by EntraCP

## EntraCP v26.0.20240627.35 enhancements & bug-fixes - Published in June 27, 2024

* Fix an NullReferenceException in a very rare scenario where ClaimsPrincipal.Identity is null
Expand Down
41 changes: 21 additions & 20 deletions Yvand.EntraCP.Tests/BasicConfigurationTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using NUnit.Framework;
using System;
using System.Linq;

namespace Yvand.EntraClaimsProvider.Tests
{
Expand All @@ -20,32 +19,33 @@ public override void CheckSettingsTest()
base.CheckSettingsTest();
}

[Test, TestCaseSource(typeof(EntraIdTestGroupsSource), nameof(EntraIdTestGroupsSource.GetTestData), new object[] { true })]
public void TestAllTestGroups(EntraIdTestGroup group)
[Test, TestCaseSource(typeof(TestEntitySourceManager), nameof(TestEntitySourceManager.GetSomeGroups), new object[] { TestEntitySourceManager.MaxNumberOfGroupsToTest, true })]
public void TestGroups(TestGroup group)
{
TestSearchAndValidateForEntraIDGroup(group);
TestSearchAndValidateForTestGroup(group);
}

[Test]
public void TestRandomTestGroups([Random(0, UnitTestsHelper.TestGroupsCount - 1, 5)] int idx)
[Test, TestCaseSource(typeof(TestEntitySourceManager), nameof(TestEntitySourceManager.GetSomeUsers), new object[] { TestEntitySourceManager.MaxNumberOfUsersToTest })]
public void TestUsers(TestUser user)
{
EntraIdTestGroup group = EntraIdTestGroupsSource.Groups[idx];
TestSearchAndValidateForEntraIDGroup(group);
}

[Test, TestCaseSource(typeof(EntraIdTestUsersSource), nameof(EntraIdTestUsersSource.GetTestData), null)]
public void TestAllTestUsers(EntraIdTestUser user)
{
base.TestSearchAndValidateForEntraIDUser(user);
base.TestSearchAndValidateForTestUser(user);
base.TestAugmentationAgainst1RandomGroup(user);
}

[Test]
public void TestRandomTestUsers([Random(0, UnitTestsHelper.TestUsersCount - 1, 5)] int idx)
public void TestAGuestUser()
{
var user = EntraIdTestUsersSource.Users[idx];
base.TestSearchAndValidateForEntraIDUser(user);
TestUser user = TestEntitySourceManager.GetOneUser(UserType.Guest);
base.TestSearchAndValidateForTestUser(user);
}

//[Test]
//public void TestRandomUsers([Random(0, UnitTestsHelper.TotalNumberTestUsers - 1, 5)] int idx)
//{
// var user = EntraIdTestUsersSource.Users[idx];
// base.TestSearchAndValidateForTestUser(user);
//}

[Test]
[Repeat(5)]
public override void TestAugmentationOfGoldUsersAgainstRandomGroups()
Expand All @@ -55,11 +55,12 @@ public override void TestAugmentationOfGoldUsersAgainstRandomGroups()

#if DEBUG
[TestCase("testEntraCPUser_001")]
[TestCase("testEntraCPUser_020")]
[TestCase("testEntraCPUser_326")]
public void DebugTestUser(string upnPrefix)
{
EntraIdTestUser user = EntraIdTestUsersSource.Users.Find(x => x.UserPrincipalName.StartsWith(upnPrefix));
base.TestSearchAndValidateForEntraIDUser(user);
TestUser user = TestEntitySourceManager.FindUser(upnPrefix);
base.TestSearchAndValidateForTestUser(user);
base.TestAugmentationAgainst1RandomGroup(user);
}

[TestCase(@"testentracp", 30, "")]
Expand Down
39 changes: 19 additions & 20 deletions Yvand.EntraCP.Tests/BypassDirectoryTests.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
using Microsoft.SharePoint.Administration.Claims;
using NUnit.Framework;
using System.Security.Claims;
using Yvand.EntraClaimsProvider.Configuration;

namespace Yvand.EntraClaimsProvider.Tests
{
[TestFixture]
[Parallelizable(ParallelScope.Children)]
public class BypassDirectoryOnClaimTypesTests : ClaimsProviderTestsBase
{
string PrefixBypassUserSearch = "bypass-user:";
string PrefixBypassGroupSearch = "bypass-group:";
const string PrefixBypassUserSearch = "bypass-user:";
const string PrefixBypassGroupSearch = "bypass-group:";
public override void InitializeSettings()
{
base.InitializeSettings();
Expand All @@ -26,28 +25,28 @@ public override void CheckSettingsTest()
base.CheckSettingsTest();
}

[Test, TestCaseSource(typeof(EntraIdTestUsersSource), nameof(EntraIdTestUsersSource.GetTestData), null)]
public void TestAllEntraIDUsers(EntraIdTestUser user)
[Test, TestCaseSource(typeof(TestEntitySourceManager), nameof(TestEntitySourceManager.GetSomeUsers), new object[] { TestEntitySourceManager.MaxNumberOfUsersToTest })]
public void TestUsers(TestUser user)
{
base.TestSearchAndValidateForEntraIDUser(user);
base.TestSearchAndValidateForTestUser(user);
user.UserPrincipalName = user.DisplayName;
user.Mail = user.DisplayName;
user.DisplayName = $"{PrefixBypassUserSearch}{user.DisplayName}";
base.TestSearchAndValidateForEntraIDUser(user);
base.TestSearchAndValidateForTestUser(user);
}

[Test, TestCaseSource(typeof(EntraIdTestGroupsSource), nameof(EntraIdTestGroupsSource.GetTestData), new object[] { true })]
public void TestAllEntraIDGroups(EntraIdTestGroup group)
[Test, TestCaseSource(typeof(TestEntitySourceManager), nameof(TestEntitySourceManager.GetSomeGroups), new object[] { TestEntitySourceManager.MaxNumberOfGroupsToTest, true })]
public void TestGroups(TestGroup group)
{
TestSearchAndValidateForEntraIDGroup(group);
TestSearchAndValidateForTestGroup(group);
group.Id = group.DisplayName;
group.DisplayName = $"{PrefixBypassGroupSearch}{group.DisplayName}";
TestSearchAndValidateForEntraIDGroup(group);
TestSearchAndValidateForTestGroup(group);
}

[TestCase("bypass-user:[email protected]", 1, "[email protected]")]
[TestCase("bypass-user:", 0, "")]
[TestCase("bypass-group:", 0, "")]
[TestCase(PrefixBypassUserSearch + "[email protected]", 1, "[email protected]")]
[TestCase(PrefixBypassUserSearch, 0, "")]
[TestCase(PrefixBypassGroupSearch, 0, "")]
public void TestBypassDirectoryByClaimType(string inputValue, int expectedCount, string expectedClaimValue)
{
TestSearchOperation(inputValue, expectedCount, expectedClaimValue);
Expand Down Expand Up @@ -77,16 +76,16 @@ public override void CheckSettingsTest()
base.CheckSettingsTest();
}

[Test, TestCaseSource(typeof(EntraIdTestGroupsSource), nameof(EntraIdTestGroupsSource.GetTestData), new object[] { true })]
public void TestAllEntraIDGroups(EntraIdTestGroup group)
[Test, TestCaseSource(typeof(TestEntitySourceManager), nameof(TestEntitySourceManager.GetSomeGroups), new object[] { TestEntitySourceManager.MaxNumberOfGroupsToTest, true })]
public void TestGroups(TestGroup group)
{
TestSearchAndValidateForEntraIDGroup(group);
TestSearchAndValidateForTestGroup(group);
}

[Test, TestCaseSource(typeof(EntraIdTestUsersSource), nameof(EntraIdTestUsersSource.GetTestData), null)]
public void TestAllEntraIDUsers(EntraIdTestUser user)
[Test, TestCaseSource(typeof(TestEntitySourceManager), nameof(TestEntitySourceManager.GetSomeUsers), new object[] { TestEntitySourceManager.MaxNumberOfUsersToTest })]
public void TestUsers(TestUser user)
{
base.TestSearchAndValidateForEntraIDUser(user);
base.TestSearchAndValidateForTestUser(user);
}

[Test]
Expand Down
Loading

0 comments on commit 1012465

Please sign in to comment.