TenantAtlas/apps/platform/tests/Unit/Support/TenantConfiguration/Spec420M365CaptureRedactionTest.php
ahmido a73a8f5882 feat: complete m365 generic evidence coverage pack (#487)
Committing and publishing the current Spec 420 package changes.

Includes updated services, coverage tests, browser smoke coverage, and the spec/plan/tasks artifacts for the package.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #487
2026-06-27 12:24:00 +00:00

25 lines
941 B
PHP

<?php
declare(strict_types=1);
use App\Services\TenantConfiguration\CoveragePayloadRedactor;
it('Spec420 redacts M365 permission and provider context secrets recursively', function (): void {
$redacted = (new CoveragePayloadRedactor)->redact([
'provider_connection_id' => 10,
'Authorization' => 'Bearer secret',
'clientSecret' => 'secret',
'permission_context' => [
'access_token' => 'token',
'refreshToken' => 'refresh',
'scopes_granted' => ['Policy.Read.All'],
],
]);
expect($redacted['Authorization'])->toBe('[redacted]')
->and($redacted['clientSecret'])->toBe('[redacted]')
->and($redacted['permission_context']['access_token'])->toBe('[redacted]')
->and($redacted['permission_context']['refreshToken'])->toBe('[redacted]')
->and($redacted['permission_context']['scopes_granted'])->toBe(['Policy.Read.All']);
});