1 Commits

Author SHA1 Message Date
Sebastian 4d96ceaad5 chore: implement js test suites
Build Test / test (pull_request) Successful in 1m4s
JS Unit Tests / test (pull_request) Successful in 55s
PHP Integration Tests / Integration Tests (pull_request) Successful in 2m13s
PHP Unit Tests / test (pull_request) Successful in 2m17s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-07-24 00:13:52 -04:00
4 changed files with 584 additions and 151 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
services: services:
mongo: mongo:
image: mongo:8 image: mongo:7
options: >- options: >-
--health-cmd "mongosh --quiet --eval \"db.adminCommand('ping')\"" --health-cmd "mongosh --quiet --eval \"db.adminCommand('ping')\""
--health-interval 5s --health-interval 5s
+7 -7
View File
@@ -14,8 +14,8 @@ use KTXC\Http\Response\JsonResponse;
use KTXC\Http\Response\Response; use KTXC\Http\Response\Response;
use KTXC\Http\Response\StreamedNdJsonResponse; use KTXC\Http\Response\StreamedNdJsonResponse;
use KTXC\Http\Response\StreamedResponse; use KTXC\Http\Response\StreamedResponse;
use KTXC\Context\IdentityContextInterface; use KTXC\SessionIdentity;
use KTXC\Context\TenantContextInterface; use KTXC\SessionTenant;
use KTXF\Controller\ControllerAbstract; use KTXF\Controller\ControllerAbstract;
use KTXF\Json\JsonSerializable; use KTXF\Json\JsonSerializable;
use KTXF\Resource\Identifier\CollectionIdentifier; use KTXF\Resource\Identifier\CollectionIdentifier;
@@ -51,8 +51,8 @@ class DefaultController extends ControllerAbstract {
private const ERR_INVALID_DATA = 'Invalid parameter: data must be an array'; private const ERR_INVALID_DATA = 'Invalid parameter: data must be an array';
public function __construct( public function __construct(
private readonly TenantContextInterface $tenantContext, private readonly SessionTenant $tenantIdentity,
private readonly IdentityContextInterface $identityContext, private readonly SessionIdentity $userIdentity,
private Manager $manager, private Manager $manager,
private readonly LoggerInterface $logger private readonly LoggerInterface $logger
) {} ) {}
@@ -80,13 +80,13 @@ class DefaultController extends ControllerAbstract {
): Response { ): Response {
// authorize request // authorize request
$tenantId = $this->tenantContext->identifier(); $tenantId = $this->tenantIdentity->identifier();
$userId = $this->identityContext->identifier(); $userId = $this->userIdentity->identifier();
// acting-user override: only the reserved system context is permitted, // acting-user override: only the reserved system context is permitted,
// gated on the system mail management permission // gated on the system mail management permission
if ($user !== null && $user !== $userId) { if ($user !== null && $user !== $userId) {
if ($user !== ProviderBaseInterface::USER_SYSTEM || !$this->identityContext->hasPermission('mail_manager.system')) { if ($user !== ProviderBaseInterface::USER_SYSTEM || !$this->userIdentity->hasPermission('mail_manager.system')) {
return new JsonResponse([ return new JsonResponse([
'version' => $version, 'version' => $version,
'transaction' => $transaction, 'transaction' => $transaction,
+574 -141
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -18,9 +18,9 @@
"test:coverage": "vitest run --coverage --config tests/js/vitest.config.ts" "test:coverage": "vitest run --coverage --config tests/js/vitest.config.ts"
}, },
"dependencies": { "dependencies": {
"pinia": "^4.0.0", "pinia": "^3.0.0",
"vue": "^3.5.18", "vue": "^3.5.18",
"vue-router": "^5.2.0", "vue-router": "^5.0.0",
"vuetify": "^4.0.0" "vuetify": "^4.0.0"
}, },
"devDependencies": { "devDependencies": {