## 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
74 lines
2.4 KiB
PHP
74 lines
2.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\EntraGroup;
|
|
use App\Models\Policy;
|
|
use App\Models\PolicyVersion;
|
|
|
|
it('renders cached group targets as resolved compact references on policy versions', function (): void {
|
|
[$user, $tenant] = createUserWithTenant(role: 'owner');
|
|
$this->actingAs($user);
|
|
|
|
$groupId = '11111111-2222-3333-4444-555555555555';
|
|
|
|
EntraGroup::factory()->for($tenant)->create([
|
|
'entra_id' => strtolower($groupId),
|
|
'display_name' => 'Group One',
|
|
'security_enabled' => true,
|
|
]);
|
|
|
|
$policy = Policy::factory()->for($tenant)->create();
|
|
|
|
$version = PolicyVersion::factory()->for($tenant)->create([
|
|
'policy_id' => (int) $policy->getKey(),
|
|
'assignments' => [
|
|
[
|
|
'intent' => 'apply',
|
|
'target' => [
|
|
'@odata.type' => '#microsoft.graph.groupAssignmentTarget',
|
|
'groupId' => $groupId,
|
|
],
|
|
],
|
|
[
|
|
'intent' => 'apply',
|
|
'target' => [
|
|
'@odata.type' => '#microsoft.graph.allDevicesAssignmentTarget',
|
|
],
|
|
],
|
|
],
|
|
]);
|
|
|
|
$this->get(\App\Filament\Resources\PolicyVersionResource::getUrl('view', ['record' => $version], tenant: $tenant))
|
|
->assertOk()
|
|
->assertSee('Group One')
|
|
->assertDontSee('Resolved')
|
|
->assertSee('All devices');
|
|
});
|
|
|
|
it('renders uncached group targets as external-only references when source context exists', function (): void {
|
|
[$user, $tenant] = createUserWithTenant(role: 'owner');
|
|
$this->actingAs($user);
|
|
|
|
$policy = Policy::factory()->for($tenant)->create();
|
|
|
|
$version = PolicyVersion::factory()->for($tenant)->create([
|
|
'policy_id' => (int) $policy->getKey(),
|
|
'assignments' => [
|
|
[
|
|
'intent' => 'apply',
|
|
'target' => [
|
|
'@odata.type' => '#microsoft.graph.groupAssignmentTarget',
|
|
'groupId' => 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
|
|
'group_display_name' => 'Source-only group',
|
|
],
|
|
],
|
|
],
|
|
]);
|
|
|
|
$this->get(\App\Filament\Resources\PolicyVersionResource::getUrl('view', ['record' => $version], tenant: $tenant))
|
|
->assertOk()
|
|
->assertSee('Source-only group')
|
|
->assertSee('Provider-only');
|
|
});
|