Implements spec 425 with Entra certified compare pack support, coverage, guards, evaluator, fixtures, and tests. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #492
101 lines
2.4 KiB
PHP
101 lines
2.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services\TenantConfiguration;
|
|
|
|
use App\Support\TenantConfiguration\ClaimState;
|
|
|
|
final class EntraCertifiedComparePackResult
|
|
{
|
|
public const NOT_EVALUATED = 'certification_not_evaluated';
|
|
|
|
public const PASSED = 'certification_passed';
|
|
|
|
public const BLOCKED_MISSING_EVIDENCE = 'certification_blocked_missing_evidence';
|
|
|
|
public const BLOCKED_IDENTITY = 'certification_blocked_identity';
|
|
|
|
public const BLOCKED_COMPARE = 'certification_blocked_compare';
|
|
|
|
public const BLOCKED_RENDER = 'certification_blocked_render';
|
|
|
|
public const BLOCKED_REDACTION = 'certification_blocked_redaction';
|
|
|
|
public const BLOCKED_CLAIM_GUARD = 'certification_blocked_claim_guard';
|
|
|
|
/**
|
|
* @param list<string> $denominator
|
|
* @param list<array<string, mixed>> $resourceResults
|
|
* @param list<string> $blockers
|
|
*/
|
|
public function __construct(
|
|
private readonly string $scopeKey,
|
|
private readonly array $denominator,
|
|
private readonly string $state,
|
|
private readonly array $resourceResults = [],
|
|
private readonly array $blockers = [],
|
|
private readonly ?ClaimState $claimState = null,
|
|
) {}
|
|
|
|
public function scopeKey(): string
|
|
{
|
|
return $this->scopeKey;
|
|
}
|
|
|
|
/**
|
|
* @return list<string>
|
|
*/
|
|
public function denominator(): array
|
|
{
|
|
return $this->denominator;
|
|
}
|
|
|
|
public function state(): string
|
|
{
|
|
return $this->state;
|
|
}
|
|
|
|
public function certified(): bool
|
|
{
|
|
return $this->state === self::PASSED;
|
|
}
|
|
|
|
public function claimState(): ?ClaimState
|
|
{
|
|
return $this->claimState;
|
|
}
|
|
|
|
/**
|
|
* @return list<string>
|
|
*/
|
|
public function blockers(): array
|
|
{
|
|
return $this->blockers;
|
|
}
|
|
|
|
/**
|
|
* @return list<array<string, mixed>>
|
|
*/
|
|
public function resourceResults(): array
|
|
{
|
|
return $this->resourceResults;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'scope_key' => $this->scopeKey,
|
|
'denominator' => $this->denominator,
|
|
'state' => $this->state,
|
|
'certified' => $this->certified(),
|
|
'claim_state' => $this->claimState?->value,
|
|
'blockers' => $this->blockers,
|
|
'resource_results' => $this->resourceResults,
|
|
];
|
|
}
|
|
}
|