v7.0.0 release
This commit is contained in:
1 parent
0e7fa04b03
commit
c4ea9a6cd1
3582 files changed
+626189
-160151
No files matched your search
+35
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Plugins\Sirsoft\VerificationKginicis\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 동일 mTxId 로 이미 verify 처리된 challenge 에 대해 callback 이 재진입했을 때 발생.
|
||||
*
|
||||
* Replay 공격 또는 사용자가 같은 인증 결과를 두 번 제출하는 경우를 차단한다.
|
||||
*
|
||||
* @since 1.0.0-beta.1
|
||||
*/
|
||||
class AlreadyConsumedException extends RuntimeException
|
||||
{
|
||||
/**
|
||||
* 이미 소비된 challenge 의 식별자를 컨텍스트로 보존한다.
|
||||
*
|
||||
* @param string $challengeId 코어 IdentityVerificationLog UUID
|
||||
* @param string $mtxid 이니시스 가맹점 거래 ID
|
||||
* @param Throwable|null $previous 체인 예외
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $challengeId,
|
||||
public readonly string $mtxid,
|
||||
?Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct(
|
||||
__('sirsoft-verification_kginicis::exceptions.already_consumed'),
|
||||
0,
|
||||
$previous,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Plugins\Sirsoft\VerificationKginicis\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 이니시스 STEP3 응답의 SEED CBC 복호화 실패 시 발생.
|
||||
*
|
||||
* 잘못된 SEED 키 (token), IV 불일치, 또는 응답 데이터 손상이 원인일 수 있다.
|
||||
*
|
||||
* @since 1.0.0-beta.1
|
||||
*/
|
||||
class DecryptException extends RuntimeException
|
||||
{
|
||||
/**
|
||||
* 복호화 실패한 필드명을 컨텍스트로 보존한다 (PII 평문은 절대 보존하지 않는다).
|
||||
*
|
||||
* @param string $field 복호화 실패한 필드명 (예: userName, userPhone)
|
||||
* @param Throwable|null $previous KISA libs 가 던진 원본 예외 (있을 시)
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $field,
|
||||
?Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct(
|
||||
__('sirsoft-verification_kginicis::exceptions.decrypt_failed'),
|
||||
0,
|
||||
$previous,
|
||||
);
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Plugins\Sirsoft\VerificationKginicis\Exceptions;
|
||||
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Support\Facades\Validator as ValidatorFactory;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
/**
|
||||
* 동일인이 이미 가입된 상태에서 재가입을 시도할 때 발생.
|
||||
*
|
||||
* KG이니시스 본인확인의 DI 또는 CI hash 가 `inicis_identity_records` 의 기존 row 와
|
||||
* 매칭되면 본 예외가 throw 된다. AuthService::register() 가 호출하는
|
||||
* core.auth.before_register 훅의 priority 20 listener (AssertNoDuplicateInicisIdentity)
|
||||
* 에서 발화한다.
|
||||
*
|
||||
* HTTP 422 + identity 필드 에러로 응답 — Laravel ValidationException 상속으로 표준 변환.
|
||||
* 메시지는 i18n 키로 PII (이메일/이름) 절대 노출하지 않음 — heads-up 공격 방어.
|
||||
*
|
||||
* @since 1.0.0-beta.1
|
||||
*/
|
||||
class IdentityDuplicateException extends ValidationException
|
||||
{
|
||||
/**
|
||||
* 가입 차단 예외 생성.
|
||||
*
|
||||
* @param string $matchedField 매칭된 hash 컬럼명 (di_hash / ci_hash / ci2_hash). 감사 로그/테스트용
|
||||
*/
|
||||
public function __construct(public readonly string $matchedField = 'di_hash')
|
||||
{
|
||||
parent::__construct($this->buildValidator());
|
||||
}
|
||||
|
||||
/**
|
||||
* identity 필드 에러를 담은 Validator 인스턴스 생성.
|
||||
*
|
||||
* @return Validator
|
||||
*/
|
||||
protected function buildValidator(): Validator
|
||||
{
|
||||
$validator = ValidatorFactory::make([], []);
|
||||
$validator->errors()->add(
|
||||
'identity',
|
||||
__('sirsoft-verification_kginicis::exceptions.duplicate_register'),
|
||||
);
|
||||
|
||||
return $validator;
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Plugins\Sirsoft\VerificationKginicis\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 이니시스 callback 의 authRequestUrl 이 표준 도메인 (kssa.inicis.com / fcsa.inicis.com) 외인 경우 발생.
|
||||
*
|
||||
* 위조된 callback 으로부터 가맹점을 보호한다.
|
||||
*
|
||||
* @since 1.0.0-beta.1
|
||||
*/
|
||||
class InvalidAuthUrlException extends RuntimeException
|
||||
{
|
||||
/**
|
||||
* 차단된 authRequestUrl 을 컨텍스트로 보존하여 운영 로그에 남긴다.
|
||||
*
|
||||
* @param string $url 차단된 authRequestUrl
|
||||
* @param Throwable|null $previous 체인 예외
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $url,
|
||||
?Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct(
|
||||
__('sirsoft-verification_kginicis::exceptions.invalid_auth_url'),
|
||||
0,
|
||||
$previous,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Plugins\Sirsoft\VerificationKginicis\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 이니시스 STEP3 (`authRequestUrl` 서버-서버 호출) 통신 오류 시 발생.
|
||||
*
|
||||
* curl timeout, SSL 검증 실패, HTTP 5xx 등 네트워크/원격 응답 이상이 원인.
|
||||
*
|
||||
* @since 1.0.0-beta.1
|
||||
*/
|
||||
class RemoteCallException extends RuntimeException
|
||||
{
|
||||
/**
|
||||
* 호출 실패 시점의 컨텍스트 (HTTP status / curl errno) 를 보존한다.
|
||||
*
|
||||
* @param string $detail 호출 실패 상세 (curl_error 또는 HTTP status 텍스트)
|
||||
* @param int $httpStatus HTTP status code (0 = 통신 자체 실패)
|
||||
* @param Throwable|null $previous 체인 예외
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $detail,
|
||||
public readonly int $httpStatus = 0,
|
||||
?Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct(
|
||||
__('sirsoft-verification_kginicis::exceptions.remote_call_failed'),
|
||||
$httpStatus,
|
||||
$previous,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user