-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Leverage local rate limiting if available in environment
- Loading branch information
1 parent
715ef15
commit adaaa9b
Showing
17 changed files
with
767 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
analyze/wasm/rate-limit/arcjet_analyze_bindings_rate_limit.component.core.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// @generated by wasm2module - DO NOT EDIT | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* This file contains an Arcjet Wasm binary inlined as a base64 | ||
* [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) | ||
* with the application/wasm MIME type. | ||
* | ||
* This was chosen to save on storage space over inlining the file directly as | ||
* a Uint8Array, which would take up ~3x the space of the Wasm file. See | ||
* https://blobfolio.com/2019/better-binary-batter-mixing-base64-and-uint8array/ | ||
* for more details. | ||
* | ||
* It is then decoded into an ArrayBuffer to be used directly via WebAssembly's | ||
* `compile()` function in our entry point file. | ||
* | ||
* This is all done to avoid trying to read or bundle the Wasm asset in various | ||
* ways based on the platform or bundler a user is targeting. One example being | ||
* that Next.js requires special `asyncWebAssembly` webpack config to load our | ||
* Wasm file if we don't do this. | ||
* | ||
* In the future, we hope to do away with this workaround when all bundlers | ||
* properly support consistent asset bundling techniques. | ||
*/ | ||
|
||
/** | ||
* Returns an ArrayBuffer for the Arcjet Wasm binary, decoded from a base64 Data | ||
* URL. | ||
*/ | ||
export function wasm(): Promise<ArrayBuffer>; |
38 changes: 38 additions & 0 deletions
38
analyze/wasm/rate-limit/arcjet_analyze_bindings_rate_limit.component.core.js
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+1.4 MB
analyze/wasm/rate-limit/arcjet_analyze_bindings_rate_limit.component.core.wasm
Binary file not shown.
31 changes: 31 additions & 0 deletions
31
analyze/wasm/rate-limit/arcjet_analyze_bindings_rate_limit.component.core2.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// @generated by wasm2module - DO NOT EDIT | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* This file contains an Arcjet Wasm binary inlined as a base64 | ||
* [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) | ||
* with the application/wasm MIME type. | ||
* | ||
* This was chosen to save on storage space over inlining the file directly as | ||
* a Uint8Array, which would take up ~3x the space of the Wasm file. See | ||
* https://blobfolio.com/2019/better-binary-batter-mixing-base64-and-uint8array/ | ||
* for more details. | ||
* | ||
* It is then decoded into an ArrayBuffer to be used directly via WebAssembly's | ||
* `compile()` function in our entry point file. | ||
* | ||
* This is all done to avoid trying to read or bundle the Wasm asset in various | ||
* ways based on the platform or bundler a user is targeting. One example being | ||
* that Next.js requires special `asyncWebAssembly` webpack config to load our | ||
* Wasm file if we don't do this. | ||
* | ||
* In the future, we hope to do away with this workaround when all bundlers | ||
* properly support consistent asset bundling techniques. | ||
*/ | ||
|
||
/** | ||
* Returns an ArrayBuffer for the Arcjet Wasm binary, decoded from a base64 Data | ||
* URL. | ||
*/ | ||
export function wasm(): Promise<ArrayBuffer>; |
38 changes: 38 additions & 0 deletions
38
analyze/wasm/rate-limit/arcjet_analyze_bindings_rate_limit.component.core2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// @generated by wasm2module - DO NOT EDIT | ||
/* eslint-disable */ | ||
// @ts-nocheck | ||
|
||
/** | ||
* This file contains an Arcjet Wasm binary inlined as a base64 | ||
* [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) | ||
* with the application/wasm MIME type. | ||
* | ||
* This was chosen to save on storage space over inlining the file directly as | ||
* a Uint8Array, which would take up ~3x the space of the Wasm file. See | ||
* https://blobfolio.com/2019/better-binary-batter-mixing-base64-and-uint8array/ | ||
* for more details. | ||
* | ||
* It is then decoded into an ArrayBuffer to be used directly via WebAssembly's | ||
* `compile()` function in our entry point file. | ||
* | ||
* This is all done to avoid trying to read or bundle the Wasm asset in various | ||
* ways based on the platform or bundler a user is targeting. One example being | ||
* that Next.js requires special `asyncWebAssembly` webpack config to load our | ||
* Wasm file if we don't do this. | ||
* | ||
* In the future, we hope to do away with this workaround when all bundlers | ||
* properly support consistent asset bundling techniques. | ||
*/ | ||
|
||
const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABEAJgA39/fwBgBn9/f39/fwADAwIAAQQFAXABAgIHFAMBMAAAATEAAQgkaW1wb3J0cwEACiMCDQAgACABIAJBABEAAAsTACAAIAEgAiADIAQgBUEBEQEACwAuCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BjAuMjAuMABtBG5hbWUAExJ3aXQtY29tcG9uZW50OnNoaW0BUQIAJmluZGlyZWN0LWFyY2pldDpyYXRlLWxpbWl0L3N0b3JhZ2UtZ2V0ASZpbmRpcmVjdC1hcmNqZXQ6cmF0ZS1saW1pdC9zdG9yYWdlLXNldA=="; | ||
/** | ||
* Returns an ArrayBuffer for the Arcjet Wasm binary, decoded from a base64 Data | ||
* URL. | ||
*/ | ||
// TODO: Switch back to top-level await when our platforms all support it | ||
export async function wasm() { | ||
// This uses fetch to decode the wasm data url | ||
const wasmDecode = await fetch(wasmBase64); | ||
// And then we return it as an ArrayBuffer | ||
return wasmDecode.arrayBuffer(); | ||
} |
Binary file added
BIN
+256 Bytes
analyze/wasm/rate-limit/arcjet_analyze_bindings_rate_limit.component.core2.wasm
Binary file not shown.
31 changes: 31 additions & 0 deletions
31
analyze/wasm/rate-limit/arcjet_analyze_bindings_rate_limit.component.core3.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// @generated by wasm2module - DO NOT EDIT | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* This file contains an Arcjet Wasm binary inlined as a base64 | ||
* [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) | ||
* with the application/wasm MIME type. | ||
* | ||
* This was chosen to save on storage space over inlining the file directly as | ||
* a Uint8Array, which would take up ~3x the space of the Wasm file. See | ||
* https://blobfolio.com/2019/better-binary-batter-mixing-base64-and-uint8array/ | ||
* for more details. | ||
* | ||
* It is then decoded into an ArrayBuffer to be used directly via WebAssembly's | ||
* `compile()` function in our entry point file. | ||
* | ||
* This is all done to avoid trying to read or bundle the Wasm asset in various | ||
* ways based on the platform or bundler a user is targeting. One example being | ||
* that Next.js requires special `asyncWebAssembly` webpack config to load our | ||
* Wasm file if we don't do this. | ||
* | ||
* In the future, we hope to do away with this workaround when all bundlers | ||
* properly support consistent asset bundling techniques. | ||
*/ | ||
|
||
/** | ||
* Returns an ArrayBuffer for the Arcjet Wasm binary, decoded from a base64 Data | ||
* URL. | ||
*/ | ||
export function wasm(): Promise<ArrayBuffer>; |
38 changes: 38 additions & 0 deletions
38
analyze/wasm/rate-limit/arcjet_analyze_bindings_rate_limit.component.core3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// @generated by wasm2module - DO NOT EDIT | ||
/* eslint-disable */ | ||
// @ts-nocheck | ||
|
||
/** | ||
* This file contains an Arcjet Wasm binary inlined as a base64 | ||
* [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) | ||
* with the application/wasm MIME type. | ||
* | ||
* This was chosen to save on storage space over inlining the file directly as | ||
* a Uint8Array, which would take up ~3x the space of the Wasm file. See | ||
* https://blobfolio.com/2019/better-binary-batter-mixing-base64-and-uint8array/ | ||
* for more details. | ||
* | ||
* It is then decoded into an ArrayBuffer to be used directly via WebAssembly's | ||
* `compile()` function in our entry point file. | ||
* | ||
* This is all done to avoid trying to read or bundle the Wasm asset in various | ||
* ways based on the platform or bundler a user is targeting. One example being | ||
* that Next.js requires special `asyncWebAssembly` webpack config to load our | ||
* Wasm file if we don't do this. | ||
* | ||
* In the future, we hope to do away with this workaround when all bundlers | ||
* properly support consistent asset bundling techniques. | ||
*/ | ||
|
||
const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABEAJgA39/fwBgBn9/f39/fwACGgMAATAAAAABMQABAAgkaW1wb3J0cwFwAQICCQgBAEEACwIAAQAuCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BjAuMjAuMAAcBG5hbWUAFRR3aXQtY29tcG9uZW50OmZpeHVwcw=="; | ||
/** | ||
* Returns an ArrayBuffer for the Arcjet Wasm binary, decoded from a base64 Data | ||
* URL. | ||
*/ | ||
// TODO: Switch back to top-level await when our platforms all support it | ||
export async function wasm() { | ||
// This uses fetch to decode the wasm data url | ||
const wasmDecode = await fetch(wasmBase64); | ||
// And then we return it as an ArrayBuffer | ||
return wasmDecode.arrayBuffer(); | ||
} |
Binary file added
BIN
+142 Bytes
analyze/wasm/rate-limit/arcjet_analyze_bindings_rate_limit.component.core3.wasm
Binary file not shown.
Oops, something went wrong.