feat(admin): add audit target APIs and harden target source handling (#2350)

Signed-off-by: houseme <housemecn@gmail.com>
Co-authored-by: 安正超 <anzhengchao@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: houseme <4829346+houseme@users.noreply.github.com>
This commit is contained in:
houseme
2026-04-04 09:07:22 +08:00
committed by GitHub
parent 67863630b2
commit d2901fd78c
29 changed files with 3534 additions and 856 deletions
+5 -6
View File
@@ -1907,7 +1907,6 @@ mod test {
#[tokio::test]
async fn test_read_xl_meta_no_data() {
use tokio::fs;
use tokio::fs::File;
use tokio::io::AsyncWriteExt;
@@ -1926,13 +1925,15 @@ async fn test_read_xl_meta_no_data() {
buff.resize(buff.len() + 100, 0);
let filepath = "./test_xl.meta";
// Use tempfile to avoid conflicts with parallel tests or previous runs
let dir = tempfile::tempdir().unwrap();
let filepath = dir.path().join("test_xl.meta");
let mut file = File::create(filepath).await.unwrap();
let mut file = File::create(&filepath).await.unwrap();
// Write string data
file.write_all(&buff).await.unwrap();
let mut f = File::open(filepath).await.unwrap();
let mut f = File::open(&filepath).await.unwrap();
let stat = f.metadata().await.unwrap();
@@ -1941,7 +1942,5 @@ async fn test_read_xl_meta_no_data() {
let mut newfm = FileMeta::default();
newfm.unmarshal_msg(&data).unwrap();
fs::remove_file(filepath).await.unwrap();
assert_eq!(fm, newfm)
}