fix(core,ecommerce,board,admin_basic): 고아 카탈로그 차단 + 설정 저장 파이프라인 정합
확장이 훅으로 등록한 카탈로그에서 고른 값은 그 확장이 사라져도 저장값으로 남는다. 그 상태에서 값만 보고 판정하면 이미 제공 불가한 항목이 사용자 화면에 그대로 노출된다. 예외도 경고도 로그도 남지 않아 관리자 화면과 나란히 보지 않으면 드러나지 않는다. - 결제수단에 지정한 PG, 현금영수증 발급사, 검색엔진 드라이버 세 축에 같은 판정을 적용. 공개 응답에서는 제거하고 관리자 응답에는 표시를 남긴다 — 운영자가 고쳐야 할 대상이라 감추면 복구 경로가 사라진다. 서버 검증도 같은 판정을 공유해 화면 우회 제출을 막는다. - 설정 단건 저장이 벌크 저장과 다른 경로를 타던 문제를 코어·이커머스·게시판에서 정리. 저장은 성공하고 파생 값만 갱신되지 않아 어느 화면에서 저장했느냐로 결과가 갈렸다. - 단건 저장의 값 형태 계약 신설. 빈 값으로 되돌릴 수 있게 하고, 타입은 defaults.json 의 기본값을 SSoT 로 삼는다. 해석 불가한 입력은 조용히 캐스팅하지 않고 거절한다. - 드라이버 셀렉트를 서버 카탈로그에 바인딩하고, 저장값이 카탈로그에 없으면 그 값을 드러내는 안내를 8곳 전수에 붙인다. 종전에는 빈 칸으로만 보여 무엇이 저장됐는지 알 수 없었다. 시나리오 매니페스트 8종을 면제 없이 신설했다. `audit:allow` 는 cross product 와 effects 검사를 함께 끄므로, 면제가 걸린 매니페스트에 선언을 추가하면 검증이 회복되지 않는다. 그 아래에서 대응 테스트가 없는 effect 이름 2건이 살아남아 있었고, 함께 정리했다.
This commit is contained in:
1 parent
d7ef20668a
commit
d970117149
113 files changed
+6313
-168
No files matched your search
@@ -8,11 +8,15 @@ use App\Enums\IdentityOriginType;
|
||||
use App\Enums\IdentityPolicyAppliesTo;
|
||||
use App\Enums\IdentityPolicyFailMode;
|
||||
use App\Enums\IdentityPolicySourceType;
|
||||
use App\Enums\IdentityVerificationStatus;
|
||||
use App\Exceptions\IdentityVerificationRequiredException;
|
||||
use App\Extension\HookManager;
|
||||
use App\Extension\IdentityVerification\IdentityVerificationManager;
|
||||
use App\Extension\ModuleManager;
|
||||
use App\Extension\PluginManager;
|
||||
use App\Models\IdentityPolicy;
|
||||
use App\Models\User;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* 본인인증 정책 해석/강제 Service.
|
||||
@@ -159,10 +163,13 @@ class IdentityPolicyService
|
||||
* `resolveRenderHint` 와 동일한 우선순위 체인을 적용하여, 정책에 provider 를 지정하지 않아도
|
||||
* 환경설정의 기본값이 launcher payload 의 provider_id 로 전달되도록 한다.
|
||||
*
|
||||
* 428 강제 경로와 프론트 프리페치 엔드포인트가 이 게터 하나로 수렴한다 — 같은 데이터에
|
||||
* 두 개의 해석이 존재하면 한쪽만 조용히 raw 값을 내보낸다(A6a).
|
||||
*
|
||||
* @param IdentityPolicy $policy 대상 정책
|
||||
* @return string|null 해석된 provider id (해석 실패 시 정책의 원본 값)
|
||||
*/
|
||||
protected function resolveProviderId(IdentityPolicy $policy): ?string
|
||||
public function resolveProviderId(IdentityPolicy $policy): ?string
|
||||
{
|
||||
try {
|
||||
$providerId = $policy->provider_id;
|
||||
@@ -193,7 +200,7 @@ class IdentityPolicyService
|
||||
*
|
||||
* @param array<string, mixed> $filters 필터 조건
|
||||
* @param int $perPage 페이지 크기
|
||||
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
|
||||
* @return LengthAwarePaginator
|
||||
*/
|
||||
public function search(array $filters, int $perPage = 20)
|
||||
{
|
||||
@@ -345,7 +352,7 @@ class IdentityPolicyService
|
||||
|
||||
if ($policy->source_type === IdentityPolicySourceType::Module) {
|
||||
try {
|
||||
$manager = app(\App\Extension\ModuleManager::class);
|
||||
$manager = app(ModuleManager::class);
|
||||
$module = $manager->getModuleByIdentifier($policy->source_identifier)
|
||||
?? $manager->getModule($policy->source_identifier);
|
||||
if ($module && method_exists($module, 'getIdentityPolicies')) {
|
||||
@@ -364,7 +371,7 @@ class IdentityPolicyService
|
||||
|
||||
if ($policy->source_type === IdentityPolicySourceType::Plugin) {
|
||||
try {
|
||||
$manager = app(\App\Extension\PluginManager::class);
|
||||
$manager = app(PluginManager::class);
|
||||
$plugin = $manager->getPlugin($policy->source_identifier);
|
||||
if ($plugin && method_exists($plugin, 'getIdentityPolicies')) {
|
||||
foreach ($plugin->getIdentityPolicies() as $data) {
|
||||
@@ -542,7 +549,7 @@ class IdentityPolicyService
|
||||
'channel' => 'policy',
|
||||
'user_id' => $user?->id,
|
||||
'target_hash' => $this->resolveTargetHash($user, $context) ?? str_repeat('0', 64),
|
||||
'status' => \App\Enums\IdentityVerificationStatus::PolicyViolationLogged->value,
|
||||
'status' => IdentityVerificationStatus::PolicyViolationLogged->value,
|
||||
'origin_type' => $context['origin_type'] ?? IdentityOriginType::Policy->value,
|
||||
'origin_identifier' => $context['origin_identifier'] ?? null,
|
||||
'origin_policy_key' => $policy->key,
|
||||
|
||||
Reference in new issue
Block a user