Implements Spec 081 provider-connection cutover. Highlights: - Adds provider connection resolution + gating for operations/verification. - Adds provider credential observer wiring. - Updates Filament tenant verify flow to block with next-steps when provider connection isn’t ready. - Adds spec docs under specs/081-provider-connection-cutover/ and extensive Spec081 test coverage. Tests: - vendor/bin/sail artisan test --compact tests/Feature/Filament/TenantSetupTest.php - Focused suites for ProviderConnections/Verification ran during implementation (see local logs). Co-authored-by: Ahmed Darrazi <ahmeddarrazi@MacBookPro.fritz.box> Reviewed-on: #98
60 lines
1.9 KiB
PHP
60 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Support\Providers;
|
|
|
|
final class ProviderReasonCodes
|
|
{
|
|
public const string ProviderConnectionMissing = 'provider_connection_missing';
|
|
|
|
public const string ProviderConnectionInvalid = 'provider_connection_invalid';
|
|
|
|
public const string ProviderCredentialMissing = 'provider_credential_missing';
|
|
|
|
public const string ProviderCredentialInvalid = 'provider_credential_invalid';
|
|
|
|
public const string ProviderConsentMissing = 'provider_consent_missing';
|
|
|
|
public const string ProviderAuthFailed = 'provider_auth_failed';
|
|
|
|
public const string ProviderPermissionMissing = 'provider_permission_missing';
|
|
|
|
public const string ProviderPermissionDenied = 'provider_permission_denied';
|
|
|
|
public const string ProviderPermissionRefreshFailed = 'provider_permission_refresh_failed';
|
|
|
|
public const string TenantTargetMismatch = 'tenant_target_mismatch';
|
|
|
|
public const string NetworkUnreachable = 'network_unreachable';
|
|
|
|
public const string RateLimited = 'rate_limited';
|
|
|
|
public const string UnknownError = 'unknown_error';
|
|
|
|
/**
|
|
* @return array<int, string>
|
|
*/
|
|
public static function all(): array
|
|
{
|
|
return [
|
|
self::ProviderConnectionMissing,
|
|
self::ProviderConnectionInvalid,
|
|
self::ProviderCredentialMissing,
|
|
self::ProviderCredentialInvalid,
|
|
self::ProviderConsentMissing,
|
|
self::ProviderAuthFailed,
|
|
self::ProviderPermissionMissing,
|
|
self::ProviderPermissionDenied,
|
|
self::ProviderPermissionRefreshFailed,
|
|
self::TenantTargetMismatch,
|
|
self::NetworkUnreachable,
|
|
self::RateLimited,
|
|
self::UnknownError,
|
|
];
|
|
}
|
|
|
|
public static function isKnown(string $reasonCode): bool
|
|
{
|
|
return in_array($reasonCode, self::all(), true) || str_starts_with($reasonCode, 'ext.');
|
|
}
|
|
}
|