fix(release): 7.0.7 릴리즈 검증 발견 결함 전수 처리 및 출시일 8/18 정렬

7.0.7 페이로드 전수 검증에서 발견된 error 4건·warn 14건을 릴리즈 전에
처리했다. 미출시 분량의 자체 결함(회원 통합검색 500, 관리자 스코프 403 의
500 위장 등)이므로 페이로드에 합류시키고, 출시 대상 26개 CHANGELOG 의
버전 섹션 날짜를 2026-08-18 로 정렬했다.

- 통합검색 import 복원 + 이커머스 관리자 typed 403 catch 대칭(테스트 동반)
- admin 판정 스니핑 사설 사본 전수 수렴(BoardResource) + 조건 스캔 테스트
- 스케줄 인터프리터 변형 표기(확장자·버전 접미사) 정규화 차단
- ckeditor5 참조 판정 배치화·fail-safe, 결제 플러그인 진단 페이로드 대칭
- 템플릿 다크 대비·상태 Select value-제어 + --production 재빌드
- Upgrade_7_0_7 잔존 중복 색인 정리 스텝, API 문서·i18n(ko/en/ja) 동기
This commit is contained in:
HeuJung committed 2026-08-18 08:12:55 +09:00
1 parent ed985dd175
commit b3d0da9355
110 files changed
+1104 -369

No files matched your search

