[Developer] #424 fix ORDS protected object path

Refs #424
This commit is contained in:
devmrko
2026-06-23 12:04:44 +09:00
parent 923daa2a56
commit 127110e300
6 changed files with 25 additions and 3 deletions

View File

@@ -111,7 +111,7 @@ USING (
SELECT 1 AS object_id,
'ADMIN' AS owner,
'CB_V_SEARCH_DOCUMENTS' AS object_name,
'cb-agent-security/vpd/documents' AS ords_path,
'cb-ords/cb-agent-security/vpd/documents' AS ords_path,
'Y' AS enabled_yn
FROM dual
) src

View File

@@ -8,6 +8,7 @@ public enum ProbeStatus {
OBJECT_DISABLED,
INVALID_TOKEN,
OBJECT_NOT_ACCESSIBLE,
ORDS_PATH_NOT_FOUND,
ORDS_NOT_CONFIGURED,
ORDS_UNAVAILABLE,
ORDS_TIMEOUT,

View File

@@ -121,7 +121,7 @@ public class OrdsProbeService {
return auditAndReturn(command, ProbeResult.blocked(
status,
status.name(),
trimMessage(e.getResponseBodyAsString()),
httpErrorMessage(status, e.getResponseBodyAsString()),
requestHeaders,
requestPayload,
prettyHeaders(e.getResponseHeaders()),
@@ -260,6 +260,15 @@ public class OrdsProbeService {
return detail;
}
private String httpErrorMessage(ProbeStatus status, String body) {
String detail = trimMessage(body);
if (status == ProbeStatus.ORDS_PATH_NOT_FOUND) {
return "ORDS 경로를 찾을 수 없습니다. 설정의 Base URL과 보호 객체 ORDS Path가 실제 ORDS schema mapping/module/template 경로와 일치하는지 확인하세요. 상세: "
+ detail;
}
return detail;
}
private String trimMessage(String body) {
if (body == null) {
return null;

View File

@@ -23,6 +23,12 @@ public class ProbeErrorClassifier {
if (status != null && (status.value() == 401 || status.value() == 403)) {
return ProbeStatus.INVALID_TOKEN;
}
if (status != null && status.value() == 404) {
return ProbeStatus.ORDS_PATH_NOT_FOUND;
}
if (text.contains("\"code\"") && text.contains("NotFound")) {
return ProbeStatus.ORDS_PATH_NOT_FOUND;
}
return ProbeStatus.UNKNOWN_ERROR;
}

View File

@@ -25,7 +25,7 @@
</label>
<label>
ORDS Path
<input class="form-control" name="ordsPath" placeholder="cb-agent-security/vpd/documents" required>
<input class="form-control" name="ordsPath" placeholder="cb-ords/cb-agent-security/vpd/documents" required>
</label>
<label>
컬럼

View File

@@ -31,6 +31,12 @@ class ProbeErrorClassifierTest {
.isEqualTo(ProbeStatus.INVALID_TOKEN);
}
@Test
void classifiesOrdsNotFound() {
assertThat(classifier.classify(HttpStatus.NOT_FOUND, "{\"code\":\"NotFound\"}"))
.isEqualTo(ProbeStatus.ORDS_PATH_NOT_FOUND);
}
@Test
void detectsOrdsConnectionRefused() {
assertThat(classifier.isUnavailable(new ResourceAccessException(