@sebastienrousseau/crypto-server 0.0.32 → 0.0.34
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 +46 -34
- package/dist/config/constants.d.ts.map +1 -1
- package/dist/config/constants.js +0 -1
- package/package.json +36 -29
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
**The Crypto Service ecosystem**
|
|
34
34
|
|
|
35
|
-
- [The Crypto Service ecosystem](#the-crypto-service-ecosystem) — full
|
|
35
|
+
- [The Crypto Service ecosystem](#the-crypto-service-ecosystem) — full 18-package suite overview
|
|
36
36
|
|
|
37
37
|
**Package reference**
|
|
38
38
|
|
|
@@ -106,22 +106,26 @@ curl -s -X POST http://localhost:3000/v2/hash \
|
|
|
106
106
|
|
|
107
107
|
Crypto Service provides a complete cryptography stack across 14 specialized packages:
|
|
108
108
|
|
|
109
|
-
| Package
|
|
110
|
-
|
|
|
111
|
-
| [`@sebastienrousseau/crypto-api`](
|
|
112
|
-
| [`@sebastienrousseau/crypto-
|
|
113
|
-
| [`@sebastienrousseau/crypto-
|
|
114
|
-
| [`@sebastienrousseau/crypto-
|
|
115
|
-
| [`@sebastienrousseau/crypto-
|
|
116
|
-
| [`@sebastienrousseau/crypto-
|
|
117
|
-
| [`@sebastienrousseau/crypto-
|
|
118
|
-
| [`@sebastienrousseau/crypto-
|
|
119
|
-
| [`@sebastienrousseau/crypto-
|
|
120
|
-
|
|
|
121
|
-
| [`@sebastienrousseau/crypto-
|
|
122
|
-
| [`@sebastienrousseau/crypto-
|
|
123
|
-
| [`@sebastienrousseau/crypto-
|
|
124
|
-
| [`@sebastienrousseau/crypto-
|
|
109
|
+
| Package | Role | Description |
|
|
110
|
+
| :---------------------------------------------------------------------------------------------------------------------------------------------- | :-------------- | :----------------------------------------------------------------------------------------------------------------------------- |
|
|
111
|
+
| [`@sebastienrousseau/crypto-api`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-api) | API Schemas | Shared TypeScript types and utilities for the Crypto Service Suite, defining the canonical API surface. |
|
|
112
|
+
| [`@sebastienrousseau/crypto-benchmarks`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-benchmarks) | Benchmarks | Benchmarks comparing classical and post-quantum cryptography: ops/sec, latency and throughput. |
|
|
113
|
+
| [`@sebastienrousseau/crypto-cbom`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-cbom) | CBOM | Cryptographic Bill of Materials generator and auditor (CycloneDX 1.6, SPDX 3.0). |
|
|
114
|
+
| [`@sebastienrousseau/crypto-cli`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-cli) | Terminal CLI | Command-line interface: hashing, key generation, encryption, signing, HPKE, Argon2id and CBOM scans, with an interactive menu. |
|
|
115
|
+
| [`@sebastienrousseau/crypto-edge`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-edge) | Edge Runtime | Edge-runtime cryptographic operations using the Web Crypto API, optimized for Cloudflare Workers, Vercel Edge, and Deno. |
|
|
116
|
+
| [`@sebastienrousseau/crypto-kms`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-kms) | Cloud KMS | Unified KMS interface: AWS KMS and local providers implemented; GCP, Azure and Vault are stubs. |
|
|
117
|
+
| [`@sebastienrousseau/crypto-lib`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-lib) | Core Library | Core library: post-quantum ML-KEM, ML-DSA and SLH-DSA, plus classical, modern and OpenPGP cryptography for TypeScript. |
|
|
118
|
+
| [`@sebastienrousseau/crypto-lsp`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-lsp) | IDE Analysis | Language server that flags weak and quantum-vulnerable cryptography in the editor, with quick fixes. |
|
|
119
|
+
| [`@sebastienrousseau/crypto-mcp`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-mcp) | AI Agents | Model Context Protocol server exposing cryptography tools to AI assistants and agents. |
|
|
120
|
+
| [`@sebastienrousseau/crypto-middleware`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-middleware) | Middleware | Cryptographic middleware for Express and Fastify: decrypt requests, encrypt responses, verify HMAC signatures and JWTs. |
|
|
121
|
+
| [`@sebastienrousseau/crypto-prisma`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-prisma) | ORM Adapter | Transparent field-level encryption extension for Prisma Client, using XChaCha20-Poly1305. |
|
|
122
|
+
| [`@sebastienrousseau/crypto-react`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-react) | React Hooks | React hooks and context provider for client-side cryptographic operations with zero boilerplate. |
|
|
123
|
+
| [`@sebastienrousseau/crypto-sdk`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-sdk) | Client SDK | A zero-dependency, typed HTTP client for the Crypto Service REST API, with full post-quantum support. |
|
|
124
|
+
| **[`@sebastienrousseau/crypto-server`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-server)** _(this package)_ | **HTTP API** | **A hardened Fastify REST API for cryptographic operations, with rate limiting, OpenAPI schemas, and post-quantum endpoints.** |
|
|
125
|
+
| [`@sebastienrousseau/crypto-testing`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-testing) | Test Support | Deterministic keys, fast mocks, and test fixtures for crypto-lib |
|
|
126
|
+
| [`@sebastienrousseau/crypto-typeorm`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-typeorm) | ORM Adapter | TypeORM column-level encryption with a single decorator, powered by crypto-lib. |
|
|
127
|
+
| [`@sebastienrousseau/crypto-vue`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-vue) | Vue Composables | Vue 3 composables for client-side cryptography |
|
|
128
|
+
| [`@sebastienrousseau/crypto-wasm`](https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-wasm) | Acceleration | Placeholder for a WebAssembly accelerator; no WebAssembly module ships yet. |
|
|
125
129
|
|
|
126
130
|
<p align="right"><a href="#contents">Back to Top</a></p>
|
|
127
131
|
|
|
@@ -326,23 +330,31 @@ authentication but no scope.
|
|
|
326
330
|
|
|
327
331
|
## Configuration
|
|
328
332
|
|
|
329
|
-
| Variable
|
|
330
|
-
|
|
|
331
|
-
| `PORT`
|
|
332
|
-
| `HOST`
|
|
333
|
-
| `PROTOCOL`
|
|
334
|
-
| `NODE_ENV`
|
|
335
|
-
| `LOG_LEVEL`
|
|
336
|
-
| `CRYPTO_API_KEY`
|
|
337
|
-
| `JWT_SECRET`
|
|
338
|
-
| `JWT_MAX_AGE`
|
|
339
|
-
| `JWT_ISSUER`
|
|
340
|
-
| `JWT_AUDIENCE`
|
|
341
|
-
| `CORS_ORIGIN`
|
|
342
|
-
| `TRUSTED_PROXY_CIDRS`
|
|
343
|
-
| `CRYPTO_KEY_DIR`
|
|
344
|
-
| `CRYPTO_KEY_OUT_DIR`
|
|
345
|
-
| `SHUTDOWN_TIMEOUT_MS`
|
|
333
|
+
| Variable | Default | Description |
|
|
334
|
+
| :----------------------------------------------------------------------- | :----------------------------------- | :------------------------------------------------------------------------------------------------------------ |
|
|
335
|
+
| `PORT` | `3000` | TCP port to listen on |
|
|
336
|
+
| `HOST` | `localhost` | Bind address |
|
|
337
|
+
| `PROTOCOL` | `http` | `http` or `https` |
|
|
338
|
+
| `NODE_ENV` | `development` | `development`, `production`, or `test` |
|
|
339
|
+
| `LOG_LEVEL` | `info` | `error`, `warn`, `info`, or `debug` |
|
|
340
|
+
| `CRYPTO_API_KEY` | -- | Static API key for `x-api-key` authentication |
|
|
341
|
+
| `JWT_SECRET` | -- | HMAC secret for HS256 JWT validation |
|
|
342
|
+
| `JWT_MAX_AGE` | `3600` | Maximum JWT lifetime in seconds |
|
|
343
|
+
| `JWT_ISSUER` | -- | Required JWT `iss` (required in production) |
|
|
344
|
+
| `JWT_AUDIENCE` | -- | Required JWT `aud` (required in production) |
|
|
345
|
+
| `CORS_ORIGIN` | -- | Comma-separated allowed origins (empty = disabled) |
|
|
346
|
+
| `TRUSTED_PROXY_CIDRS` | -- | Comma-separated trusted proxy CIDRs |
|
|
347
|
+
| `CRYPTO_KEY_DIR` | -- | Directory for key storage |
|
|
348
|
+
| `CRYPTO_KEY_OUT_DIR` | -- | Where generated keys are persisted (see Key custody) |
|
|
349
|
+
| `SHUTDOWN_TIMEOUT_MS` | `30000` | Graceful shutdown timeout in milliseconds |
|
|
350
|
+
| `ALLOW_ANONYMOUS` | -- | `1` allows unauthenticated requests |
|
|
351
|
+
| `RATE_LIMIT_MAX` | `10` | Requests per client per minute (probes are exempt) |
|
|
352
|
+
| `CRYPTO_KEY_STORAGE_KEY` | -- | Encrypts persisted private keys at rest (AES-256-GCM): 64 hex characters, or a passphrase hashed with SHA-256 |
|
|
353
|
+
| `OTEL_EXPORTER_OTLP_ENDPOINT` | -- | OpenTelemetry OTLP collector endpoint (export disabled when unset) |
|
|
354
|
+
| `AWS_REGION` | `us-east-1` | Region for the AWS KMS provider |
|
|
355
|
+
| `GCP_PROJECT_ID`, `GCP_LOCATION_ID`, `GCP_KEY_RING_ID`, `GCP_AUTH_TOKEN` | placeholders | GCP KMS provider settings (the provider is a stub) |
|
|
356
|
+
| `VAULT_ADDR`, `VAULT_TOKEN` | `http://localhost:8200`, placeholder | Vault KMS provider settings (the provider is a stub) |
|
|
357
|
+
| `AZURE_VAULT_URL` | placeholder | Azure Key Vault provider setting (the provider is a stub) |
|
|
346
358
|
|
|
347
359
|
<p align="right"><a href="#contents">Back to Top</a></p>
|
|
348
360
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,M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MAAM,KAAK,IAAI,CAAA;SAAE,CAAA;KAAE,WAChD;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;;;;;;;;CAoB3E,CAAC;AAOF,eAAO,MAAM,mBAAmB,QAAO,MAKtC,CAAC;AAMF,eAAO,MAAM,kBAAkB;;;CAK9B,CAAC"}
|
package/dist/config/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebastienrousseau/crypto-server",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.34",
|
|
4
|
+
"description": "Fastify REST API for cryptography as a service: post-quantum ML-KEM and ML-DSA, encryption, signing, hashing and KMS endpoints, with OpenAPI docs, API key or JWT auth, rate limiting and OpenTelemetry.",
|
|
5
5
|
"author": "Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT OR Apache-2.0",
|
|
7
7
|
"homepage": "https://crypto-server.io",
|
|
@@ -37,37 +37,37 @@
|
|
|
37
37
|
"dist/**/*.d.ts.map"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@fastify/accepts": "^5.0.
|
|
41
|
-
"@fastify/compress": "^9.2.
|
|
42
|
-
"@fastify/cors": "^11.3.
|
|
43
|
-
"@fastify/etag": "^6.2.
|
|
44
|
-
"@fastify/helmet": "^13.
|
|
45
|
-
"@fastify/jwt": "^10.2.
|
|
46
|
-
"@fastify/rate-limit": "^11.2.
|
|
47
|
-
"@fastify/swagger": "^9.9.
|
|
48
|
-
"@fastify/swagger-ui": "^6.1.
|
|
40
|
+
"@fastify/accepts": "^5.0.7",
|
|
41
|
+
"@fastify/compress": "^9.2.2",
|
|
42
|
+
"@fastify/cors": "^11.3.1",
|
|
43
|
+
"@fastify/etag": "^6.2.1",
|
|
44
|
+
"@fastify/helmet": "^13.2.0",
|
|
45
|
+
"@fastify/jwt": "^10.2.4",
|
|
46
|
+
"@fastify/rate-limit": "^11.2.1",
|
|
47
|
+
"@fastify/swagger": "^9.9.2",
|
|
48
|
+
"@fastify/swagger-ui": "^6.1.2",
|
|
49
49
|
"@opentelemetry/api": "^1.9.0",
|
|
50
|
-
"@opentelemetry/exporter-metrics-otlp-http": "^0.
|
|
51
|
-
"@opentelemetry/exporter-trace-otlp-http": "^0.
|
|
50
|
+
"@opentelemetry/exporter-metrics-otlp-http": "^0.223.0",
|
|
51
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.223.0",
|
|
52
52
|
"@opentelemetry/instrumentation-fastify": "^0.57.0",
|
|
53
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
54
|
-
"@opentelemetry/resources": "^2.
|
|
55
|
-
"@opentelemetry/sdk-metrics": "^2.
|
|
56
|
-
"@opentelemetry/sdk-node": "^0.
|
|
57
|
-
"@opentelemetry/sdk-trace-node": "^2.
|
|
53
|
+
"@opentelemetry/instrumentation-http": "^0.223.0",
|
|
54
|
+
"@opentelemetry/resources": "^2.12.0",
|
|
55
|
+
"@opentelemetry/sdk-metrics": "^2.12.0",
|
|
56
|
+
"@opentelemetry/sdk-node": "^0.223.0",
|
|
57
|
+
"@opentelemetry/sdk-trace-node": "^2.12.0",
|
|
58
58
|
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
59
|
-
"fastify": "^5.12.
|
|
59
|
+
"fastify": "^5.12.7",
|
|
60
60
|
"fastify-healthcheck": "^5.1.0",
|
|
61
|
-
"uuid": "^14.0.
|
|
61
|
+
"uuid": "^14.0.3",
|
|
62
62
|
"winston": "^3.17.0",
|
|
63
|
-
"@sebastienrousseau/crypto-
|
|
64
|
-
"@sebastienrousseau/crypto-
|
|
63
|
+
"@sebastienrousseau/crypto-lib": "0.0.34",
|
|
64
|
+
"@sebastienrousseau/crypto-kms": "0.0.34"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/chai": "^5.2.3",
|
|
68
68
|
"@types/chai-as-promised": "^8.0.2",
|
|
69
69
|
"@types/mocha": "^10.0.10",
|
|
70
|
-
"@types/node": "^26.6.
|
|
70
|
+
"@types/node": "^26.6.5",
|
|
71
71
|
"@types/uuid": "^11.0.0",
|
|
72
72
|
"c8": "^12.0.0",
|
|
73
73
|
"chai": "^6.3.0",
|
|
@@ -75,20 +75,27 @@
|
|
|
75
75
|
"fast-check": "^4.10.2",
|
|
76
76
|
"mocha": "^12.0.3",
|
|
77
77
|
"openpgp": "^6.3.2",
|
|
78
|
-
"prettier": "^3.9.
|
|
78
|
+
"prettier": "^3.9.10",
|
|
79
79
|
"rimraf": "^6.1.3",
|
|
80
80
|
"ts-node": "^10.9.2",
|
|
81
81
|
"typedoc": "^0.28.20",
|
|
82
82
|
"typescript": "~5.9.3"
|
|
83
83
|
},
|
|
84
84
|
"keywords": [
|
|
85
|
-
"
|
|
85
|
+
"fastify",
|
|
86
|
+
"rest-api",
|
|
86
87
|
"cryptography",
|
|
87
88
|
"encryption",
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
89
|
+
"post-quantum",
|
|
90
|
+
"pqc",
|
|
91
|
+
"ml-kem",
|
|
92
|
+
"ml-dsa",
|
|
93
|
+
"openapi",
|
|
94
|
+
"microservice",
|
|
95
|
+
"opentelemetry",
|
|
96
|
+
"jwt",
|
|
97
|
+
"kms",
|
|
98
|
+
"openpgp"
|
|
92
99
|
],
|
|
93
100
|
"publishConfig": {
|
|
94
101
|
"access": "public"
|