@@ -4,7 +4,7 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.0.2] - 2026-08-17
## [1.0.2] - 2026-08-18
### Security
@@ -19,7 +19,7 @@
- 에디터에 올렸지만 어떤 콘텐츠에서도 더 이상 사용되지 않는 이미지를 자동으로 정리할 수 있습니다. 플러그인 설정에서 자동 정리를 켜면(기본 꺼짐) 설정한 보존기간(기본 30일)이 지난 미사용 이미지를 파일과 기록까지 매일 삭제합니다. (#115 @Tuwasduliebst 님께서 건의해주셨습니다.)
- 「에디터 업로드 이미지」 관리 화면이 추가되었습니다. 업로드한 이미지를 미리보기·업로더·용량과 함께 확인하고, 사용 중인지 여부를 배지로 구분해 필요한 것만 골라 삭제할 수 있습니다(개별·선택 삭제).
- 사용 여부는 게시글·페이지·상품 설명 등 등록된 콘텐츠를 훑어 판정합니다. 자체 콘텐츠를 가진 확장은 판정 대상에 자기 콘텐츠를 등록할 수 있어, 그 확장에서만 쓰이는 이미지도 「사용 중」으로 올바르게 인식됩니다.
- 사용 여부는 게시글·페이지·상품 설명 등 등록된 콘텐츠를 훑어 판정합니다. 자체 콘텐츠를 가진 확장은 판정 대상에 자기 콘텐츠를 등록할 수 있어, 그 확장에서만 쓰이는 이미지도 「사용 중」으로 올바르게 인식됩니다. 비활성 상태의 모듈이 있으면 그 콘텐츠를 확인할 수 없으므로 자동 정리는 안전하게 건너뛰고, 관리 화면에도 판정이 불완전할 수 있음을 알립니다.
- 무엇이 지워질지 먼저 확인하려면 서버에서 `php artisan sirsoft-ckeditor5:prune-unused-images --dry-run` 을 실행하면 됩니다.
### Changed
@@ -68,6 +68,7 @@ Authorization: Bearer {YOUR_TOKEN}
| pagination.to | integer\|null | `3` | 현재 페이지 마지막 항목 순번 (비어 있으면 null) |
| meta.scan_limited | boolean | `false` | 참조 상태 필터가 스캔 윈도우 상한에 걸렸는지. true 면 그보다 오래된 이미지는 목록에 포함되지 않는다 |
| meta.scan_window | integer | `500` | 참조 상태 필터가 훑는 최신 업로드 건수 상한 |
| meta.reference_sources_incomplete | boolean | `false` | 설치돼 있으나 비활성인 모듈이 있어 참조 판정이 불완전할 수 있는지. true 면 그 모듈 콘텐츠에서만 쓰이는 이미지가 「미참조」로 오판될 수 있으므로 화면은 경고를 표시해야 한다 |
**응답 예시**
@@ -100,7 +101,8 @@ Authorization: Bearer {YOUR_TOKEN}
},
"meta": {
"scan_limited": false,
"scan_window": 500
"scan_window": 500,
"reference_sources_incomplete": false
}
}
}
@@ -250,4 +252,4 @@ Content-Type: application/json
관리 화면에서 체크한 이미지를 한 번에 삭제한다.
- 선택 범위는 **화면에 보이는 페이지**로 한정된다(화면 계약). 검색·필터·페이지 이동으로 목록에서 빠진 행의 선택이 남아 대상에 실리면, 운영자가 보지도 체크하지도 않은 파일이 지워지기 때문이다.
- 일부만 실패한 경우 요청 자체는 성공(200)으로 응답하고 `failed` 로 보고한다. 전부 실패한 경우에만 500 이다 — 부분 성공을 실패로 되돌릴 방법이 없기 때문이다.
- 일부만 실패한 경우 요청 자체는 성공(200)으로 응답하고 `failed` 로 보고하며, 응답 메시지도 "N건 삭제, M건 실패" 형태(`messages.uploads.bulk_partially_deleted`)로 실패 사실을 함께 안내한다. 전부 실패한 경우에만 500 이다 — 부분 성공을 실패로 되돌릴 방법이 없기 때문이다.
@@ -20,8 +20,10 @@ return [
'ids_invalid' => 'Some of the selected images no longer exist. Refresh the list and select again.',
'deleted' => 'The image has been deleted.',
'bulk_deleted' => 'Deleted :deleted selected image(s).',
'bulk_partially_deleted' => 'Deleted :deleted of the selected images; :failed could not be deleted and remain in the list.',
],
'cleanup' => [
'retention_disabled' => 'The retention period is less than 1 day, so no cleanup was performed.',
'sources_incomplete' => 'Unreferenced-image cleanup was skipped because an inactive module may hide content references. Activate or remove the module, then run again.',
],
];
@@ -20,8 +20,10 @@ return [
'ids_invalid' => '선택한 이미지 중 더 이상 존재하지 않는 항목이 있습니다. 목록을 새로고침한 뒤 다시 선택해 주세요.',
'deleted' => '이미지를 삭제했습니다.',
'bulk_deleted' => '선택한 이미지 :deleted건을 삭제했습니다.',
'bulk_partially_deleted' => '선택한 이미지 중 :deleted건을 삭제했고 :failed건은 삭제하지 못했습니다. 실패한 항목은 목록에 남아 있습니다.',
],
'cleanup' => [
'retention_disabled' => '보존기간이 1일 미만으로 설정되어 정리를 수행하지 않았습니다.',
'sources_incomplete' => '비활성 상태의 모듈이 있어 참조 판정이 불완전할 수 있으므로 미참조 이미지 정리를 건너뛰었습니다. 모듈을 활성화하거나 삭제한 뒤 다시 실행해 주세요.',
],
];
@@ -40,7 +40,8 @@
"button": "Delete",
"confirm_title": "Delete this image?",
"confirm_message": "The image file and its record will both be deleted. This cannot be undone.",
"success": "The image has been deleted."
"success": "The image has been deleted.",
"failed": "Failed to delete the image."
},
"bulk_delete": {
"button": "Delete selected",
@@ -40,7 +40,8 @@
"button": "삭제",
"confirm_title": "이미지를 삭제할까요?",
"confirm_message": "선택한 이미지의 파일과 기록이 함께 삭제됩니다. 이 작업은 되돌릴 수 없습니다.",
"success": "이미지를 삭제했습니다."
"success": "이미지를 삭제했습니다.",
"failed": "이미지 삭제에 실패했습니다."
},
"bulk_delete": {
"button": "선택 삭제",
@@ -512,7 +512,7 @@
"type": "composite",
"name": "DataGrid",
"props": {
"data": "{{ckeditor5Uploads?.data?.data}}",
"data": "{{ckeditor5Uploads?.data?.data ?? []}}",
"pagination": true,
"serverSidePagination": true,
"serverCurrentPage": "{{ckeditor5Uploads?.data?.pagination?.current_page ?? 1}}",
@@ -849,7 +849,7 @@
"handler": "toast",
"params": {
"type": "error",
"message": "{{error.message}}"
"message": "{{error.message ?? '$t:sirsoft-ckeditor5.admin.uploads.delete.failed'}}"
}
}
],
@@ -1020,7 +1020,7 @@
"handler": "toast",
"params": {
"type": "error",
"message": "{{error.message}}"
"message": "{{error.message ?? '$t:sirsoft-ckeditor5.admin.uploads.delete.failed'}}"
}
}
],
@@ -74,6 +74,13 @@ class PruneUnusedImagesCommand extends Command
$result = $this->cleanupService->pruneUnused($days, $limit, $isDryRun);
// 판정 불가로 건너뛴 회차 — "정리 완료(0건)" 로 보이면 운영자가 원인을 모른다.
if (($result['skipped_reason'] ?? null) === 'sources_incomplete') {
$this->warn(__('sirsoft-ckeditor5::messages.cleanup.sources_incomplete'));
return Command::SUCCESS;
}
if ($isDryRun) {
$this->renderDryRun($result, $days);
@@ -50,6 +50,7 @@ class ImageUploadAdminController extends AdminBaseController
'meta' => [
'scan_limited' => $result['scan_limited'],
'scan_window' => ImageUploadAdminService::SCAN_WINDOW,
'reference_sources_incomplete' => $result['reference_sources_incomplete'] ?? false,
],
]);
}
@@ -89,6 +90,17 @@ class ImageUploadAdminController extends AdminBaseController
return ResponseHelper::error('messages.uploads.file_delete_failed', 500, $result, domain: 'sirsoft-ckeditor5');
}
// 부분 실패를 성공 문구("N건 삭제")로 접으면 운영자가 남은 파일을 모른다 —
// 실패 건수를 문구에 함께 싣는다 (실패 상세는 data 페이로드).
if ($result['failed'] > 0) {
return ResponseHelper::success(
'messages.uploads.bulk_partially_deleted',
$result,
messageParams: ['deleted' => $result['deleted'], 'failed' => $result['failed']],
domain: 'sirsoft-ckeditor5',
);
}
return ResponseHelper::success(
'messages.uploads.bulk_deleted',
$result,
@@ -29,4 +29,17 @@ interface ImageReferenceSourceRepositoryInterface
* @return bool 하나라도 등장하면 true
*/
public function containsAnyToken(string $table, array $columns, array $tokens): bool;
/**
* 지정 소스에 등장하는 토큰들을 한 번의 순회로 찾아 반환합니다.
*
* 토큰별로 LIKE 전체 스캔을 반복하면 비용이 (토큰 수 × 테이블 크기) 로 커진다 —
* 일괄 판정(관리 화면 미참조 필터·prune)은 이 메서드로 소스당 1회 순회만 수행한다.
*
* @param string $table 테이블명 (프리픽스 제외)
* @param array<int, string> $columns 검사할 컬럼 목록
* @param array<int, string> $tokens 판정 토큰
* @return array<int, string> 소스에 등장하는 토큰 목록 (부분집합)
*/
public function findTokensInSource(string $table, array $columns, array $tokens): array;
}
@@ -50,6 +50,55 @@ class ImageReferenceSourceRepository implements ImageReferenceSourceRepositoryIn
->exists();
}
/**
* {@inheritDoc}
*/
public function findTokensInSource(string $table, array $columns, array $tokens): array
{
if ($columns === [] || $tokens === []) {
return [];
}
// id 키셋 순회가 불가능한 테이블은 토큰별 존재 확인으로 폴백한다.
if (! Schema::hasColumn($table, 'id')) {
return array_values(array_filter(
$tokens,
fn (string $token) => $this->containsAnyToken($table, $columns, [$token])
));
}
$pending = array_values(array_unique($tokens));
$found = [];
// LIKE 는 인덱스를 못 쓰므로 토큰별 쿼리는 (토큰 수 × 전체 스캔) 이 된다.
// 대신 소스를 키셋 청크로 1회만 읽고 PHP strpos 로 대조한다 — 비용이
// (테이블 크기 1회 + 행×잔여토큰 strpos) 로 고정되고, 토큰이 모두 발견되면
// 조기 종료한다.
DB::table($table)
->select(array_merge(['id'], $columns))
->lazyById(200)
->each(function ($row) use ($columns, &$pending, &$found) {
foreach ($columns as $column) {
$content = (string) ($row->{$column} ?? '');
if ($content === '') {
continue;
}
foreach ($pending as $index => $token) {
if (str_contains($content, $token)) {
$found[] = $token;
unset($pending[$index]);
}
}
}
return $pending !== []; // 전 토큰 발견 시 순회 중단
});
return $found;
}
/**
* LIKE 와일드카드를 이스케이프합니다.
*
@@ -36,10 +36,26 @@ class ImageCleanupService
* @param int $days 보존기간(일)
* @param int $limit 한 회차에 스캔할 최대 후보 수
* @param bool $dryRun true 면 판정만 하고 삭제하지 않음
* @return array{scanned: int, referenced: int, deleted: int, failed: int, items: array<int, array<string, mixed>>}
* @return array{scanned: int, referenced: int, deleted: int, failed: int, items: array<int, array<string, mixed>>, skipped_reason?: string}
*/
public function pruneUnused(int $days, int $limit, bool $dryRun = false): array
{
// 비활성 모듈이 있으면 그 모듈이 등록했을 참조 소스가 이번 판정에 빠져 있을 수
// 있다 — "미참조" 판정을 신뢰할 수 없으므로 실삭제 회차를 통째로 건너뛴다.
// (dry-run 은 삭제가 없으므로 판정 미리보기 용도로 계속 허용한다.)
if (! $dryRun && $this->scanner->hasPotentiallyMissingSources()) {
Log::warning('CKEditor5 미참조 정리 건너뜀 — 비활성 모듈이 있어 참조 소스가 불완전할 수 있습니다.');
return [
'scanned' => 0,
'referenced' => 0,
'deleted' => 0,
'failed' => 0,
'items' => [],
'skipped_reason' => 'sources_incomplete',
];
}
$threshold = Carbon::now()->subDays($days);
$candidates = $this->repository->findOlderThan($threshold, $limit);
@@ -51,8 +67,12 @@ class ImageCleanupService
'items' => [],
];
// 행별 isReferenced 반복 대신 일괄 판정 — 소스당 1회 순회로 비용을 고정한다.
$referencedMap = $this->scanner->mapReferenced($candidates);
foreach ($candidates as $upload) {
if ($this->scanner->isReferenced($upload)) {
// 판정 누락 행은 안전 방향(참조됨)으로 본다.
if ($referencedMap[(int) $upload->id] ?? true) {
$result['referenced']++;
continue;
@@ -98,8 +118,22 @@ class ImageCleanupService
return $this->repository->delete($upload);
}
// 행 disk 가 더 이상 등록돼 있지 않으면(공급 플러그인 비활성 등) withDisk 가
// InvalidArgumentException 을 던져 삭제/일괄삭제/prune 루프 전체가 500 으로
// 중단된다 — ImageServeService::serve 와 동일하게 존재 검증 후 폴백한다.
$disk = (string) ($upload->storage_disk ?? '');
$storage = $disk !== '' ? $this->storage->withDisk($disk) : $this->storage;
$useRowDisk = $disk !== ''
&& $disk !== $this->storage->getDisk()
&& config("filesystems.disks.{$disk}") !== null;
if ($disk !== '' && ! $useRowDisk && $disk !== $this->storage->getDisk()) {
Log::warning('CKEditor5 업로드의 저장 disk 가 미등록 상태 — 기본 스토리지로 폴백해 정리를 시도합니다.', [
'id' => $upload->id,
'disk' => $disk,
]);
}
$storage = $useRowDisk ? $this->storage->withDisk($disk) : $this->storage;
if (! $storage->exists($category, $relativePath)) {
// 파일이 이미 없는 고아 레코드 — 재시도 루프를 만들지 않도록 레코드를 정리한다.
@@ -2,6 +2,8 @@
namespace Plugins\Sirsoft\Ckeditor5\Services;
use App\Contracts\Repositories\ModuleRepositoryInterface;
use App\Enums\ExtensionStatus;
use App\Extension\HookManager;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
@@ -56,11 +58,31 @@ class ImageReferenceScanService
/**
* @param ImageReferenceSourceRepositoryInterface $sourceRepository 참조 소스 조회 리포지토리
* @param ModuleRepositoryInterface $moduleRepository 모듈 상태 조회 리포지토리 (소스 불완전 감지)
*/
public function __construct(
protected ImageReferenceSourceRepositoryInterface $sourceRepository
protected ImageReferenceSourceRepositoryInterface $sourceRepository,
protected ModuleRepositoryInterface $moduleRepository
) {}
/**
* 참조 소스가 불완전할 수 있는 상태인지 판정합니다.
*
* 참조 소스는 **활성** 모듈이 훅으로 등록한다 — 설치돼 있으나 비활성인 모듈이 있으면
* 그 모듈 콘텐츠(게시글 본문 등)가 이번 판정에 빠져, 실제로 쓰이는 이미지가
* "미참조" 로 오판된다(fail-open). 삭제(uninstalled)는 콘텐츠도 함께 정리되는
* 상태이므로 대상이 아니다.
*
* @return bool 비활성 설치 모듈이 하나라도 있으면 true
*/
public function hasPotentiallyMissingSources(): bool
{
// audit:allow query-unbounded-get reason: modules 는 설치된 확장 수에 묶인 설정성 테이블 — 행 수가 데이터 증가에 비례하지 않는다
return $this->moduleRepository->getAll()
->contains(fn ($module) => ! $module->isActive()
&& $module->status !== ExtensionStatus::Uninstalled->value);
}
/**
* 참조 스캔 대상 소스 목록을 반환합니다.
*
@@ -113,15 +135,61 @@ class ImageReferenceScanService
/**
* 업로드 목록의 참조 여부를 일괄 판정합니다.
*
* 행별로 isReferenced 를 반복하면 비용이 (행 수 × 소스 수 × LIKE 전체 스캔) 으로
* 커진다 — 여기서는 전 행의 토큰을 모아 소스당 1회 순회로 등장 토큰을 수집한다
* (비용 상한: 소스 크기 합 1회 + 조기 종료).
*
* @param Collection<int, Ckeditor5ImageUpload>|iterable<Ckeditor5ImageUpload> $uploads 업로드 목록
* @return array<int, bool> [업로드 ID => 참조 여부]
*/
public function mapReferenced(iterable $uploads): array
{
$map = [];
$tokenOwners = [];
foreach ($uploads as $upload) {
$map[(int) $upload->id] = $this->isReferenced($upload);
$id = (int) $upload->id;
$tokens = $this->buildTokens($upload);
if ($tokens === []) {
// 판정 토큰을 만들 수 없는 행은 안전 방향(참조됨)으로 본다.
$map[$id] = true;
continue;
}
$map[$id] = false;
foreach ($tokens as $token) {
$tokenOwners[$token][] = $id;
}
}
if ($tokenOwners === []) {
return $map;
}
$pending = $tokenOwners;
foreach ($this->getReferenceSources() as $source) {
if ($pending === []) {
break;
}
// PHP 배열 키는 순수 숫자 토큰을 int 로 접으므로 문자열로 복원해 넘긴다.
$foundTokens = $this->sourceRepository->findTokensInSource(
$source['table'],
$source['columns'],
array_map('strval', array_keys($pending))
);
foreach ($foundTokens as $token) {
foreach ($pending[$token] ?? [] as $id) {
$map[$id] = true;
}
unset($pending[$token]);
}
}
return $map;
@@ -68,6 +68,7 @@ class ImageUploadAdminService
'to' => $paginator->lastItem(),
],
'scan_limited' => false,
'reference_sources_incomplete' => false,
];
}
@@ -133,6 +134,15 @@ class ImageUploadAdminService
->filter(fn (Ckeditor5ImageUpload $upload) => (bool) $upload->referenced === $wantReferenced)
->values();
// 스캔 윈도우는 최신순 고정으로 확보하지만, 화면이 요청한 정렬(검증 완료 값)은
// 윈도우 안에서 그대로 적용한다 — 무시하면 "파일 크기순 + 미참조" 조합이
// 오류 없이 최신순으로만 나와 정렬이 동작하는 것처럼 보인다.
$sortBy = (string) ($filters['sort_by'] ?? 'created_at');
$sortDesc = strtolower((string) ($filters['sort_order'] ?? 'desc')) !== 'asc';
$matched = $matched
->sortBy([[$sortBy, $sortDesc ? 'desc' : 'asc'], ['id', 'desc']])
->values();
$total = $matched->count();
$lastPage = max(1, (int) ceil($total / max(1, $perPage)));
$currentPage = max(1, min($page, $lastPage));
@@ -149,6 +159,9 @@ class ImageUploadAdminService
'to' => $items->isEmpty() ? null : ($currentPage - 1) * $perPage + $items->count(),
],
'scan_limited' => $scanLimited,
// 비활성 모듈이 있으면 그 모듈의 콘텐츠가 판정에서 빠져 "미참조" 가
// 신뢰 불가다 — 화면이 경고를 표시할 수 있도록 메타로 알린다.
'reference_sources_incomplete' => $this->scanner->hasPotentiallyMissingSources(),
];
}
@@ -6,6 +6,7 @@ use App\Contracts\Extension\StorageInterface;
use App\Extension\HookManager;
use App\Support\ImageResizer;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use Plugins\Sirsoft\Ckeditor5\Models\Ckeditor5ImageUpload;
use Plugins\Sirsoft\Ckeditor5\Repositories\Contracts\ImageUploadRepositoryInterface;
@@ -38,8 +39,17 @@ class ImageUploadService
// 훅: 이미지 업로드 전 (본인인증 등 확장 지점)
HookManager::doAction('sirsoft-ckeditor5.image.before_upload', $file, $uploadedBy);
// 필터 훅 - 파일 데이터 변형 (압축, 리사이즈 등 확장 포인트)
$file = HookManager::applyFilters('sirsoft-ckeditor5.image.filter_upload_file', $file);
// 필터 훅 - 파일 데이터 변형 (압축, 리사이즈 등 확장 포인트).
// 잘못 작성된 리스너가 UploadedFile 이 아닌 값을 반환하면 원본으로 폴백한다 —
// 확장 결함이 코어 업로드 전면 장애(TypeError → 500)로 위장되면 안 된다.
$filtered = HookManager::applyFilters('sirsoft-ckeditor5.image.filter_upload_file', $file);
if ($filtered instanceof UploadedFile) {
$file = $filtered;
} else {
Log::warning('sirsoft-ckeditor5.image.filter_upload_file 필터가 UploadedFile 이 아닌 값을 반환해 원본을 사용합니다.', [
'returned_type' => get_debug_type($filtered),
]);
}
$extension = $file->guessExtension() ?? $file->getClientOriginalExtension();
$storedFilename = Str::uuid().'.'.$extension;
@@ -274,6 +274,7 @@ class ImageCleanupServiceTest extends PluginTestCase
$upload = $this->makeUpload('777777777777', 'locked.png');
$storage = \Mockery::mock(StorageInterface::class);
$storage->shouldReceive('getDisk')->andReturn('local');
$storage->shouldReceive('withDisk')->andReturnSelf();
$storage->shouldReceive('exists')->andReturnTrue();
$storage->shouldReceive('delete')->andReturnFalse();
@@ -4,7 +4,7 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.0.2] - 2026-08-17
## [1.0.2] - 2026-08-18
### Changed
+1 -1
View File
@@ -4,7 +4,7 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.0.3] - 2026-08-12
## [1.0.3] - 2026-08-18
### Fixed
@@ -296,6 +296,10 @@ class GdprConsentService
$activeConsents = $this->statusRepository->getActiveByUserId($userId);
// 루프 중간에 실패하면 일부 항목만 철회된 채 남는다 — 전부 철회되거나 전부 취소되게 한다.
// updateConsent 내부의 consent.before/after_update 훅도 이 트랜잭션 안에서
// 발화된다(의도): 리스너 예외 시 철회 전체가 롤백되는 것이 "전부 또는 전무"
// 계약이며, 외부 부수효과(알림 등)를 내는 리스너는 롤백 불가를 감안해
// 멱등하게 작성해야 한다.
DB::transaction(function () use ($userId, $activeConsents) {
foreach ($activeConsents as $consent) {
$this->updateConsent($userId, null, $consent->consent_key, false, 'withdraw');
@@ -4,7 +4,7 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.0.2] - 2026-08-17
## [1.0.2] - 2026-08-18
### Fixed
@@ -4,7 +4,7 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.1.1] - 2026-08-17
## [1.1.1] - 2026-08-18
### Security
@@ -66,7 +66,7 @@ class UserEscrowConfirmController extends Controller
* @param Request $request
* @return Response
*/
// audit:allow controller-base-request-injection reason: PG(이니시스)가 POST 하는 콜백 표면 — 필드 구성이 PG 소유라 계약을 닫을 수 없고, 값은 문자열 캐스팅 후 대조에만 사용
// audit:allow controller-base-request-injection reason: PG(이니시스)가 POST 하는 콜백 표면 — 필드 구성이 PG 소유라 계약을 닫을 수 없다. 값은 문자열 캐스팅 후 tid 대조를 거쳐 payment_meta 에 영속된다(서명 검증 없는 무인증 콜백이라 기록 위조 여지가 있는 사전 상태 — 표시용 메타이며 금액·상태 전이에는 미사용)
public function pcReturn(Request $request): Response
{
$resultCode = (string) $request->input('ResultCode', '');
@@ -109,7 +109,7 @@ class UserEscrowConfirmController extends Controller
* @param Request $request
* @return RedirectResponse
*/
// audit:allow controller-base-request-injection reason: PG(이니시스 모바일)가 POST 하는 콜백 표면 — 필드 구성이 PG 소유라 계약을 닫을 수 없고, 값은 문자열 캐스팅 후 대조에만 사용
// audit:allow controller-base-request-injection reason: PG(이니시스 모바일)가 POST 하는 콜백 표면 — 필드 구성이 PG 소유라 계약을 닫을 수 없다. 값은 문자열 캐스팅 후 tid 대조를 거쳐 payment_meta 에 영속된다(서명 검증 없는 무인증 콜백이라 기록 위조 여지가 있는 사전 상태 — 표시용 메타이며 금액·상태 전이에는 미사용)
public function mobileReturn(Request $request): RedirectResponse
{
$status = (string) $request->input('P_STATUS', '');
@@ -1,5 +1,7 @@
<?php
// audit:allow api-doc-coverage reason: docblock 서술 정정만 수행 — 검증 규칙/요청·응답 계약 무변경
declare(strict_types=1);
namespace Plugins\Sirsoft\PayKginicis\Http\Requests;
@@ -13,7 +15,9 @@ use Plugins\Sirsoft\PayKginicis\Support\PaymentLimits;
* 국내 짝(SignatureRequest)과 동일 강도 + timestamp/checkout_token.
*
* 계약 변경: 종전에는 checkout_token 이 비어 있으면 토큰 검증 단계에서 403 이었으나,
* 필수 검증으로 승격되어 422 가 된다. 클라이언트는 `.ok` 만 검사하므로 안전(실측).
* 필수 검증으로 승격되어 422 가 된다. CBT 클라이언트(requestPayment.ts)는
* `G7Core.api.post` 경유라 403/422 모두 실패 분기로 동일 취급되어 안전(실측 —
* raw fetch `.ok` 검사는 nicepayments signData 쪽 클라이언트의 방식).
*/
class CbtHashDataRequest extends FormRequest
{
@@ -4,7 +4,7 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.0.2] - 2026-08-17
## [1.0.2] - 2026-08-18
### Security
@@ -6,8 +6,6 @@ declare(strict_types=1);
namespace Plugins\Sirsoft\PayNhnkcp\Controllers;
// audit:allow api-doc-coverage 요청 파라미터·응답 구조 무변경 — 테이블명 리터럴을 모델 파생으로 정리한 내부 리팩토링 (#571)
use App\Helpers\ResponseHelper;
use App\Http\Controllers\Api\Base\AdminBaseController;
use Illuminate\Http\JsonResponse;
@@ -38,7 +36,6 @@ class AdminEscrowDeliveryController extends AdminBaseController
'deli_corp',
];
/** KCP 에스크로 택배사 코드표 */
/** 택배사 코드 → 택배사명 매핑 (KCP 공식 코드표 — EscrowDeliveryRegisterRequest 의 허용값 SSoT) */
public const COURIER_CODES = [
'04' => 'CJ대한통운',
@@ -6,8 +6,6 @@ declare(strict_types=1);
namespace Plugins\Sirsoft\PayNhnkcp\Controllers;
// audit:allow api-doc-coverage 요청 파라미터·응답 구조 무변경 — 테이블명 리터럴을 모델 파생으로 정리한 내부 리팩토링 (#571)
use App\Helpers\ResponseHelper;
use App\Http\Controllers\Api\Base\AdminBaseController;
use App\Services\PluginSettingsService;
@@ -6,8 +6,6 @@ declare(strict_types=1);
namespace Plugins\Sirsoft\PayNhnkcp\Controllers;
// audit:allow api-doc-coverage 요청 파라미터·응답 구조 무변경 — 테이블명 리터럴을 모델 파생으로 정리한 내부 리팩토링 (#571)
use App\Helpers\ResponseHelper;
use App\Http\Controllers\Api\Base\AdminBaseController;
use App\Services\PluginSettingsService;
@@ -6,8 +6,6 @@ declare(strict_types=1);
namespace Plugins\Sirsoft\PayNhnkcp\Controllers;
// audit:allow api-doc-coverage 요청 파라미터·응답 구조 무변경 — 테이블명 리터럴을 모델 파생으로 정리한 내부 리팩토링 (#571)
use App\Services\PluginSettingsService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -4,7 +4,7 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.0.2] - 2026-08-17
## [1.0.2] - 2026-08-18
### Security
@@ -103,14 +103,17 @@ class AdminEscrowController extends AdminBaseController
return ResponseHelper::success('common.success', $result);
} catch (\Exception $e) {
// 원문은 로그로만 — 응답 메시지 키 자리에 넘기면 키 해석에 실패해
// 예외 원문(스택 힌트 포함)이 그대로 관리자 화면에 나간다.
// 메시지 키 자리에는 원문 금지 — 키 해석에 실패해 원문이 그대로 나간다.
// 단 errors 페이로드는 관리자 전용 면의 진단 통로다(형제 KCP/이니시스
// 에스크로와 동형) — 비우면 운영자가 서버 로그 없이는 실패 원인을 모른다.
Log::error('NicePayments: escrow delivery registration failed', [
'tid' => $validated['tid'],
'error' => $e->getMessage(),
]);
return ResponseHelper::error('common.failed', 502, null);
return ResponseHelper::error('common.failed', 502, [
'message' => [$e->getMessage()],
]);
}
}
@@ -4,7 +4,7 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.0.2] - 2026-08-17
## [1.0.2] - 2026-08-18
### Fixed
@@ -4,7 +4,7 @@ All notable changes to this plugin will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [1.0.3] - 2026-08-17
## [1.0.3] - 2026-08-18
### Fixed
@@ -4,7 +4,7 @@ All notable changes to this plugin will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [1.0.1] - 2026-08-17
## [1.0.1] - 2026-08-18
### Security
@@ -1,5 +1,7 @@
<?php
// audit:allow api-doc-coverage reason: docblock 서술 정정만 수행 (web GET 브리지의 검증 실패 모드 서술) — 검증 규칙/요청·응답 계약 무변경. 이 브리지는 web 전용 HTML 내비게이션이라 API 문서 대상도 아니다
namespace Plugins\Sirsoft\VerificationNhnkcp\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
@@ -8,7 +10,9 @@ use Illuminate\Foundation\Http\FormRequest;
* KCP 인증 결과 브리지 페이지 진입 쿼리를 검증합니다.
*
* 콜백 컨트롤러가 302 redirect 로 붙여 보내는 값만 받습니다. 배열 주입
* (`?verification_token[]=x`)은 string 규칙이 422 로 차단합니다 — 종전에는
* (`?verification_token[]=x`)은 string 규칙이 차단합니다 — 이 라우트는 web GET
* HTML 내비게이션이라 검증 실패는 422 JSON 이 아니라 redirect-back 으로 끝나며,
* 어느 쪽이든 배열이 브리지 payload 에 유입되지 않는 것이 목적입니다. 종전에는
* `(string)` 캐스팅이 배열을 "Array" 문자열로 바꿔 브리지 payload 에 유입됐습니다.
* 길이 상한을 두지 않는 이유는 토큰 길이가 코어 발급 정책에 종속되어 있기 때문입니다
* (kginicis InicisPopupBridgeRequest 선례).