mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
chore: auto-fix lint & formatting [skip ci]
This commit is contained in:
parent
c75567cf15
commit
1375db9a20
15 changed files with 160 additions and 88 deletions
|
|
@ -1,6 +1,9 @@
|
|||
import { describe, it, expect } from "bun:test";
|
||||
import type { Env } from "../server/lib/types";
|
||||
import { verifyFeishuSignature, handleFeishuWebhookRequest } from "../server/lib/drivers/feishu/updates";
|
||||
import {
|
||||
verifyFeishuSignature,
|
||||
handleFeishuWebhookRequest,
|
||||
} from "../server/lib/drivers/feishu/updates";
|
||||
|
||||
function sign(secret: string, timestamp: string, nonce: string, body: string): Promise<string> {
|
||||
return (async () => {
|
||||
|
|
@ -11,7 +14,11 @@ function sign(secret: string, timestamp: string, nonce: string, body: string): P
|
|||
false,
|
||||
["sign"],
|
||||
);
|
||||
const sig = await crypto.subtle.sign("HMAC", key, new TextEncoder().encode(`${timestamp}\n${nonce}\n${body}`));
|
||||
const sig = await crypto.subtle.sign(
|
||||
"HMAC",
|
||||
key,
|
||||
new TextEncoder().encode(`${timestamp}\n${nonce}\n${body}`),
|
||||
);
|
||||
let binary = "";
|
||||
const bytes = new Uint8Array(sig);
|
||||
for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i] ?? 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue