TenantAtlas/apps/platform/tests/Feature/Guards/ProviderConnectionMicrosoftScopeLeakGuardTest.php
Ahmed Darrazi 19132dc433
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 1m28s
feat: normalize provider connection scope contracts
2026-05-07 21:27:15 +02:00

37 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
it('keeps Microsoft-shaped provider scope out of shared provider platform-core contracts', function (): void {
$root = base_path();
$forbiddenByPath = [
'app/Services/Providers/ProviderIdentityResolution.php' => [
'tenantContext',
'target_scope.entra_tenant_id',
],
'app/Services/Providers/ProviderIdentityResolver.php' => [
'tenantContext',
],
'app/Services/Providers/PlatformProviderIdentityResolver.php' => [
'tenantContext',
],
'app/Services/Providers/ProviderOperationStartGate.php' => [
"'entra_tenant_id' =>",
'target_scope.entra_tenant_id',
],
'config/provider_boundaries.php' => [
'target_scope.entra_tenant_id',
],
];
foreach ($forbiddenByPath as $relativePath => $fragments) {
$contents = (string) file_get_contents($root.'/'.$relativePath);
foreach ($fragments as $fragment) {
expect($contents)
->not->toContain($fragment, sprintf('%s still exposes [%s] as shared provider-scope truth.', $relativePath, $fragment));
}
}
});