Merge branch 'forgejo-dev' into newfeat
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
commit
c57a75e36a
50 changed files with 2760 additions and 961 deletions
|
|
@ -5,7 +5,6 @@ import {
|
|||
normalizeHexDigest,
|
||||
parseDocverTicket,
|
||||
parseTicketDataParam,
|
||||
timingSafeEqualHex,
|
||||
} from "@/utils/docver-ticket";
|
||||
|
||||
// PLAN-ADDIN-AUTH.md §4 — pure ล้วนไม่แตะ env/DB อะไรเลย
|
||||
|
|
@ -116,15 +115,6 @@ describe("normalizeHexDigest", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("timingSafeEqualHex", () => {
|
||||
it("ค่าเท่ากัน = true ต่างกัน = false · ความยาวไม่เท่า = false ทันที", () => {
|
||||
const a = "ab".repeat(32);
|
||||
expect(timingSafeEqualHex(a, a)).toBe(true);
|
||||
expect(timingSafeEqualHex(a, "cd".repeat(32))).toBe(false);
|
||||
expect(timingSafeEqualHex(a, "ab")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
// parseTicketDataParam — query param `ticket_data` ของ GET /api/documents/latest:
|
||||
// ticket ก่อนเติม exp (server เติมตอน stamp) แต่บังคับ fid/uid/uname เพราะ
|
||||
// parseDocverTicket บังคับทั้งสามตอน add-in redeem — ขาด = ไฟล์ที่คืนไปเปิดไม่ได้
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue