feat(verification_kginicis): 라이브 MID 자동완성 방지 + SRB 프리픽스 전환
- 라이브 자격증명 입력칸 브라우저 자동완성 자동 채움 차단 (live_mid: one-time-code / live_api_key: new-password — 크롬이 autoComplete=off 를 무시함을 실측 후 강화) - 라이브 가맹점 MID 프리픽스를 이니시스 정책 변경에 맞춰 SRA→SRB 전환. 런타임 프리픽스를 InicisIdentityProvider::LIVE_MID_PREFIX 상수로 추출, 표시 문자열(라벨·Span·힌트 ko/en/ja)은 값 교체. - 설정 저장 테스트가 실제 스토리지 설정 파일을 오염시키던 결함 격리 (PluginTestCase 에서 plugins 디스크를 테스트 전용 경로로 격리) - 설정 화면 배너 아이콘 크기 시맨틱 정정 (w-N h-N → text-*, 정렬 회귀 해결) - 프리픽스 상수 ↔ 표시 문자열 정합 audit 룰 추가 (이중관리 불일치 차단)
This commit is contained in:
1 parent
cd3f6ad2b7
commit
57ac2b0b3b
21 files changed
+331
-32
No files matched your search
@@ -4,7 +4,9 @@ namespace Plugins\Sirsoft\VerificationKginicis\Tests;
|
||||
|
||||
use App\Extension\HookListenerRegistrar;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Plugins\Sirsoft\VerificationKginicis\Listeners\AssertNoDuplicateInicisIdentity;
|
||||
use Plugins\Sirsoft\VerificationKginicis\Listeners\CleanInicisRecordOnUserDelete;
|
||||
use Plugins\Sirsoft\VerificationKginicis\Listeners\CleanInicisRecordOnUserWithdraw;
|
||||
@@ -25,6 +27,9 @@ abstract class PluginTestCase extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
/** 테스트 격리용 임시 plugins 스토리지 루트 (setUp 에서 생성, tearDown 에서 제거). */
|
||||
private ?string $isolatedPluginsRoot = null;
|
||||
|
||||
protected function migrateFreshUsing(): array
|
||||
{
|
||||
return [
|
||||
@@ -42,6 +47,8 @@ abstract class PluginTestCase extends TestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->isolatePluginStorage();
|
||||
|
||||
$this->registerPluginAutoload();
|
||||
|
||||
// 플러그인 lang 네임스페이스 등록 — 실 환경에서는 코어 TranslationServiceProvider::boot()
|
||||
@@ -84,6 +91,54 @@ abstract class PluginTestCase extends TestCase
|
||||
$this->registerPluginHookListeners();
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
$this->restorePluginStorage();
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* 플러그인 스토리지('plugins' 디스크)를 테스트 전용 임시 디렉토리로 격리한다.
|
||||
*
|
||||
* 설정 저장 테스트(PluginSettingsService::save)는 코어 'plugins' 디스크
|
||||
* (root = storage_path('app/plugins'))에 setting.json 을 쓴다. 격리하지 않으면
|
||||
* 테스트가 실제 로컬 런타임 설정 파일을 덮어써 라이브 모드/자격증명이 오염된다
|
||||
* (RefreshDatabase 는 DB 만 롤백하고 파일시스템은 되돌리지 않음). 디스크 root 를
|
||||
* 임시 경로로 바꾸고 resolved 인스턴스를 purge 하여 실제 파일을 원천적으로 못
|
||||
* 건드리게 한다.
|
||||
*/
|
||||
private function isolatePluginStorage(): void
|
||||
{
|
||||
// Laravel 이 테스트용 쓰기 공간으로 보장하는 storage/framework/testing 하위를 사용한다.
|
||||
// sys_get_temp_dir() 은 CI/컨테이너/open_basedir 제약 환경에서 위치가 다르거나
|
||||
// 쓰기 불가일 수 있어 프로젝트 내부의 격리 경로를 쓴다 (Laravel 규약 준수).
|
||||
$this->isolatedPluginsRoot = storage_path(
|
||||
'framework/testing/plugin-storage-'.uniqid('', true)
|
||||
);
|
||||
|
||||
File::ensureDirectoryExists($this->isolatedPluginsRoot);
|
||||
|
||||
config(['filesystems.disks.plugins.root' => $this->isolatedPluginsRoot]);
|
||||
|
||||
// 이미 resolve 된 'plugins' 디스크 인스턴스를 폐기해 새 root 로 재생성되게 한다.
|
||||
Storage::forgetDisk('plugins');
|
||||
}
|
||||
|
||||
/**
|
||||
* 격리 임시 디렉토리를 제거한다 (테스트 간 잔여 파일 격리).
|
||||
*/
|
||||
private function restorePluginStorage(): void
|
||||
{
|
||||
if ($this->isolatedPluginsRoot !== null && is_dir($this->isolatedPluginsRoot)) {
|
||||
File::deleteDirectory($this->isolatedPluginsRoot);
|
||||
}
|
||||
|
||||
$this->isolatedPluginsRoot = null;
|
||||
|
||||
Storage::forgetDisk('plugins');
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin 의 hook listener 들을 코어 HookManager 에 등록.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user