@clerk/backend
Advanced tools
Comparing version 1.15.3-snapshot.ve498412ac8617eb535cbbeb78d27ded11ad8f45c to 1.15.3
@@ -107,3 +107,2 @@ "use strict"; | ||
}; | ||
var runtime_default = runtime; | ||
@@ -225,7 +224,7 @@ // src/util/rfc4648.ts | ||
if (typeof key === "object") { | ||
return runtime_default.crypto.subtle.importKey("jwk", key, algorithm, false, [keyUsage]); | ||
return runtime.crypto.subtle.importKey("jwk", key, algorithm, false, [keyUsage]); | ||
} | ||
const keyData = pemToBuffer(key); | ||
const format = keyUsage === "sign" ? "pkcs8" : "spki"; | ||
return runtime_default.crypto.subtle.importKey(format, keyData, algorithm, false, [keyUsage]); | ||
return runtime.crypto.subtle.importKey(format, keyData, algorithm, false, [keyUsage]); | ||
} | ||
@@ -259,3 +258,3 @@ | ||
try { | ||
const signature = await runtime_default.crypto.subtle.sign(algorithm, cryptoKey, encoder.encode(firstPart)); | ||
const signature = await runtime.crypto.subtle.sign(algorithm, cryptoKey, encoder.encode(firstPart)); | ||
const encodedSignature = `${firstPart}.${base64url.stringify(new Uint8Array(signature), { pad: false })}`; | ||
@@ -415,3 +414,3 @@ return { data: encodedSignature }; | ||
const cryptoKey = await importKey(key, algorithm, "verify"); | ||
const verified = await runtime_default.crypto.subtle.verify(algorithm.name, cryptoKey, signature, data); | ||
const verified = await runtime.crypto.subtle.verify(algorithm.name, cryptoKey, signature, data); | ||
return { data: verified }; | ||
@@ -418,0 +417,0 @@ } catch (error) { |
@@ -24,4 +24,4 @@ /** | ||
}; | ||
declare const runtime: Runtime; | ||
export default runtime; | ||
export declare const runtime: Runtime; | ||
export {}; | ||
//# sourceMappingURL=runtime.d.ts.map |
@@ -1,18 +0,1 @@ | ||
type ApiResponse<T> = { | ||
data: T | null; | ||
errors: null | any[]; | ||
}; | ||
type SuccessApiResponse<T> = { | ||
data: T; | ||
errors: null; | ||
}; | ||
type ErrorApiResponse = { | ||
data: null; | ||
errors: any[]; | ||
clerkTraceId: string; | ||
status: number; | ||
statusText: string; | ||
}; | ||
export declare function assertResponse<T>(assert: Assert, resp: ApiResponse<T>): asserts resp is SuccessApiResponse<T>; | ||
export declare function assertErrorResponse<T>(assert: Assert, resp: ApiResponse<T>): asserts resp is ErrorApiResponse; | ||
export declare function jsonOk(body: unknown, status?: number): Promise<{ | ||
@@ -57,4 +40,2 @@ ok: boolean; | ||
}>; | ||
export declare function assertOk<T = string>(assert: Assert, data: unknown): asserts data is T; | ||
export {}; | ||
//# sourceMappingURL=testUtils.d.ts.map |
{ | ||
"name": "@clerk/backend", | ||
"version": "1.15.3-snapshot.ve498412ac8617eb535cbbeb78d27ded11ad8f45c", | ||
"version": "1.15.3", | ||
"description": "Clerk Backend SDK - REST Client for Backend API & JWT verification utilities", | ||
@@ -87,15 +87,13 @@ "homepage": "https://clerk.com/", | ||
"clean": "rimraf ./dist", | ||
"clean:tests": "rimraf ./tests/dist", | ||
"lint": "eslint src/", | ||
"lint:publint": "publint", | ||
"lint:attw": "attw --pack . --ignore-rules false-cjs", | ||
"test": "run-s clean:tests build:runtime build:tests test:node test:edge-runtime test:cloudflare-miniflare", | ||
"test:node": "./tests/node/run.sh", | ||
"test:edge-runtime": "./tests/edge-runtime/run.sh", | ||
"test:cloudflare-miniflare": "tests/cloudflare-miniflare/run.sh", | ||
"test:cloudflare-workerd": "tests/cloudflare-workerd/run.sh" | ||
"test": "run-s test:node test:edge-runtime test:cloudflare-miniflare", | ||
"test:node": "vitest --environment node", | ||
"test:edge-runtime": "vitest --environment edge-runtime", | ||
"test:cloudflare-miniflare": "vitest --environment miniflare" | ||
}, | ||
"dependencies": { | ||
"@clerk/shared": "2.11.1-snapshot.ve498412ac8617eb535cbbeb78d27ded11ad8f45c", | ||
"@clerk/types": "4.30.0-snapshot.ve498412ac8617eb535cbbeb78d27ded11ad8f45c", | ||
"@clerk/shared": "2.11.1", | ||
"@clerk/types": "4.29.0", | ||
"cookie": "0.7.0", | ||
@@ -107,19 +105,9 @@ "snakecase-keys": "5.4.4", | ||
"@clerk/eslint-config-custom": "*", | ||
"@cloudflare/workers-types": "^3.19.0", | ||
"@types/chai": "^4.3.3", | ||
"@types/cookie": "^0.6.0", | ||
"@types/node": "^18.19.33", | ||
"@types/qunit": "^2.19.10", | ||
"@types/sinon": "^10.0.13", | ||
"chai": "^4.3.6", | ||
"edge-runtime": "^2.5.10", | ||
"esbuild": "^0.24.0", | ||
"esbuild-register": "^3.6.0", | ||
"miniflare": "^2.14.3", | ||
"msw": "2.4.8", | ||
"npm-run-all": "^4.1.5", | ||
"qunit": "^2.19.3", | ||
"sinon": "^14.0.1", | ||
"tsup": "*", | ||
"typescript": "*", | ||
"workerd": "^1.20240925.0" | ||
"vitest-environment-miniflare": "2.14.4" | ||
}, | ||
@@ -126,0 +114,0 @@ "engines": { |
@@ -47,2 +47,8 @@ <p align="center"> | ||
## Testing | ||
This project uses [vitest](https://vitest.dev/) as the unit test runner and [msw](https://mswjs.io/) for mocking network requests. | ||
If you need to see which requests are being intercepted by `msw`, you can run the test suite with the following env: `DEBUG_MOCK_REQUESTS=true` | ||
## Support | ||
@@ -49,0 +55,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8
205
0
77
1358631
12848
9
13
+ Added@clerk/shared@2.11.1(transitive)
+ Added@clerk/types@4.29.0(transitive)
- Removed@clerk/shared@2.11.1-snapshot.ve498412ac8617eb535cbbeb78d27ded11ad8f45c(transitive)
- Removed@clerk/types@4.30.0-snapshot.ve498412ac8617eb535cbbeb78d27ded11ad8f45c(transitive)
Updated@clerk/shared@2.11.1
Updated@clerk/types@4.29.0