1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-09 10:22:51 +03:00

Auth group sync: Fixed unintential mapping behaviour change

Due to change in how casing was handled when used in the "External Auth
ID" role field.
Likely related to #3535.
Added test to cover.
This commit is contained in:
Dan Brown
2022-06-27 14:17:42 +01:00
parent 47887ec595
commit 0bcd1795cb
2 changed files with 13 additions and 1 deletions

View File

@@ -54,4 +54,16 @@ class GroupSyncServiceTest extends TestCase
$user = User::query()->find($user->id);
$this->assertTrue($user->hasRole($role->id));
}
public function test_external_auth_id_matches_ignoring_case()
{
$user = $this->getViewer();
$role = Role::factory()->create(['display_name' => 'ABC123', 'external_auth_id' => 'WaRRioRs']);
$this->assertFalse($user->hasRole($role->id));
(new GroupSyncService())->syncUserWithFoundGroups($user, ['wArriors', 'penguiNs'], false);
$user = User::query()->find($user->id);
$this->assertTrue($user->hasRole($role->id));
}
}