Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [20, 22]
version: [ 20, 22, 24 ]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
Expand Down Expand Up @@ -45,12 +45,13 @@ jobs:
rekey-example,
simple-roundtrip,
deterministic-roundtrip,
disaster-recovery-example,
]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
- name: compilation check
run: |
yarn
Expand Down
2 changes: 1 addition & 1 deletion examples/deterministic-roundtrip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"typescript": "^4.0.2"
},
"dependencies": {
"@ironcorelabs/tenant-security-nodejs": "^3.0.1",
"@ironcorelabs/tenant-security-nodejs": "^4.1.2",
"@types/node": "^14.6.0"
},
"scripts": {
Expand Down
96 changes: 77 additions & 19 deletions examples/deterministic-roundtrip/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,50 @@
# yarn lockfile v1


"@ironcorelabs/tenant-security-nodejs@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@ironcorelabs/tenant-security-nodejs/-/tenant-security-nodejs-3.0.1.tgz#619b2b0b751ee24fd818c05a5fcfb8c0d0ba5af4"
integrity sha512-65Hr7Y1aM1EEgGnsxK0gGRusI3U2cDA7gkf6Mv/IjBt2r7wUOHpzOKTXruJLazrKvDoadEcZzzJl1f0+Ef2Q4Q==
"@hapi/address@^5.1.1":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-5.1.1.tgz#e9925fc1b65f5cc3fbea821f2b980e4652e84cb6"
integrity sha512-A+po2d/dVoY7cYajycYI43ZbYMXukuopIsqCjh5QzsBCipDtdofHntljDlpccMjIfTy6UOkg+5KPriwYch2bXA==
dependencies:
"@hapi/hoek" "^11.0.2"

"@hapi/formula@^3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@hapi/formula/-/formula-3.0.2.tgz#81b538060ee079481c906f599906d163c4badeaf"
integrity sha512-hY5YPNXzw1He7s0iqkRQi+uMGh383CGdyyIGYtB+W5N3KHPXoqychklvHhKCC9M3Xtv0OCs/IHw+r4dcHtBYWw==

"@hapi/hoek@^11.0.2", "@hapi/hoek@^11.0.7":
version "11.0.7"
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-11.0.7.tgz#56a920793e0a42d10e530da9a64cc0d3919c4002"
integrity sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==

"@hapi/pinpoint@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@hapi/pinpoint/-/pinpoint-2.0.1.tgz#32077e715655fc00ab8df74b6b416114287d6513"
integrity sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==

"@hapi/tlds@^1.1.1":
version "1.1.6"
resolved "https://registry.yarnpkg.com/@hapi/tlds/-/tlds-1.1.6.tgz#c98ed89ca76aa030352d6d7102d0f250aed89cfb"
integrity sha512-xdi7A/4NZokvV0ewovme3aUO5kQhW9pQ2YD1hRqZGhhSi5rBv4usHYidVocXSi9eihYsznZxLtAiEYYUL6VBGw==

"@hapi/topo@^6.0.2":
version "6.0.2"
resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-6.0.2.tgz#f219c1c60da8430228af4c1f2e40c32a0d84bbb4"
integrity sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==
dependencies:
"@hapi/hoek" "^11.0.2"

"@ironcorelabs/tenant-security-nodejs@^4.1.2":
version "4.1.2"
resolved "https://registry.yarnpkg.com/@ironcorelabs/tenant-security-nodejs/-/tenant-security-nodejs-4.1.2.tgz#0e2c607777dc4d0604a8d4e3cf8eada26afad637"
integrity sha512-5j+dJPPJloVBkMMtecV9LE90XFifaH/OLngk/BvspNpyYiU275DudtisaAheTxHcbZ7hfCJGRMLiWlXVWO6zgQ==
dependencies:
futurejs "2.2.0"
joi "^18.0.2"
miscreant "^0.3.2"
node-fetch "2.6.12"
protobufjs "^7.2.4"
protobufjs "^7.2.5"

"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
version "1.1.2"
Expand All @@ -22,10 +57,10 @@
resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735"
integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==

"@protobufjs/codegen@^2.0.4":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb"
integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==
"@protobufjs/codegen@^2.0.5":
version "2.0.5"
resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.5.tgz#d9315ad7cf3f30aac70bda3c068443dc6f143659"
integrity sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==

"@protobufjs/eventemitter@^1.1.0":
version "1.1.0"
Expand All @@ -50,6 +85,11 @@
resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089"
integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==

"@protobufjs/inquire@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.1.tgz#6cb936f4ac50965230af1e9d0bbfd57ea3675aa4"
integrity sha512-mnzgDV26ueAvk7rsbt9L7bE0SuAoqyuys/sMMrmVcN5x9VsxpcG3rqAUSgDyLp0UZlmNfIbQ4fHfCtreVBk8Ew==

"@protobufjs/path@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d"
Expand All @@ -60,10 +100,15 @@
resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54"
integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==

"@protobufjs/utf8@^1.1.0":
"@protobufjs/utf8@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.1.tgz#eaee5900122c110a3dbcb728c0597014a2621774"
integrity sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==

"@standard-schema/spec@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==
resolved "https://registry.yarnpkg.com/@standard-schema/spec/-/spec-1.1.0.tgz#a79b55dbaf8604812f52d140b2c9ab41bc150bb8"
integrity sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==

"@types/node@>=13.7.0":
version "17.0.39"
Expand All @@ -80,6 +125,19 @@ futurejs@2.2.0:
resolved "https://registry.yarnpkg.com/futurejs/-/futurejs-2.2.0.tgz#d267fd8cabef653899aa1413e27e3563b2441012"
integrity sha512-JgWDGfaDquVmSNvWAKulJXb/cMvxTAcPw2kW9UI2GsVw8iXuvaGh6hZHp08BkzPh2xFMYgvcwF4lK7qpbDP2HQ==

joi@^18.0.2:
version "18.1.2"
resolved "https://registry.yarnpkg.com/joi/-/joi-18.1.2.tgz#4735a384d7721fcda7a551d128862cf816541924"
integrity sha512-rF5MAmps5esSlhCA+N1b6IYHDw9j/btzGaqfgie522jS02Ju/HXBxamlXVlKEHAxoMKQL77HWI8jlqWsFuekZA==
dependencies:
"@hapi/address" "^5.1.1"
"@hapi/formula" "^3.0.2"
"@hapi/hoek" "^11.0.7"
"@hapi/pinpoint" "^2.0.1"
"@hapi/tlds" "^1.1.1"
"@hapi/topo" "^6.0.2"
"@standard-schema/spec" "^1.1.0"

long@^5.0.0:
version "5.2.3"
resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
Expand All @@ -97,21 +155,21 @@ node-fetch@2.6.12:
dependencies:
whatwg-url "^5.0.0"

protobufjs@^7.2.4:
version "7.5.5"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.5.5.tgz#b7089ca4410374c75150baf277353ef76db69f96"
integrity sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==
protobufjs@^7.2.5:
version "7.5.6"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.5.6.tgz#11af832ebc4b4326f658a5b1308e6141eb57edfd"
integrity sha512-M71sTMB146U3u0di3yup8iM+zv8yPRNQVr1KK4tyBitl3qFvEGucq/rGDRShD2rsJhtN02RJaJ7j5X5hmy8SJg==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.4"
"@protobufjs/codegen" "^2.0.5"
"@protobufjs/eventemitter" "^1.1.0"
"@protobufjs/fetch" "^1.1.0"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/inquire" "^1.1.1"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@protobufjs/utf8" "^1.1.1"
"@types/node" ">=13.7.0"
long "^5.0.0"

Expand Down
2 changes: 1 addition & 1 deletion examples/large-documents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"typescript": "^4.0.2"
},
"dependencies": {
"@ironcorelabs/tenant-security-nodejs": "^2.0.2",
"@ironcorelabs/tenant-security-nodejs": "^4.1.2",
"@types/node": "^14.6.0"
},
"scripts": {
Expand Down
16 changes: 11 additions & 5 deletions examples/large-documents/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ performance.mark("encryptAllSubdocsS");
const writeP = client.encryptDocument(docToEncrypt, metadata).then((encryptResult) => {
performance.mark("encryptAllSubdocsE");
// write the encrypted subdocs and the encrypted key to the filesystem
fs.rmdirSync(subfolder, {recursive: true});
try {
fs.rmSync(subfolder, {recursive: true});
// eslint-disable-next-line no-empty
} catch (_) {}
fs.mkdirSync(subfolder);
Object.entries(encryptResult.encryptedDocument).forEach(([subDocId, encDocBuffer]) => fs.writeFileSync(`${subfolder}/${subDocId}.enc`, encDocBuffer));
fs.writeFileSync(`${subfolder}/${filename}.edek`, encryptResult.edek);
Expand Down Expand Up @@ -181,7 +184,10 @@ finishAllP

// Helper to map over an object, types are whack here, don't use in prod
const objectMap = <T1, T2>(obj: Record<string, T1>, f: (v: T1) => T2): Record<string, T2> =>
Object.keys(obj).reduce((result, key) => {
result[key] = f(obj[key]);
return result;
}, {} as Record<string, T2>);
Object.keys(obj).reduce(
(result, key) => {
result[key] = f(obj[key]);
return result;
},
{} as Record<string, T2>
);
Loading
Loading