fix #557: guide permission-driven VPD flow
This commit is contained in:
@@ -2,7 +2,6 @@ package com.cloudhandson.vpdbackoffice.domain.mcp;
|
||||
|
||||
public record McpReasoningCommand(
|
||||
Long tokenKeyId,
|
||||
long objectId,
|
||||
String bearerToken,
|
||||
int limit,
|
||||
String question
|
||||
|
||||
@@ -9,6 +9,11 @@ public record ProbeCommand(
|
||||
Long tokenKeyId,
|
||||
@Positive long objectId,
|
||||
@NotBlank String bearerToken,
|
||||
@Min(1) @Max(500) int limit
|
||||
@Min(1) @Max(500) int limit,
|
||||
String requestBody
|
||||
) {
|
||||
|
||||
public ProbeCommand(Long tokenKeyId, long objectId, String bearerToken, int limit) {
|
||||
this(tokenKeyId, objectId, bearerToken, limit, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.cloudhandson.vpdbackoffice.domain.protectedobject;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public record ProtectedColumn(
|
||||
long columnId,
|
||||
long objectId,
|
||||
@@ -20,4 +22,28 @@ public record ProtectedColumn(
|
||||
String method = redactionMethod == null || redactionMethod.isBlank() ? "NONE" : redactionMethod;
|
||||
return level + "/" + method;
|
||||
}
|
||||
|
||||
public String sensitivityLabel() {
|
||||
String level = sensitivityLevel == null || sensitivityLevel.isBlank() ? "PUBLIC" : sensitivityLevel;
|
||||
return switch (level.toUpperCase(Locale.ROOT)) {
|
||||
case "INTERNAL" -> "내부용";
|
||||
case "CONFIDENTIAL" -> "기밀";
|
||||
case "RESTRICTED" -> "제한";
|
||||
default -> "기본 표시";
|
||||
};
|
||||
}
|
||||
|
||||
public String redactionLabel() {
|
||||
String method = redactionMethod == null || redactionMethod.isBlank() ? "NONE" : redactionMethod;
|
||||
return switch (method.toUpperCase(Locale.ROOT)) {
|
||||
case "NULLIFY" -> "값 숨김(NULL)";
|
||||
case "PARTIAL" -> "일부 숨김";
|
||||
case "FULL" -> "전체 숨김";
|
||||
default -> "마스킹 없음";
|
||||
};
|
||||
}
|
||||
|
||||
public String displayPolicyLabel() {
|
||||
return sensitive() ? sensitivityLabel() + " · " + redactionLabel() : "기본 표시 · 마스킹 없음";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,14 @@ public record ProtectedObject(
|
||||
String owner,
|
||||
String objectName,
|
||||
String ordsPath,
|
||||
String enabledYn
|
||||
String enabledYn,
|
||||
String description
|
||||
) {
|
||||
|
||||
public ProtectedObject(long objectId, String owner, String objectName, String ordsPath, String enabledYn) {
|
||||
this(objectId, owner, objectName, ordsPath, enabledYn, null);
|
||||
}
|
||||
|
||||
public boolean enabled() {
|
||||
return "Y".equalsIgnoreCase(enabledYn);
|
||||
}
|
||||
@@ -15,4 +20,10 @@ public record ProtectedObject(
|
||||
public String displayName() {
|
||||
return owner + "." + objectName;
|
||||
}
|
||||
|
||||
public String descriptionOrDefault() {
|
||||
return description == null || description.isBlank()
|
||||
? "등록된 DB 객체를 권한체계와 ORDS로 조회하는 대상"
|
||||
: description;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,17 @@ public record ProtectedObjectCreateCommand(
|
||||
@NotBlank String objectName,
|
||||
@NotBlank String ordsPath,
|
||||
String columns,
|
||||
String sensitiveColumns
|
||||
String sensitiveColumns,
|
||||
String description
|
||||
) {
|
||||
|
||||
public ProtectedObjectCreateCommand(
|
||||
String owner,
|
||||
String objectName,
|
||||
String ordsPath,
|
||||
String columns,
|
||||
String sensitiveColumns
|
||||
) {
|
||||
this(owner, objectName, ordsPath, columns, sensitiveColumns, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ public record VpdTargetView(
|
||||
String objectType,
|
||||
String protectedYn,
|
||||
String ordsPath,
|
||||
String description,
|
||||
int policyCount,
|
||||
String policyNames,
|
||||
String filterNames
|
||||
|
||||
Reference in New Issue
Block a user