reguard 0.8.1 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -3
- package/dist/chunks/{chunk-PA46KSOR.js → chunk-2N762ZXU.js} +235 -44
- package/dist/chunks/{chunk-3AYS7WSY.js → chunk-4RD66ACT.js} +81 -8
- package/dist/chunks/{chunk-U54IP6G4.js → chunk-GOT54CF4.js} +61 -40
- package/dist/chunks/{chunk-KNKCUJL3.js → chunk-RTCPK4MF.js} +102 -41
- package/dist/cjs/fastify.cjs +305 -93
- package/dist/cjs/fetch.cjs +347 -87
- package/dist/cjs/index.cjs +386 -86
- package/dist/cjs/next.cjs +366 -103
- package/dist/cjs/testing.cjs +28 -100
- package/dist/fastify.js +4 -12
- package/dist/fetch.js +14 -5
- package/dist/index.js +13 -5
- package/dist/next.js +33 -23
- package/dist/testing.js +9 -3
- package/dist/types/node/src/api.d.ts +139 -0
- package/dist/types/node/src/core.d.ts +8 -1
- package/dist/types/node/src/fastify.d.ts +15 -7
- package/dist/types/node/src/fetch.d.ts +12 -2
- package/dist/types/node/src/index.d.ts +6 -0
- package/dist/types/node/src/next.d.ts +39 -17
- package/dist/types/node/src/testing.d.ts +11 -0
- package/dist/types/shared/src/address.d.ts +25 -6
- package/dist/types/shared/src/collect.d.ts +7 -1
- package/dist/types/shared/src/index.d.ts +14 -0
- package/dist/types/shared/src/paths.d.ts +6 -2
- package/dist/types/shared/src/tools.d.ts +10 -0
- package/dist/types/shared/src/verdict.d.ts +6 -0
- package/dist/types/shared/src/webhooks.d.ts +32 -0
- package/dist/types-cjs/node/src/api.d.cts +139 -0
- package/dist/types-cjs/node/src/core.d.cts +8 -1
- package/dist/types-cjs/node/src/fastify.d.cts +15 -7
- package/dist/types-cjs/node/src/fetch.d.cts +12 -2
- package/dist/types-cjs/node/src/index.d.cts +6 -0
- package/dist/types-cjs/node/src/next.d.cts +39 -17
- package/dist/types-cjs/node/src/testing.d.cts +11 -0
- package/dist/types-cjs/shared/src/address.d.cts +25 -6
- package/dist/types-cjs/shared/src/collect.d.cts +7 -1
- package/dist/types-cjs/shared/src/index.d.cts +14 -0
- package/dist/types-cjs/shared/src/paths.d.cts +6 -2
- package/dist/types-cjs/shared/src/tools.d.cts +10 -0
- package/dist/types-cjs/shared/src/verdict.d.cts +6 -0
- package/dist/types-cjs/shared/src/webhooks.d.cts +32 -0
- package/package.json +3 -2
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
* reguard/next: Reguard for Next.js. Runtime-neutral (no node: imports), so it also runs in
|
|
3
3
|
* middleware and on the edge runtime. Built on reguard/fetch.
|
|
4
4
|
*
|
|
5
|
-
* //
|
|
6
|
-
*
|
|
7
|
-
* export
|
|
5
|
+
* // middleware.ts (proxy.ts on Next 16): serves /_s/* (the script and its reports) from Reguard,
|
|
6
|
+
* // first-party, and answers flagged visitors with { block: true }
|
|
7
|
+
* export const middleware = reguardMiddleware();
|
|
8
8
|
*
|
|
9
9
|
* // app/layout.tsx (App Router), or pages/_document.tsx (Pages Router)
|
|
10
10
|
* import Script from "next/script";
|
|
11
11
|
* import { reguardScriptProps } from "reguard/next";
|
|
12
12
|
* <Script {...reguardScriptProps()} />
|
|
13
13
|
*
|
|
14
|
+
* // next.config.js: the site id for pages rendered where REGUARD_KEY isn't (build, browser)
|
|
15
|
+
* export default withReguard({ ...yourConfig });
|
|
16
|
+
*
|
|
14
17
|
* // anywhere on the server: route handler, server action, middleware
|
|
15
18
|
* const verdict = await reguardVerdict(request);
|
|
16
|
-
*
|
|
17
|
-
* // middleware.ts (proxy.ts on Next 16): answer flagged visitors, like reguard({ block: true })
|
|
18
|
-
* export const middleware = reguardMiddleware({ block: true });
|
|
19
19
|
*/
|
|
20
20
|
import { type CollectOptions } from "../../shared/src/index.cjs";
|
|
21
21
|
import { type ClientIpOption, type LoggerLike } from "./config.cjs";
|
|
@@ -24,16 +24,21 @@ import { type FetchBlockOptions } from "./fetch.cjs";
|
|
|
24
24
|
export type { Decision, Verdict, VerdictSource } from "./core.cjs";
|
|
25
25
|
export type { FetchBlockOptions as BlockOptions } from "./fetch.cjs";
|
|
26
26
|
export { type BlockReason, ReguardConfigError } from "./config.cjs";
|
|
27
|
+
export { type EventsPage, type ReguardApiOptions, type ReguardEvent, type ReguardEventType, type VisitorStatus, ReguardApiError, ReguardWebhookError, reguardApi, verifyWebhook, } from "./api.cjs";
|
|
27
28
|
export type { AddressesMode, CollectOptions, Label, PagesMode, Stage, VerdictClaim } from "../../shared/src/index.cjs";
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* Makes the site id (public: it is in the script tag anyway) available as NEXT_PUBLIC_REGUARD_SITE,
|
|
31
|
+
* so `reguardScriptProps()` works in pages rendered where REGUARD_KEY isn't: prerendered at build
|
|
32
|
+
* time, or in components that also render in the browser. The id comes from `site`, else from
|
|
33
|
+
* REGUARD_KEY when the build has it. Takes a config object or function.
|
|
34
|
+
*
|
|
35
|
+
* Earlier releases also routed /_s/* here with a rewrite; reguardMiddleware() serves it now, so the
|
|
36
|
+
* visitor's sign-in cookies and headers stay on your server and the collector address is read at
|
|
37
|
+
* run time.
|
|
33
38
|
*/
|
|
34
39
|
export declare function withReguard<T extends object>(config: T, options?: {
|
|
35
|
-
collector?: string;
|
|
36
40
|
key?: string;
|
|
41
|
+
site?: string;
|
|
37
42
|
}): T;
|
|
38
43
|
/** The visitor's verified verdict from a Request or NextRequest (null when there is none). */
|
|
39
44
|
export declare function reguardVerdict(request: {
|
|
@@ -69,17 +74,34 @@ export interface ReguardMiddlewareOptions {
|
|
|
69
74
|
block?: boolean | FetchBlockOptions;
|
|
70
75
|
key?: string;
|
|
71
76
|
previousKey?: string;
|
|
77
|
+
/** Where /_s/* goes (default https://api.reguard.site, or REGUARD_COLLECTOR), read at run time. */
|
|
78
|
+
collector?: string;
|
|
79
|
+
/** What Reguard receives from your server: `requests: false` sends nothing but the script's traffic. */
|
|
80
|
+
collect?: CollectOptions;
|
|
81
|
+
/** Paths Reguard leaves alone entirely (health checks, webhooks). */
|
|
82
|
+
ignore?: string[];
|
|
72
83
|
sourceMaps?: "deny" | "allow";
|
|
73
84
|
clientIp?: ClientIpOption<Request>;
|
|
85
|
+
timeoutMs?: number;
|
|
74
86
|
debug?: boolean;
|
|
75
87
|
logger?: LoggerLike | false;
|
|
76
88
|
}
|
|
77
89
|
/**
|
|
78
|
-
* Next.js middleware (edge or Node runtime)
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
90
|
+
* Next.js middleware (edge or Node runtime). It serves /_s/* (the script and its reports) from
|
|
91
|
+
* Reguard, first-party: the visitor's cookies other than Reguard's own, Authorization, the full
|
|
92
|
+
* referrer and address or location headers stay on your server, and the visitor's address goes as a
|
|
93
|
+
* keyed hash. Keep /_s/:path* in your matcher.
|
|
94
|
+
*
|
|
95
|
+
* With `block` it answers blocked visitors itself, like `reguard({ block: true })` in Express:
|
|
96
|
+
* Reguard's default answer (or `block.respond`'s), with `block.dryRun`, `block.allow` and
|
|
97
|
+
* `block.onBlock` as there. It also paces pages for clients that don't present as a browser (each
|
|
98
|
+
* instance counts on its own) and denies source maps (keep `*.map` in your matcher for that).
|
|
83
99
|
* `block.require` needs reguard() in a Node server and is refused here.
|
|
100
|
+
*
|
|
101
|
+
* Middleware never sees your response, so it reports what it can without one: what Reguard decided
|
|
102
|
+
* (blocks, and what a dry run would have blocked, which the dashboard counts) and requests from
|
|
103
|
+
* clients that don't present as a browser. Everyone else gets `undefined`, so Next carries on.
|
|
84
104
|
*/
|
|
85
|
-
export declare function reguardMiddleware(options?: ReguardMiddlewareOptions): (request: Request
|
|
105
|
+
export declare function reguardMiddleware(options?: ReguardMiddlewareOptions): (request: Request, event?: {
|
|
106
|
+
waitUntil?(p: Promise<unknown>): void;
|
|
107
|
+
}) => Promise<Response | undefined>;
|
|
@@ -22,4 +22,15 @@ export declare function verdictCookie(key: string, options?: {
|
|
|
22
22
|
claims?: VerdictClaim[];
|
|
23
23
|
sid?: string;
|
|
24
24
|
issuedAt?: number;
|
|
25
|
+
visitor?: string;
|
|
26
|
+
}): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* A Reguard-Signature header for `payload` (the exact body you'll send to your webhook handler),
|
|
29
|
+
* signed with `secret` at `timestamp` (epoch seconds, default now): test your handler without Reguard.
|
|
30
|
+
*
|
|
31
|
+
* const body = JSON.stringify({ id: "evt_1", type: "visitor.caught", created: 0, site: "shop", data: {} });
|
|
32
|
+
* await request(app).post("/hooks/reguard").set("reguard-signature", await signWebhook("rgwh_test", body)).send(body);
|
|
33
|
+
*/
|
|
34
|
+
export declare function signWebhook(secret: string, payload: string | Uint8Array, options?: {
|
|
35
|
+
timestamp?: number;
|
|
25
36
|
}): Promise<string>;
|
|
@@ -10,12 +10,15 @@
|
|
|
10
10
|
* `trust proxy`, Fastify with `trustProxy`);
|
|
11
11
|
* 2. the host's own client header when the host is known from the environment (Fly, Vercel,
|
|
12
12
|
* Railway, Netlify, App Engine, Cloudflare Workers);
|
|
13
|
-
* 3.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
13
|
+
* 3. the chain [...X-Forwarded-For, connecting peer] read right to left. Each hop is skipped when it
|
|
14
|
+
* is one of yours (private, loopback, shared-network: load balancers, proxies, the cluster) or
|
|
15
|
+
* CloudFront's (its origin-facing ranges; CloudFront appends the address it saw, so the next entry
|
|
16
|
+
* left is that). A Cloudflare address ends the walk at `cf-connecting-ip`, which Cloudflare sets
|
|
17
|
+
* itself. The first other address is the visitor.
|
|
18
|
+
* Without a connecting peer (Next.js middleware, fetch runtimes) the walk starts at the right end of
|
|
19
|
+
* X-Forwarded-For, which the nearest proxy wrote. When no public address appears at all, the request
|
|
20
|
+
* came from your own network (server-side rendering, health checks, internal services): it is marked
|
|
21
|
+
* internal and never paced.
|
|
19
22
|
*/
|
|
20
23
|
export type ClientIpMode = "auto" | "socket" | {
|
|
21
24
|
header: string;
|
|
@@ -47,6 +50,16 @@ export interface ResolvedAddress {
|
|
|
47
50
|
}
|
|
48
51
|
/** Cloudflare's published ranges (cloudflare.com/ips-v4, /ips-v6; checked 2026-12-03). */
|
|
49
52
|
export declare const CLOUDFLARE_RANGES: readonly string[];
|
|
53
|
+
/**
|
|
54
|
+
* CloudFront's origin-facing ranges (AWS's published ip-ranges.json, service CLOUDFRONT_ORIGIN_FACING;
|
|
55
|
+
* checked 2026-12-04): the addresses CloudFront connects to origins from. Only CloudFront uses them.
|
|
56
|
+
*/
|
|
57
|
+
export declare const CLOUDFRONT_RANGES: readonly string[];
|
|
58
|
+
/**
|
|
59
|
+
* Headers whose value is always "address:port", so the last ":port" is cut even from an IPv6 address
|
|
60
|
+
* written without brackets (CloudFront-Viewer-Address: "2001:db8::1:443" is 2001:db8::1, port 443).
|
|
61
|
+
*/
|
|
62
|
+
export declare const PORT_SUFFIXED_HEADERS: readonly string[];
|
|
50
63
|
/** Addresses that are never a visitor's: unspecified, private, shared (carrier-grade NAT), loopback, link-local. */
|
|
51
64
|
export declare const NON_PUBLIC_RANGES: readonly string[];
|
|
52
65
|
/** At most this many X-Forwarded-For entries are read (from the right). */
|
|
@@ -67,6 +80,12 @@ interface Cidr {
|
|
|
67
80
|
}
|
|
68
81
|
/** "a.b.c.d/n", "v6/n" or a bare address; null when malformed. */
|
|
69
82
|
export declare function parseCidr(text: string): Cidr | null;
|
|
83
|
+
/**
|
|
84
|
+
* What pace, claims and visitor hashes key an address by: an IPv6 address by its /64 (one host or
|
|
85
|
+
* home network's whole block, which its owner can rotate through freely), an IPv4 one as it is.
|
|
86
|
+
* "" for anything that isn't an address.
|
|
87
|
+
*/
|
|
88
|
+
export declare function addressKey(address: string | undefined): string;
|
|
70
89
|
/** Whether an address (any text form) belongs to one of the ranges. */
|
|
71
90
|
export declare function ipInRanges(address: string, ranges: readonly string[] | readonly Cidr[]): boolean;
|
|
72
91
|
/** A visitor's address could be this one: not private, shared, loopback, link-local or unspecified. */
|
|
@@ -43,8 +43,14 @@ export declare function resolveCollect(input: unknown, warn?: (message: string)
|
|
|
43
43
|
/**
|
|
44
44
|
* A matcher for skip patterns: `*` matches any characters (slashes included), and a pattern ending in
|
|
45
45
|
* "/*" also matches the path without it ("/account/*" covers "/account"). Query and fragment are ignored.
|
|
46
|
+
* Exemptions (block.allow) match exactly; protections use protectionMatcher.
|
|
46
47
|
*/
|
|
47
|
-
export declare function skipMatcher(patterns: readonly string[]): (path: string) => boolean;
|
|
48
|
+
export declare function skipMatcher(patterns: readonly string[], ignoreCase?: boolean): (path: string) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* A matcher for protections (require, collect.skip, ignore): as skipMatcher, ignoring case, since
|
|
51
|
+
* routers that match paths case-insensitively (Express's default) serve /API/x as /api/x.
|
|
52
|
+
*/
|
|
53
|
+
export declare function protectionMatcher(patterns: readonly string[]): (path: string) => boolean;
|
|
48
54
|
/** The script tag's data-* attributes for the settings that differ from the defaults. */
|
|
49
55
|
export declare function collectAttributes(c: CollectSettings): Record<string, string>;
|
|
50
56
|
export declare function collectReport(c: CollectSettings): CollectReport;
|
|
@@ -18,6 +18,11 @@ export interface InitRequest {
|
|
|
18
18
|
site: string;
|
|
19
19
|
/** This browser's previous session id (the `_s` cookie), for linking reloads when the cookie can't travel (cross-origin script). */
|
|
20
20
|
prev?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The session this tab's previous page load started (sessionStorage `_s_tab`, script 0.9.3+): page
|
|
23
|
+
* loads in one tab stay one investigation when the `_s` cookie is cleared or blocked between them.
|
|
24
|
+
*/
|
|
25
|
+
tab?: string;
|
|
21
26
|
/** SDK version (packages/sdk/package.json). */
|
|
22
27
|
sdk?: string;
|
|
23
28
|
/** Verification-run id from the `lab_run` query parameter; the hosted collector ignores it. */
|
|
@@ -28,6 +33,14 @@ export interface InitRequest {
|
|
|
28
33
|
*/
|
|
29
34
|
path?: string;
|
|
30
35
|
deviceId: string;
|
|
36
|
+
/** Whether `deviceId` persists across visits (the site turned on `persistentId`; SDK 0.9+). */
|
|
37
|
+
persistent?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* A hash of this device's traits (screen, time zone, languages, cores, memory; SDK 0.9+), never the
|
|
40
|
+
* traits themselves. The collector keeps it only for visitors it catches, to recognize their next
|
|
41
|
+
* session without cookies.
|
|
42
|
+
*/
|
|
43
|
+
dk?: string;
|
|
31
44
|
/** The site's data choices (SDK 0.6+), so the collector honours them and reviewers see them. */
|
|
32
45
|
collect?: CollectReport;
|
|
33
46
|
/** Seconds between verdict refreshes the site asks for (data-fresh, block.require): never sampled out (SDK 0.8+). */
|
|
@@ -101,5 +114,6 @@ export * from "./collect.cjs";
|
|
|
101
114
|
export * from "./allowance.cjs";
|
|
102
115
|
export * from "./address.cjs";
|
|
103
116
|
export * from "./paths.cjs";
|
|
117
|
+
export * from "./webhooks.cjs";
|
|
104
118
|
import type { VerdictClaim } from "./verdict.cjs";
|
|
105
119
|
import type { CollectReport } from "./collect.cjs";
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* one. A rule checked against only one form can be walked around with the other (`/%61pi/items`
|
|
8
8
|
* reaches `/api/items`; `/app.js%2Emap` is served as `/app.js.map`). So every rule sees both:
|
|
9
9
|
* - `raw`: the path as sent, without query or fragment (absolute-form targets cut to their path);
|
|
10
|
-
* - `decoded`: percent-decoded once, `//` collapsed and
|
|
10
|
+
* - `decoded`: percent-decoded once, `\` read as `/` (as URL parsers read it), `//` collapsed and
|
|
11
|
+
* `.`/`..` segments resolved.
|
|
11
12
|
* Protections apply when either form matches; exemptions only when both do. Summaries keep the raw
|
|
12
13
|
* path.
|
|
13
14
|
*/
|
|
@@ -24,7 +25,10 @@ export declare function decodeOnce(s: string): string;
|
|
|
24
25
|
export declare function normalizeSegments(path: string): string;
|
|
25
26
|
/** Both forms of a request target (`req.url`, a RequestURI, a WSGI path): see the module comment. */
|
|
26
27
|
export declare function canonicalPath(target: string | undefined): CanonicalPath;
|
|
27
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* A protection (require, source maps, skip, ignore) applies when either form matches; build its
|
|
30
|
+
* matcher with protectionMatcher, which ignores case (routers like Express's match /API as /api).
|
|
31
|
+
*/
|
|
28
32
|
export declare function matchesEither(matcher: (path: string) => boolean, p: CanonicalPath): boolean;
|
|
29
33
|
/** An exemption (block.allow) applies only when both forms match. */
|
|
30
34
|
export declare function matchesBoth(matcher: (path: string) => boolean, p: CanonicalPath): boolean;
|
|
@@ -52,6 +52,16 @@ export interface BrowserHeaders {
|
|
|
52
52
|
* devices stay coherent: only fetch metadata depends on the version, and only for current ones.
|
|
53
53
|
*/
|
|
54
54
|
export declare function browserIncoherence(h: BrowserHeaders): string[];
|
|
55
|
+
/**
|
|
56
|
+
* Whether a request presents as a person's browser: a browser's user agent (not a tool's), the
|
|
57
|
+
* fetch metadata every current browser sends to a secure origin (Sec-Fetch-Dest), and nothing
|
|
58
|
+
* incoherent (Accept-Language present, client hints matching the user agent). A script that adds
|
|
59
|
+
* one browser header doesn't pass. Such requests get to run the page and earn their own verdict:
|
|
60
|
+
* pace and claims keyed by an address never apply to them.
|
|
61
|
+
*/
|
|
62
|
+
export declare function presentsAsBrowser(h: BrowserHeaders & {
|
|
63
|
+
secFetchDest?: string;
|
|
64
|
+
}): boolean;
|
|
55
65
|
/**
|
|
56
66
|
* Paths scanners and agents probe and normal browsing never requests. Matched on the path only;
|
|
57
67
|
* the forced-browsing evidence needs several distinct families in one investigation.
|
|
@@ -20,6 +20,12 @@ export interface VerdictPayload {
|
|
|
20
20
|
claims: VerdictClaim[];
|
|
21
21
|
/** Expiry, epoch ms. */
|
|
22
22
|
exp: number;
|
|
23
|
+
/**
|
|
24
|
+
* The visitor (collector 0.9+): Reguard's id for everything one browser does, stable across its page
|
|
25
|
+
* loads. Signed with the rest, so it can't be forged; use it to look the visitor up (GET
|
|
26
|
+
* /v1/visitors/:id) or to match webhook events.
|
|
27
|
+
*/
|
|
28
|
+
vid?: string;
|
|
23
29
|
}
|
|
24
30
|
export declare const VERDICT_COOKIE = "_sv";
|
|
25
31
|
export declare const SESSION_COOKIE = "_s";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webhook signatures (collector 0.9). Every delivery carries
|
|
3
|
+
*
|
|
4
|
+
* Reguard-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, "<t>.<raw body>")>
|
|
5
|
+
*
|
|
6
|
+
* with one v1 per signing secret in use (two for a day after the secret is rotated). WebCrypto only,
|
|
7
|
+
* so the same code signs in the collector and verifies in Node, Workers, Deno and Bun.
|
|
8
|
+
*/
|
|
9
|
+
export declare const WEBHOOK_SIGNATURE_HEADER = "reguard-signature";
|
|
10
|
+
/** How far a delivery's timestamp may be from now, in seconds (replayed deliveries are refused). */
|
|
11
|
+
export declare const WEBHOOK_TOLERANCE_SECONDS = 300;
|
|
12
|
+
export type WebhookErrorCode = "missing_secret" | "missing_signature" | "malformed_signature" | "expired" | "bad_signature" | "bad_payload";
|
|
13
|
+
export declare class WebhookSignatureError extends Error {
|
|
14
|
+
readonly code: WebhookErrorCode;
|
|
15
|
+
constructor(code: WebhookErrorCode, message: string);
|
|
16
|
+
}
|
|
17
|
+
/** The header value for `payload` (the exact bytes sent), signed with each secret given. */
|
|
18
|
+
export declare function signWebhookPayload(secrets: string | readonly string[], payload: string | Uint8Array, timestamp: number): Promise<string>;
|
|
19
|
+
/** `t` and every v1 signature of a header; null when it isn't one. */
|
|
20
|
+
export declare function parseWebhookSignature(header: string): {
|
|
21
|
+
t: number;
|
|
22
|
+
v1: string[];
|
|
23
|
+
} | null;
|
|
24
|
+
/**
|
|
25
|
+
* Throws a WebhookSignatureError unless `header` signs `payload` with `secret` within `tolerance`
|
|
26
|
+
* seconds of `now` (epoch seconds). Pass the raw body exactly as received: parsed and re-serialized
|
|
27
|
+
* JSON no longer matches.
|
|
28
|
+
*/
|
|
29
|
+
export declare function verifyWebhookSignature(payload: string | Uint8Array, header: string | null | undefined, secret: string | null | undefined, options?: {
|
|
30
|
+
tolerance?: number;
|
|
31
|
+
now?: number;
|
|
32
|
+
}): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reguard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Reguard for your server: catch AI agents and tools reverse engineering your web app. app.use(reguard()) serves /_s/*, adds the script tag, verifies verdicts, blocks (or dry-runs) flagged visitors and sends request summaries (hashes and shapes only). Next.js helpers in reguard/next, fetch runtimes in reguard/fetch, Fastify in reguard/fastify, test helpers in reguard/testing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"reguard",
|
|
@@ -113,7 +113,8 @@
|
|
|
113
113
|
"url": "https://github.com/cadenticai/reguard-js/issues"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
|
-
"@re-detect/shared": "0.1.0"
|
|
116
|
+
"@re-detect/shared": "0.1.0",
|
|
117
|
+
"fastify": "5.12.8"
|
|
117
118
|
},
|
|
118
119
|
"publishConfig": {
|
|
119
120
|
"access": "public"
|