2 Commits

Author SHA1 Message Date
Sebastian 08f1ccb6e2 chore(deps): update dependency vite to v8.2.2
Build Test / test (pull_request) Successful in 52s
JS Unit Tests / test (pull_request) Successful in 42s
PHP Integration Tests / Integration Tests (pull_request) Failing after 1m25s
PHP Unit Tests / test (pull_request) Successful in 1m15s
2026-08-30 03:04:14 +00:00
Sebastian 147885377a refactor(core): centralize reserved system user identity
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-08-28 19:36:15 -04:00
2 changed files with 8 additions and 6 deletions
+6 -5
View File
@@ -14,6 +14,7 @@ use KTXC\Resource\ProviderManager;
use KTXF\Mail\Provider\ProviderBaseInterface;
use KTXF\Mail\Provider\ProviderServiceMutateInterface;
use KTXF\Resource\Provider\ResourceServiceMutateInterface;
use KTXF\Resource\SystemIdentity;
use KTXM\ProviderMailSystem\Stores\ServiceStore;
/**
@@ -108,7 +109,7 @@ class Provider implements ProviderBaseInterface, ProviderServiceMutateInterface
{
// routes are tenant scoped and only visible in the system user context,
// keeping them out of regular user account listings
if ($userId !== self::USER_SYSTEM) {
if ($userId !== SystemIdentity::USER) {
return [];
}
@@ -122,7 +123,7 @@ class Provider implements ProviderBaseInterface, ProviderServiceMutateInterface
public function serviceFetch(string $tenantId, string $userId, string|int $identifier): ?Service
{
if ($userId !== self::USER_SYSTEM) {
if ($userId !== SystemIdentity::USER) {
return null;
}
@@ -147,7 +148,7 @@ class Provider implements ProviderBaseInterface, ProviderServiceMutateInterface
if (!str_ends_with($address, self::ADDRESS_DOMAIN_SUFFIX)) {
return null;
}
if ($userId !== self::USER_SYSTEM) {
if ($userId !== SystemIdentity::USER) {
return null;
}
@@ -170,7 +171,7 @@ class Provider implements ProviderBaseInterface, ProviderServiceMutateInterface
public function serviceExtant(string $tenantId, string $userId, string|int ...$identifiers): array
{
if ($userId !== self::USER_SYSTEM) {
if ($userId !== SystemIdentity::USER) {
return array_fill_keys(array_map('strval', $identifiers), false);
}
@@ -223,7 +224,7 @@ class Provider implements ProviderBaseInterface, ProviderServiceMutateInterface
*/
protected function assertSystemContext(string $userId): void
{
if ($userId !== self::USER_SYSTEM) {
if ($userId !== SystemIdentity::USER) {
throw new InvalidArgumentException('System mail routes can only be managed in the system user context');
}
}
+2 -1
View File
@@ -28,6 +28,7 @@ use KTXF\Resource\Identifier\EntityIdentifierInterface;
use KTXF\Resource\Provider\ProviderInterface;
use KTXF\Resource\Provider\ResourceServiceIdentityInterface;
use KTXF\Resource\Provider\ResourceServiceLocationInterface;
use KTXF\Resource\SystemIdentity;
use KTXF\Resource\Range\IRange;
use KTXF\Resource\Range\RangeType;
use KTXF\Resource\Sort\ISort;
@@ -422,7 +423,7 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceE
throw new RuntimeException("Target mail provider '$providerId' is not available");
}
$service = $provider->serviceFetch($this->serviceTenantId, ProviderBaseInterface::USER_SYSTEM, $serviceId);
$service = $provider->serviceFetch($this->serviceTenantId, SystemIdentity::USER, $serviceId);
if ($service === null) {
throw new RuntimeException("Target mail service '$providerId/$serviceId' was not found");
}