[Developer] #571 show VPD context in SQL trace
This commit is contained in:
@@ -117,6 +117,26 @@
|
||||
<span class="badge text-bg-light">DBMS_RLS predicate</span>
|
||||
</div>
|
||||
<div class="probe-exchange-grid mt-3">
|
||||
<section class="probe-exchange" data-sql-trace-field="vpd_context" th:if="${tokenContext}">
|
||||
<h3>set_vpd_context 사용자 컨텍스트</h3>
|
||||
<p class="form-hint">이 컨텍스트로 권한 규칙을 계산한 뒤 아래 VPD predicate와 effective SQL을 만들었습니다.</p>
|
||||
<dl class="mb-0">
|
||||
<div><dt>CB_AGENT_CTX.USER_ID</dt><dd th:text="${tokenContext.userId()}">103</dd></div>
|
||||
<div><dt>사용자</dt><dd th:text="${tokenContext.username()}">agent_all</dd></div>
|
||||
<div>
|
||||
<dt>직접 역할</dt>
|
||||
<dd th:text="${#lists.isEmpty(tokenContext.directRoles()) ? '없음' : #strings.listJoin(tokenContext.directRoles(), ', ')}">ALL_DOC_ROLE</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>소속 그룹</dt>
|
||||
<dd th:text="${#lists.isEmpty(tokenContext.groups()) ? '없음' : #strings.listJoin(tokenContext.groups(), ', ')}">없음</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>상속 역할</dt>
|
||||
<dd th:text="${#lists.isEmpty(tokenContext.inheritedRoles()) ? '없음' : #strings.listJoin(tokenContext.inheritedRoles(), ', ')}">없음</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</section>
|
||||
<section class="probe-exchange" data-sql-trace-field="vpd_predicate">
|
||||
<h3>VPD가 추가한 WHERE 조건</h3>
|
||||
<pre th:text="${result.vpdPredicate()}">(DEPT_CODE = SYS_CONTEXT('CB_AGENT_CTX', 'DEPT_CODE'))</pre>
|
||||
|
||||
@@ -35,6 +35,8 @@ class GuidedFlowTemplateTest {
|
||||
assertThat(result)
|
||||
.contains("적용된 사용자와 권한")
|
||||
.contains("토큰 적용 후 SQL")
|
||||
.contains("set_vpd_context 사용자 컨텍스트")
|
||||
.contains("CB_AGENT_CTX.USER_ID")
|
||||
.contains("벡터 검색 Top-K")
|
||||
.contains("벡터 거리 (SCORE)")
|
||||
.contains("vpd_predicate")
|
||||
|
||||
Reference in New Issue
Block a user