From c4bba32b20f0869b45ed14be04543869dd91ee6c Mon Sep 17 00:00:00 2001
From: cl <1442464845@qq.com>
Date: 星期四, 09 四月 2026 18:38:44 +0800
Subject: [PATCH] 日志1
---
rsf-http-audit/src/main/java/com/vincent/rsf/httpaudit/props/HttpAuditProperties.java | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/rsf-http-audit/src/main/java/com/vincent/rsf/httpaudit/props/HttpAuditProperties.java b/rsf-http-audit/src/main/java/com/vincent/rsf/httpaudit/props/HttpAuditProperties.java
index a553c23..6c00a35 100644
--- a/rsf-http-audit/src/main/java/com/vincent/rsf/httpaudit/props/HttpAuditProperties.java
+++ b/rsf-http-audit/src/main/java/com/vincent/rsf/httpaudit/props/HttpAuditProperties.java
@@ -17,11 +17,24 @@
private boolean enabled = true;
+ /**
+ * true锛氬叆绔�/鍑虹珯鏄惁钀藉簱鐢� {@code sys_http_audit_rule} 鍐冲畾锛堝惈 record_all=1 鍏ㄩ噺銆佹柟鍚� IN/OUT/BOTH銆佹埅鏂暱搴︼級锛沠alse锛氭帓闄よ矾寰勫鍏ョ珯涓庡叏閮ㄥ嚭绔欏潎璁板綍锛屾埅鏂敤鏈厤缃� + 瑙勫垯涓�屽叏閲忋�嶈鐨� request/response_max_chars锛堣嫢鏈夛級
+ */
+ private boolean whitelistOnly = true;
+
+ /** 瑙勫垯缂撳瓨瀹氭椂鍒锋柊闂撮殧锛堟绉掞級 */
+ private long ruleCacheRefreshMs = 60_000L;
+
/** 鏌ヨ绫诲搷搴旀渶澶氫繚鐣欏瓧绗︽暟 */
private int queryResponseMaxChars = 500;
/** 闈炴煡璇㈢被鍝嶅簲鏈�澶氬叆搴撳瓧鑺傦紙瓒呭嚭鎴柇骞舵爣璁帮級 */
private int maxResponseStoreChars = 65535;
+
+ /**
+ * 瑙勫垯鏈寚瀹� request_max_chars 鏃剁殑榛樿锛氬瓧绗︽暟锛�-1 琛ㄧず鍏ュ簱涓嶆埅鏂姹備綋
+ */
+ private int defaultRequestStoreChars = 65535;
/** 璇锋眰浣撶紦瀛樹笂闄愶紙瀛楄妭锛� */
private int maxRequestCacheBytes = 2 * 1024 * 1024;
@@ -31,6 +44,20 @@
/** 涓嶈惤搴撶殑璺緞鍓嶇紑 */
private List<String> excludePathPrefixes = defaultExcludes();
+
+ /**
+ * true锛氶粯璁ゆ帓闄や腑鐨� /httpAuditLog銆�/httpAuditRule 浠嶇敓鏁堬紱false锛氫笉鍐嶆帓闄よ繖涓ら」锛堜究浜庤皟璇曪紱record_all 涔熸棤娉曠粫杩� true 鏃剁殑鎺掗櫎锛�
+ */
+ private boolean excludeAuditSelfPaths = true;
+
+ /** Filter 瀹為檯浣跨敤鐨勫墠缂�锛堝彈 excludeAuditSelfPaths 褰卞搷锛� */
+ public List<String> getEffectiveExcludePrefixes() {
+ List<String> list = excludePathPrefixes == null ? new ArrayList<>() : new ArrayList<>(excludePathPrefixes);
+ if (!excludeAuditSelfPaths) {
+ list.removeIf(p -> "/httpAuditLog".equals(p) || "/httpAuditRule".equals(p));
+ }
+ return list;
+ }
/** 瑙嗕负澶栭儴璋冪敤鐨勮矾寰勫墠缂�锛堝叾浣欎负鍐呴儴锛� */
private List<String> externalPathPrefixes = defaultExternal();
@@ -51,6 +78,7 @@
list.add("/favicon.ico");
list.add("/static/");
list.add("/httpAuditLog");
+ list.add("/httpAuditRule");
return list;
}
--
Gitblit v1.9.1