@sebastienrousseau/crypto-sdk 0.0.8 → 0.0.24
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 +114 -58
- package/dist/errors.d.ts +8 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +32 -0
- package/dist/index.d.ts +69 -241
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +102 -139
- package/dist/key-types.d.ts +203 -0
- package/dist/key-types.d.ts.map +1 -0
- package/dist/key-types.js +3 -0
- package/dist/negotiation.d.ts +3 -0
- package/dist/negotiation.d.ts.map +1 -0
- package/dist/negotiation.js +105 -0
- package/dist/request.d.ts +15 -0
- package/dist/request.d.ts.map +1 -0
- package/dist/request.js +111 -0
- package/dist/types.d.ts +183 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/package.json +17 -13
package/dist/request.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRetryConfig = resolveRetryConfig;
|
|
4
|
+
exports.buildClientHeaders = buildClientHeaders;
|
|
5
|
+
exports.isTransientStatus = isTransientStatus;
|
|
6
|
+
exports.computeBackoffDelay = computeBackoffDelay;
|
|
7
|
+
exports.buildRequestInit = buildRequestInit;
|
|
8
|
+
exports.executeRequest = executeRequest;
|
|
9
|
+
exports.generateSdkTraceparent = generateSdkTraceparent;
|
|
10
|
+
exports.resolveTraceparentHeader = resolveTraceparentHeader;
|
|
11
|
+
const errors_1 = require("./errors");
|
|
12
|
+
function resolveRetryConfig(retry) {
|
|
13
|
+
return {
|
|
14
|
+
maxRetries: Math.max(0, retry?.maxRetries ?? 0),
|
|
15
|
+
initialDelayMs: Math.max(0, retry?.initialDelayMs ?? 200),
|
|
16
|
+
maxDelayMs: Math.max(0, retry?.maxDelayMs ?? 2000),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function buildClientHeaders(options) {
|
|
20
|
+
const headers = {
|
|
21
|
+
"Content-Type": "application/json",
|
|
22
|
+
};
|
|
23
|
+
if (options.apiKey)
|
|
24
|
+
headers["x-api-key"] = options.apiKey;
|
|
25
|
+
if (options.token)
|
|
26
|
+
headers["Authorization"] = `Bearer ${options.token}`;
|
|
27
|
+
if (typeof options.traceparent === "string" &&
|
|
28
|
+
options.traceparent.trim().length > 0) {
|
|
29
|
+
headers["traceparent"] = options.traceparent.trim();
|
|
30
|
+
}
|
|
31
|
+
return headers;
|
|
32
|
+
}
|
|
33
|
+
function isTransientStatus(status) {
|
|
34
|
+
return status === 429 || status === 503 || status === 504;
|
|
35
|
+
}
|
|
36
|
+
function computeBackoffDelay(attempt, config, retryAfterHeader) {
|
|
37
|
+
if (retryAfterHeader) {
|
|
38
|
+
const parsed = Number(retryAfterHeader);
|
|
39
|
+
if (!Number.isNaN(parsed) && parsed > 0) {
|
|
40
|
+
return Math.min(parsed * 1000, config.maxDelayMs);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return Math.min(config.initialDelayMs * 2 ** (attempt - 1), config.maxDelayMs);
|
|
44
|
+
}
|
|
45
|
+
function buildRequestInit(method, headers, body, timeout) {
|
|
46
|
+
const init = { method, headers };
|
|
47
|
+
if (body) {
|
|
48
|
+
init.body = JSON.stringify(body);
|
|
49
|
+
}
|
|
50
|
+
if (timeout !== undefined &&
|
|
51
|
+
timeout > 0 &&
|
|
52
|
+
typeof AbortSignal !== "undefined" &&
|
|
53
|
+
typeof AbortSignal.timeout === "function") {
|
|
54
|
+
init.signal = AbortSignal.timeout(timeout);
|
|
55
|
+
}
|
|
56
|
+
return init;
|
|
57
|
+
}
|
|
58
|
+
async function executeRequest(fetchFn, url, init, retry) {
|
|
59
|
+
const maxAttempts = 1 + retry.maxRetries;
|
|
60
|
+
let attempt = 0;
|
|
61
|
+
while (true) {
|
|
62
|
+
let res;
|
|
63
|
+
try {
|
|
64
|
+
res = await fetchFn(url, init);
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
attempt++;
|
|
68
|
+
if (attempt < maxAttempts) {
|
|
69
|
+
await new Promise((r) => setTimeout(r, computeBackoffDelay(attempt, retry)));
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
throw err;
|
|
73
|
+
}
|
|
74
|
+
if (res.ok) {
|
|
75
|
+
return (await res.json());
|
|
76
|
+
}
|
|
77
|
+
attempt++;
|
|
78
|
+
if (isTransientStatus(res.status) && attempt < maxAttempts) {
|
|
79
|
+
const header = res.headers?.get?.("retry-after");
|
|
80
|
+
await new Promise((r) => setTimeout(r, computeBackoffDelay(attempt, retry, header)));
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
throw new errors_1.CryptoApiError(res.status, await (0, errors_1.readProblem)(res));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function generateSdkTraceparent() {
|
|
87
|
+
const bytes = new Uint8Array(24);
|
|
88
|
+
if (typeof globalThis.crypto !== "undefined" &&
|
|
89
|
+
typeof globalThis.crypto.getRandomValues === "function") {
|
|
90
|
+
globalThis.crypto.getRandomValues(bytes);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
for (let i = 0; i < 24; i++) {
|
|
94
|
+
bytes[i] = Math.floor(Math.random() * 256);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
bytes[0] = (bytes[0] % 255) + 1;
|
|
98
|
+
bytes[16] = (bytes[16] % 255) + 1;
|
|
99
|
+
let hex = "";
|
|
100
|
+
for (let i = 0; i < 24; i++) {
|
|
101
|
+
hex += bytes[i].toString(16).padStart(2, "0");
|
|
102
|
+
}
|
|
103
|
+
return `00-${hex.slice(0, 32)}-${hex.slice(32, 48)}-01`;
|
|
104
|
+
}
|
|
105
|
+
function resolveTraceparentHeader(traceparent) {
|
|
106
|
+
if (typeof traceparent === "string" && traceparent.trim().length > 0) {
|
|
107
|
+
return traceparent.trim();
|
|
108
|
+
}
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=request.js.map
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
export interface RetryOptions {
|
|
2
|
+
maxRetries?: number;
|
|
3
|
+
initialDelayMs?: number;
|
|
4
|
+
maxDelayMs?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ClientOptions {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
apiKey?: string;
|
|
9
|
+
token?: string;
|
|
10
|
+
fetch?: typeof globalThis.fetch;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
retry?: RetryOptions;
|
|
13
|
+
traceparent?: string | boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ApiResponse<T> {
|
|
16
|
+
data: T;
|
|
17
|
+
}
|
|
18
|
+
export interface ApiErrorField {
|
|
19
|
+
field: string;
|
|
20
|
+
message: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ApiError {
|
|
23
|
+
type: string;
|
|
24
|
+
title: string;
|
|
25
|
+
status: number;
|
|
26
|
+
detail: string;
|
|
27
|
+
instance?: string;
|
|
28
|
+
code?: string;
|
|
29
|
+
errors?: ApiErrorField[];
|
|
30
|
+
[extension: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
export type HashAlgorithm = "sha256" | "sha384" | "sha512" | "sha3-256" | "sha3-512" | "blake2b" | "blake3";
|
|
33
|
+
export type HmacAlgorithm = "sha256" | "sha384" | "sha512" | "sha3-256" | "sha3-512";
|
|
34
|
+
export type KdfAlgorithm = "scrypt" | "hkdf-sha256" | "pbkdf2-sha256";
|
|
35
|
+
export interface HashResult {
|
|
36
|
+
digest: string;
|
|
37
|
+
algorithm: string;
|
|
38
|
+
length: number;
|
|
39
|
+
}
|
|
40
|
+
export interface AeadResult {
|
|
41
|
+
ciphertext: string;
|
|
42
|
+
algorithm: string;
|
|
43
|
+
}
|
|
44
|
+
export interface KdfResult {
|
|
45
|
+
derivedKey: string;
|
|
46
|
+
salt: string;
|
|
47
|
+
algorithm: string;
|
|
48
|
+
keyLength: number;
|
|
49
|
+
}
|
|
50
|
+
export interface SecretboxSealResult {
|
|
51
|
+
sealed: string;
|
|
52
|
+
algorithm: string;
|
|
53
|
+
}
|
|
54
|
+
export interface PasswordEncryptResult {
|
|
55
|
+
encrypted: string;
|
|
56
|
+
algorithm: string;
|
|
57
|
+
}
|
|
58
|
+
export type KeyWrapAlgorithm = "aes-kw" | "aes-kwp";
|
|
59
|
+
export interface KeyWrapResult {
|
|
60
|
+
wrapped: string;
|
|
61
|
+
algorithm: KeyWrapAlgorithm;
|
|
62
|
+
}
|
|
63
|
+
export interface HealthResult {
|
|
64
|
+
statusCode: number;
|
|
65
|
+
status?: string;
|
|
66
|
+
uptime?: number;
|
|
67
|
+
}
|
|
68
|
+
export interface DoraComplianceScorecard {
|
|
69
|
+
standard: string;
|
|
70
|
+
article: string;
|
|
71
|
+
status: string;
|
|
72
|
+
disclaimer: string;
|
|
73
|
+
quantumResistanceRatio: number;
|
|
74
|
+
activePrimitivesCount: number;
|
|
75
|
+
postQuantumPrimitivesCount: number;
|
|
76
|
+
algorithmDeprecationSchedule: Array<{
|
|
77
|
+
algorithm: string;
|
|
78
|
+
category: string;
|
|
79
|
+
sunsetDate: string;
|
|
80
|
+
recommendedMigration: string;
|
|
81
|
+
}>;
|
|
82
|
+
cryptographicInventory: Array<{
|
|
83
|
+
package: string;
|
|
84
|
+
version: string;
|
|
85
|
+
status: string;
|
|
86
|
+
fipsCompliance: string;
|
|
87
|
+
}>;
|
|
88
|
+
timestamp: string;
|
|
89
|
+
}
|
|
90
|
+
export interface CbomExportPayload {
|
|
91
|
+
bomFormat: string;
|
|
92
|
+
specVersion: string;
|
|
93
|
+
serialNumber: string;
|
|
94
|
+
version: number;
|
|
95
|
+
metadata: Record<string, unknown>;
|
|
96
|
+
components: Array<Record<string, unknown>>;
|
|
97
|
+
}
|
|
98
|
+
export interface AlgorithmNegotiationOptions {
|
|
99
|
+
maxPayloadBytes?: number;
|
|
100
|
+
securityCategoryMin?: 1 | 3 | 5;
|
|
101
|
+
requireHybrid?: boolean;
|
|
102
|
+
clientSupportedAlgorithms?: string[];
|
|
103
|
+
}
|
|
104
|
+
export interface AlgorithmNegotiationResult {
|
|
105
|
+
selectedAlgorithm: string;
|
|
106
|
+
cipherCategory: "lattice-kem" | "hybrid-kem" | "classical-ecdh";
|
|
107
|
+
securityCategory: 1 | 3 | 5;
|
|
108
|
+
isHybrid: boolean;
|
|
109
|
+
publicKeyBytes: number;
|
|
110
|
+
ciphertextBytes: number;
|
|
111
|
+
totalPayloadOverhead: number;
|
|
112
|
+
fitsWithinMtu: boolean;
|
|
113
|
+
fallbackChain: string[];
|
|
114
|
+
compliancePosture: {
|
|
115
|
+
standard: string;
|
|
116
|
+
doraArticle13Compliant: boolean;
|
|
117
|
+
fipsStandard: string;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export interface MacResult {
|
|
121
|
+
mac: string;
|
|
122
|
+
algorithm: string;
|
|
123
|
+
}
|
|
124
|
+
export interface MacVerifyResult {
|
|
125
|
+
valid: boolean;
|
|
126
|
+
algorithm: string;
|
|
127
|
+
}
|
|
128
|
+
export interface Argon2Params {
|
|
129
|
+
t: number;
|
|
130
|
+
m: number;
|
|
131
|
+
p: number;
|
|
132
|
+
}
|
|
133
|
+
export interface PasswordHashResult {
|
|
134
|
+
hash: string;
|
|
135
|
+
salt: string;
|
|
136
|
+
params: Argon2Params;
|
|
137
|
+
algorithm: string;
|
|
138
|
+
phc: string;
|
|
139
|
+
}
|
|
140
|
+
export interface StreamPqEncryptParams {
|
|
141
|
+
x25519PublicKey: string;
|
|
142
|
+
mlKemPublicKey: string;
|
|
143
|
+
plaintext: string;
|
|
144
|
+
chunkSize?: number;
|
|
145
|
+
}
|
|
146
|
+
export interface StreamPqEncryptResult {
|
|
147
|
+
ciphertext: string;
|
|
148
|
+
algorithm: "x25519-ml-kem-768-xchacha20-poly1305-stream";
|
|
149
|
+
}
|
|
150
|
+
export interface StreamPqDecryptParams {
|
|
151
|
+
keyId: string;
|
|
152
|
+
ciphertext: string;
|
|
153
|
+
chunkSize?: number;
|
|
154
|
+
}
|
|
155
|
+
export interface StreamPqDecryptResult {
|
|
156
|
+
plaintext: string;
|
|
157
|
+
}
|
|
158
|
+
export interface StreamMultiPqRecipient {
|
|
159
|
+
recipientId: string;
|
|
160
|
+
x25519PublicKey: string;
|
|
161
|
+
mlKemPublicKey: string;
|
|
162
|
+
}
|
|
163
|
+
export interface StreamMultiPqEncryptParams {
|
|
164
|
+
recipients: StreamMultiPqRecipient[];
|
|
165
|
+
plaintext: string;
|
|
166
|
+
chunkSize?: number;
|
|
167
|
+
}
|
|
168
|
+
export interface StreamMultiPqEncryptResult {
|
|
169
|
+
ciphertext: string;
|
|
170
|
+
algorithm: "multi-x25519-ml-kem-768-xchacha20-poly1305-stream";
|
|
171
|
+
recipientCount: number;
|
|
172
|
+
}
|
|
173
|
+
export interface StreamMultiPqDecryptParams {
|
|
174
|
+
keyId: string;
|
|
175
|
+
recipientId?: string;
|
|
176
|
+
ciphertext: string;
|
|
177
|
+
chunkSize?: number;
|
|
178
|
+
}
|
|
179
|
+
export interface StreamMultiPqDecryptResult {
|
|
180
|
+
plaintext: string;
|
|
181
|
+
recipientId: string;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAyBA,MAAM,WAAW,YAAY;IAE3B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAE5B,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,MAAM,CAAC;IA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pB;AAGD,MAAM,WAAW,0BAA0B;IAEzC,SAAS,EAAE,MAAM,CAAC;IAElB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
package/dist/types.js
ADDED
package/package.json
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebastienrousseau/crypto-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "Type-safe TypeScript client for the Crypto Service Suite v2 API. Zero dependencies, fetch-based.",
|
|
5
5
|
"author": "Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT OR Apache-2.0",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=22.0.0"
|
|
9
9
|
},
|
|
10
|
+
"type": "commonjs",
|
|
10
11
|
"main": "./dist/index.js",
|
|
11
12
|
"types": "./dist/index.d.ts",
|
|
12
|
-
"sideEffects": false,
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"require": "./dist/index.js",
|
|
17
|
-
"
|
|
18
|
-
}
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
19
20
|
},
|
|
21
|
+
"sideEffects": false,
|
|
20
22
|
"files": [
|
|
21
23
|
"dist/**/*.js",
|
|
22
24
|
"dist/**/*.d.ts",
|
|
23
25
|
"dist/**/*.d.ts.map"
|
|
24
26
|
],
|
|
25
27
|
"devDependencies": {
|
|
26
|
-
"@sebastienrousseau/mocha-config": "^0.0.
|
|
27
|
-
"@types/chai": "^
|
|
28
|
+
"@sebastienrousseau/mocha-config": "^0.0.7",
|
|
29
|
+
"@types/chai": "^5.2.3",
|
|
28
30
|
"@types/chai-as-promised": "^8.0.2",
|
|
29
|
-
"@types/mocha": "^10.0.
|
|
31
|
+
"@types/mocha": "^10.0.10",
|
|
30
32
|
"@types/node": "^26.6.3",
|
|
31
33
|
"c8": "^12.0.0",
|
|
32
|
-
"chai": "^
|
|
33
|
-
"chai-as-promised": "^
|
|
34
|
-
"mocha": "^
|
|
34
|
+
"chai": "^6.3.0",
|
|
35
|
+
"chai-as-promised": "^8.0.2",
|
|
36
|
+
"mocha": "^12.0.3",
|
|
35
37
|
"rimraf": "^6.1.3",
|
|
36
38
|
"ts-node": "^10.9.2",
|
|
37
39
|
"typedoc": "^0.28.20",
|
|
38
|
-
"typescript": "~5.9.3"
|
|
40
|
+
"typescript": "~5.9.3",
|
|
41
|
+
"@sebastienrousseau/crypto-server": "0.0.24"
|
|
39
42
|
},
|
|
40
43
|
"homepage": "https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-sdk",
|
|
41
44
|
"repository": {
|
|
@@ -52,8 +55,9 @@
|
|
|
52
55
|
"clean": "rimraf ./coverage ./dist ./docs",
|
|
53
56
|
"test": "c8 --check-coverage --lines 100 --branches 100 --functions 100 --reporter=lcov --reporter=text mocha --config=.mocharc.cjs",
|
|
54
57
|
"docs": "typedoc",
|
|
55
|
-
"
|
|
56
|
-
"lint
|
|
58
|
+
"examples:check": "tsc -p examples/tsconfig.json",
|
|
59
|
+
"lint": "eslint src __tests__",
|
|
60
|
+
"lint:fix": "eslint --cache --fix src __tests__",
|
|
57
61
|
"format": "prettier --write src/**/*.ts",
|
|
58
62
|
"format:check": "prettier --check \"src/**/*.ts\""
|
|
59
63
|
}
|