TenantAtlas/apps/platform/app/Services/TenantConfiguration/DisabledExchangePowerShellCommandRunner.php
ahmido 9374260ae1 feat: add Exchange PowerShell invocation gate (#498)
## Summary
- Adds the Spec 431 Exchange PowerShell invocation gate and operation registration slice.
- Introduces trusted provider operation start handling and read-only Exchange PowerShell runner abstractions.
- Updates provider capability/readiness evaluation and coverage for Exchange PowerShell invocation safety.

## Verification
- `cd apps/platform && ./vendor/bin/sail artisan test tests/Feature/Providers/ProviderCapabilityEvaluationTest.php tests/Feature/Providers/ProviderOperationCapabilityGateTest.php tests/Feature/TenantConfiguration/Spec431ExchangePowerShellInvocationGateTest.php tests/Unit/Providers/ProviderCapabilityRegistryTest.php tests/Unit/Providers/ProviderOperationStartGateTest.php tests/Unit/Support/TenantConfiguration/Spec430ExchangePowerShellCommandAllowlistTest.php tests/Unit/Support/TenantConfiguration/Spec431ExchangePowerShellOperationRegistrationTest.php tests/Unit/Verification/ManagedEnvironmentPermissionCapabilityMappingTest.php`
- Result: 80 passed, 685 assertions.

## Product Surface / Ops
- Rendered UI surface changed: N/A.
- Filament/Livewire surface changed: N/A.
- Deployment impact: config/runtime service changes only; no migrations, queues, or assets added.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #498
2026-07-07 15:23:29 +00:00

26 lines
855 B
PHP

<?php
declare(strict_types=1);
namespace App\Services\TenantConfiguration;
use App\Support\Providers\ProviderReasonCodes;
final class DisabledExchangePowerShellCommandRunner implements ExchangePowerShellCommandRunner
{
public function run(
ExchangePowerShellCommandContract $commandContract,
ExchangePowerShellInvocationContext $context,
): ExchangePowerShellInvocationResult {
return ExchangePowerShellInvocationResult::blocked(
reasonCode: ProviderReasonCodes::ProviderBindingUnsupported,
failureCode: 'execution_blocked_runner_disabled',
message: 'Exchange PowerShell production invocation is disabled for this release.',
context: [
'runner_mode' => $context->runnerMode,
'execution_enabled' => false,
],
);
}
}