agent foundation

This commit is contained in:
2026-03-06 00:44:52 +01:00
parent 9819cba733
commit 9a08f96c11
199 changed files with 8522 additions and 1880 deletions

View File

@@ -2,6 +2,7 @@
namespace MintyPHP\Tests\Service\Auth;
use MintyPHP\Http\SessionStore;
use MintyPHP\Service\Auth\MicrosoftOidcStateStoreService;
use PHPUnit\Framework\TestCase;
@@ -24,7 +25,7 @@ class MicrosoftOidcStateStoreServiceTest extends TestCase
public function testStoreAndConsumeIsSingleUse(): void
{
$store = new MicrosoftOidcStateStoreService(600, 50);
$store = new MicrosoftOidcStateStoreService(new SessionStore(), 600, 50);
$store->store('state-a', ['tenant_id' => 5, 'nonce' => 'n1']);
$first = $store->consume('state-a');
@@ -38,7 +39,7 @@ class MicrosoftOidcStateStoreServiceTest extends TestCase
public function testConsumeReturnsExpiredForOldState(): void
{
$store = new MicrosoftOidcStateStoreService(1, 50);
$store = new MicrosoftOidcStateStoreService(new SessionStore(), 1, 50);
$store->store('state-old', [
'tenant_id' => 9,
'created_at' => time() - 120,
@@ -51,7 +52,7 @@ class MicrosoftOidcStateStoreServiceTest extends TestCase
public function testStoreRespectsMaxEntriesAndPrunesOldStates(): void
{
$store = new MicrosoftOidcStateStoreService(600, 2);
$store = new MicrosoftOidcStateStoreService(new SessionStore(), 600, 2);
$store->store('state-1', ['created_at' => time() - 3]);
$store->store('state-2', ['created_at' => time() - 2]);