mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
harden(authority): add pre-scale diagnostics and request safety
This commit is contained in:
@@ -260,6 +260,18 @@ async function testAdapterBasics() {
|
||||
assert.deepEqual(readResult.payload, { hello: "world" });
|
||||
const deleteResult = await adapter.delete("user/files/demo.json");
|
||||
assert.equal(deleteResult.deleted, true);
|
||||
await assert.rejects(
|
||||
() => adapter.writeJson("../secret.json", {}),
|
||||
/Unsafe Authority Blob path/,
|
||||
);
|
||||
await assert.rejects(
|
||||
() => adapter.readJson("user/files/%2e%2e/secret.json"),
|
||||
/Unsafe Authority Blob path/,
|
||||
);
|
||||
await assert.rejects(
|
||||
() => adapter.stat("C:/Users/demo.json"),
|
||||
/Unsafe Authority Blob path/,
|
||||
);
|
||||
}
|
||||
|
||||
async function testAuthorityBlobFailOpenFallsBackToUserFiles() {
|
||||
|
||||
Reference in New Issue
Block a user