## Summary - move the Laravel application into `apps/platform` and keep the repository root for orchestration, docs, and tooling - update the local command model, Sail/Docker wiring, runtime paths, and ignore rules around the new platform location - add relocation quickstart/contracts plus focused smoke coverage for bootstrap, command model, routes, and runtime behavior ## Validation - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/PlatformRelocation` - integrated browser smoke validated `/up`, `/`, `/admin`, `/admin/choose-workspace`, and tenant route semantics for `200`, `403`, and `404` ## Remaining Rollout Checks - validate Dokploy build context and working-directory assumptions against the new `apps/platform` layout - confirm web, queue, and scheduler processes all start from the expected working directory in staging/production - verify no legacy volume mounts or asset-publish paths still point at the old root-level `public/` or `storage/` locations Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #213
43 lines
2.0 KiB
PHP
43 lines
2.0 KiB
PHP
<?php
|
|
|
|
use App\Services\Providers\PlatformProviderIdentityResolver;
|
|
use App\Support\Providers\ProviderConnectionType;
|
|
use App\Support\Providers\ProviderReasonCodes;
|
|
|
|
it('resolves the central platform identity from config', function (): void {
|
|
config()->set('graph.client_id', 'platform-client-id');
|
|
config()->set('graph.client_secret', 'platform-client-secret');
|
|
config()->set('graph.tenant_id', 'platform-home-tenant-id');
|
|
|
|
$resolution = app(PlatformProviderIdentityResolver::class)->resolve('customer-tenant-id');
|
|
|
|
expect($resolution->resolved)->toBeTrue()
|
|
->and($resolution->connectionType)->toBe(ProviderConnectionType::Platform)
|
|
->and($resolution->tenantContext)->toBe('customer-tenant-id')
|
|
->and($resolution->effectiveClientId)->toBe('platform-client-id')
|
|
->and($resolution->credentialSource)->toBe('platform_config')
|
|
->and($resolution->clientSecret)->toBe('platform-client-secret')
|
|
->and($resolution->authorityTenant)->toBe('platform-home-tenant-id')
|
|
->and($resolution->redirectUri)->toBe(route('admin.consent.callback'));
|
|
});
|
|
|
|
it('blocks platform identity resolution when the platform client id is missing', function (): void {
|
|
config()->set('graph.client_id', '');
|
|
config()->set('graph.client_secret', 'platform-client-secret');
|
|
|
|
$resolution = app(PlatformProviderIdentityResolver::class)->resolve('customer-tenant-id');
|
|
|
|
expect($resolution->resolved)->toBeFalse()
|
|
->and($resolution->effectiveReasonCode())->toBe(ProviderReasonCodes::PlatformIdentityMissing);
|
|
});
|
|
|
|
it('blocks platform identity resolution when the platform secret is missing', function (): void {
|
|
config()->set('graph.client_id', 'platform-client-id');
|
|
config()->set('graph.client_secret', '');
|
|
|
|
$resolution = app(PlatformProviderIdentityResolver::class)->resolve('customer-tenant-id');
|
|
|
|
expect($resolution->resolved)->toBeFalse()
|
|
->and($resolution->effectiveReasonCode())->toBe(ProviderReasonCodes::PlatformIdentityIncomplete);
|
|
});
|