1 Commits

Author SHA1 Message Date
Sebastian ad5536529d Update dependency phpunit/phpunit to v12.5.32
Build Test / test (pull_request) Successful in 53s
JS Unit Tests / test (pull_request) Successful in 57s
PHP Integration Tests / Integration Tests (pull_request) Failing after 2m0s
PHP Unit Tests / test (pull_request) Successful in 1m33s
2026-07-26 03:05:32 +00:00
4 changed files with 37 additions and 34 deletions
Generated
+7 -7
View File
@@ -589,16 +589,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "12.5.31", "version": "12.5.32",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "0608d157a284f15cc73b99a3327eff06b66a176d" "reference": "c02591dd7840ed124a98d7770753329ad28e9f8f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0608d157a284f15cc73b99a3327eff06b66a176d", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c02591dd7840ed124a98d7770753329ad28e9f8f",
"reference": "0608d157a284f15cc73b99a3327eff06b66a176d", "reference": "c02591dd7840ed124a98d7770753329ad28e9f8f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -667,7 +667,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.31" "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.32"
}, },
"funding": [ "funding": [
{ {
@@ -675,7 +675,7 @@
"type": "other" "type": "other"
} }
], ],
"time": "2026-07-06T14:54:16+00:00" "time": "2026-07-25T06:54:13+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
@@ -1698,5 +1698,5 @@
"php": ">=8.3" "php": ">=8.3"
}, },
"platform-dev": {}, "platform-dev": {},
"plugin-api-version": "2.6.0" "plugin-api-version": "2.9.0"
} }
+9 -9
View File
@@ -4,8 +4,8 @@ namespace KTXM\AuthenticationProviderPassword\Controllers;
use KTXC\Http\Response\JsonResponse; use KTXC\Http\Response\JsonResponse;
use KTXC\Service\UserAccountsService; use KTXC\Service\UserAccountsService;
use KTXC\Context\IdentityContextInterface; use KTXC\SessionIdentity;
use KTXC\Context\TenantContextInterface; use KTXC\SessionTenant;
use KTXF\Controller\ControllerAbstract; use KTXF\Controller\ControllerAbstract;
use KTXF\Routing\Attributes\AuthenticatedRoute; use KTXF\Routing\Attributes\AuthenticatedRoute;
use KTXF\Security\Crypto; use KTXF\Security\Crypto;
@@ -15,8 +15,8 @@ use KTXM\AuthenticationProviderPassword\Stores\CredentialStore;
class PasswordController extends ControllerAbstract class PasswordController extends ControllerAbstract
{ {
public function __construct( public function __construct(
private readonly IdentityContextInterface $identityContext, private readonly SessionIdentity $sessionIdentity,
private readonly TenantContextInterface $tenantContext, private readonly SessionTenant $sessionTenant,
private readonly CredentialStore $credentialStore, private readonly CredentialStore $credentialStore,
private readonly Provider $provider, private readonly Provider $provider,
private readonly Crypto $crypto, private readonly Crypto $crypto,
@@ -27,8 +27,8 @@ class PasswordController extends ControllerAbstract
#[AuthenticatedRoute('/password/update', name: 'password.update', methods: ['POST'])] #[AuthenticatedRoute('/password/update', name: 'password.update', methods: ['POST'])]
public function update(string $current_password, string $new_password): JsonResponse public function update(string $current_password, string $new_password): JsonResponse
{ {
$tenantId = $this->tenantContext->identifier(); $tenantId = $this->sessionTenant->identifier();
$identifier = $this->identityContext->mailAddress(); $identifier = $this->sessionIdentity->mailAddress();
if ($tenantId === null || $identifier === null) { if ($tenantId === null || $identifier === null) {
return new JsonResponse(['error' => 'Invalid session state'], 400); return new JsonResponse(['error' => 'Invalid session state'], 400);
@@ -56,7 +56,7 @@ class PasswordController extends ControllerAbstract
#[AuthenticatedRoute('/status', name: 'password.admin.status', methods: ['POST'], permissions: ['authentication_provider_password.admin.view', 'authentication_provider_password.admin.manage'])] #[AuthenticatedRoute('/status', name: 'password.admin.status', methods: ['POST'], permissions: ['authentication_provider_password.admin.view', 'authentication_provider_password.admin.manage'])]
public function getStatus(string $uid): JsonResponse public function getStatus(string $uid): JsonResponse
{ {
$tenantId = $this->tenantContext->identifier(); $tenantId = $this->sessionTenant->identifier();
if ($tenantId === null) { if ($tenantId === null) {
return new JsonResponse(['error' => 'Invalid session state'], 400); return new JsonResponse(['error' => 'Invalid session state'], 400);
@@ -82,7 +82,7 @@ class PasswordController extends ControllerAbstract
#[AuthenticatedRoute('/reset', name: 'password.admin.reset', methods: ['POST'], permissions: ['authentication_provider_password.admin.manage'])] #[AuthenticatedRoute('/reset', name: 'password.admin.reset', methods: ['POST'], permissions: ['authentication_provider_password.admin.manage'])]
public function adminReset(string $uid, string $password): JsonResponse public function adminReset(string $uid, string $password): JsonResponse
{ {
$tenantId = $this->tenantContext->identifier(); $tenantId = $this->sessionTenant->identifier();
if ($tenantId === null) { if ($tenantId === null) {
return new JsonResponse(['error' => 'Invalid session state'], 400); return new JsonResponse(['error' => 'Invalid session state'], 400);
@@ -113,7 +113,7 @@ class PasswordController extends ControllerAbstract
#[AuthenticatedRoute('/remove', name: 'password.admin.remove', methods: ['POST'], permissions: ['authentication_provider_password.admin.manage'])] #[AuthenticatedRoute('/remove', name: 'password.admin.remove', methods: ['POST'], permissions: ['authentication_provider_password.admin.manage'])]
public function adminRemove(string $uid): JsonResponse public function adminRemove(string $uid): JsonResponse
{ {
$tenantId = $this->tenantContext->identifier(); $tenantId = $this->sessionTenant->identifier();
if ($tenantId === null) { if ($tenantId === null) {
return new JsonResponse(['error' => 'Invalid session state'], 400); return new JsonResponse(['error' => 'Invalid session state'], 400);
+3 -3
View File
@@ -133,7 +133,7 @@ const saveChanges = async () => {
label="Current Password" label="Current Password"
placeholder="············" placeholder="············"
variant="outlined" variant="outlined"
autocomplete="new-password" autocomplete="off"
@click:append-inner="isCurrentPasswordVisible = !isCurrentPasswordVisible" @click:append-inner="isCurrentPasswordVisible = !isCurrentPasswordVisible"
/> />
</VCol> </VCol>
@@ -150,7 +150,7 @@ const saveChanges = async () => {
label="New Password" label="New Password"
placeholder="············" placeholder="············"
variant="outlined" variant="outlined"
autocomplete="new-password" autocomplete="suppress"
@click:append-inner="isNewPasswordVisible = !isNewPasswordVisible" @click:append-inner="isNewPasswordVisible = !isNewPasswordVisible"
/> />
</VCol> </VCol>
@@ -164,7 +164,7 @@ const saveChanges = async () => {
label="Confirm New Password" label="Confirm New Password"
placeholder="············" placeholder="············"
variant="outlined" variant="outlined"
autocomplete="new-password" autocomplete="suppress"
:error="confirmPassword.length > 0 && confirmPassword !== newPassword" :error="confirmPassword.length > 0 && confirmPassword !== newPassword"
:error-messages="confirmPassword.length > 0 && confirmPassword !== newPassword ? ['Passwords do not match'] : []" :error-messages="confirmPassword.length > 0 && confirmPassword !== newPassword ? ['Passwords do not match'] : []"
@click:append-inner="isConfirmPasswordVisible = !isConfirmPasswordVisible" @click:append-inner="isConfirmPasswordVisible = !isConfirmPasswordVisible"
+18 -15
View File
@@ -6,7 +6,7 @@ namespace KTXT\AuthenticationProviderPassword\Tests\Integration;
use KTXC\Http\Request\Request; use KTXC\Http\Request\Request;
use KTXC\Http\Response\Response; use KTXC\Http\Response\Response;
use KTXC\Application; use KTXC\Server;
use KTXC\Stores\UserRolesStore; use KTXC\Stores\UserRolesStore;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
@@ -19,11 +19,11 @@ use PHPUnit\Framework\TestCase;
* through the real HTTP kernel (routing, tenant resolution, auth middleware, * through the real HTTP kernel (routing, tenant resolution, auth middleware,
* controller), not by calling controllers directly. * controller), not by calling controllers directly.
* *
* A fresh Application (and DI container) is built for every request() call, * A fresh Server (and DI container) is built for every request() call,
* mirroring the one-process-per-request model this app is actually * mirroring the one-process-per-request model this app is actually
* deployed under. Session identity is a container-lifetime singleton that * deployed under. Session identity is a container-lifetime singleton that
* AuthenticationMiddleware only ever sets, never clears, so reusing one * AuthenticationMiddleware only ever sets, never clears, so reusing one
* Application across requests would leak an authenticated identity from one * Server across requests would leak an authenticated identity from one
* "request" into the next — a problem that can't occur in production, * "request" into the next — a problem that can't occur in production,
* where each request gets its own process, but very much can here. * where each request gets its own process, but very much can here.
* *
@@ -37,7 +37,7 @@ abstract class IntegrationTestCase extends TestCase
public static function setUpBeforeClass(): void public static function setUpBeforeClass(): void
{ {
if (static::buildApplication()->environment() === 'prod') { if (static::buildServer()->environment() === 'prod') {
self::fail('Refusing to run integration tests against a server configured for the "prod" environment.'); self::fail('Refusing to run integration tests against a server configured for the "prod" environment.');
} }
@@ -58,9 +58,9 @@ abstract class IntegrationTestCase extends TestCase
} }
} }
protected static function buildApplication(): Application protected static function buildServer(): Server
{ {
return Application::create(SERVER_ROOT); return new Server(SERVER_ROOT);
} }
// ========================================================================= // =========================================================================
@@ -103,16 +103,17 @@ abstract class IntegrationTestCase extends TestCase
*/ */
protected static function createRoleWithPermissions(array $permissions, string $label = 'Test Role'): string protected static function createRoleWithPermissions(array $permissions, string $label = 'Test Role'): string
{ {
$application = static::buildApplication(); $server = static::buildServer();
try { try {
$application->kernel()->boot(); $server->kernel()->boot();
$store = $application->container()->get(UserRolesStore::class); $store = $server->container()->get(UserRolesStore::class);
$role = $store->createRole(static::$tenantIdentifier, [ $role = $store->createRole(static::$tenantIdentifier, [
'label' => $label, 'label' => $label,
'permissions' => $permissions, 'permissions' => $permissions,
]); ]);
} finally { } finally {
$application->shutdown(); restore_error_handler();
restore_exception_handler();
} }
return $role['rid']; return $role['rid'];
@@ -173,13 +174,15 @@ abstract class IntegrationTestCase extends TestCase
$uri = 'http://' . static::$tenantDomain . $path; $uri = 'http://' . static::$tenantDomain . $path;
$request = Request::create($uri, $method, [], [], [], $server, $content); $request = Request::create($uri, $method, [], [], [], $server, $content);
// A fresh application mirrors production while shutdown restores its // Kernel::boot() registers a global error/exception handler per
// process-level error handler after the in-process request. // instance and never removes it (fine under one-process-per-request
$application = static::buildApplication(); // in production; here it would otherwise stack a handler per test).
// Pop back to whatever was in place before this request.
try { try {
$response = $application->runHttpRequest($request); $response = static::buildServer()->handle($request);
} finally { } finally {
$application->shutdown(); restore_error_handler();
restore_exception_handler();
} }
$body = $response->getContent(); $body = $response->getContent();