Commit cbebba7
feat: add result encryption to processProtectedData (#522)
* feat: add result encryption types to processProtectedData
- Add encryptResult and pemPrivateKey parameters to ProcessProtectedDataParams
- Add PUSH_ENCRYPTION_KEY status to ProcessProtectedDataStatuses
- Add pemPrivateKey to ProcessProtectedDataResponse and GetResultFromCompletedTaskResponse
* feat: implement result encryption logic in processProtectedData
- Add encryption key management with getFormattedKeyPair integration
- Add validation to require encryptResult when pemPrivateKey is provided
- Add iexec_result_encryption parameter to request order when encryption enabled
- Add status updates for PUSH_ENCRYPTION_KEY with user notifications
- Pass pemPrivateKey to getResultFromCompletedTask for result decryption
- Return pemPrivateKey in response when encryption is enabled
* test: add unit tests for result encryption feature
- Add validation tests for encryptResult and pemPrivateKey parameters
- Test error handling when pemPrivateKey provided without encryptResult
- Test successful validation when both parameters are correctly provided
- Test edge cases for parameter combinations
* fix: return message title and return generated key
Co-authored-by: pjt <[email protected]>
* fix: add GENERATE_ENCRYPTION_KEY step to coreTypes
Co-authored-by: pjt <[email protected]>
* feat: improve encryption key generation status updates
- Add GENERATE_ENCRYPTION_KEY status update before key generation
- Improve message formatting for key generation notification
- Include pemPrivateKey in status update payload for better user feedback
---------
Co-authored-by: pjt <[email protected]>1 parent 62dcd6a commit cbebba7
File tree
3 files changed
+126
-0
lines changed- packages/sdk
- src/lib
- dataProtectorCore
- types
- tests/unit/dataProtectorCore/processProtectedData
3 files changed
+126
-0
lines changedLines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
101 | 117 | | |
102 | 118 | | |
103 | 119 | | |
| |||
263 | 279 | | |
264 | 280 | | |
265 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
266 | 326 | | |
267 | 327 | | |
268 | 328 | | |
| |||
280 | 340 | | |
281 | 341 | | |
282 | 342 | | |
| 343 | + | |
283 | 344 | | |
284 | 345 | | |
285 | 346 | | |
| |||
341 | 402 | | |
342 | 403 | | |
343 | 404 | | |
| 405 | + | |
344 | 406 | | |
345 | 407 | | |
346 | 408 | | |
| |||
349 | 411 | | |
350 | 412 | | |
351 | 413 | | |
| 414 | + | |
352 | 415 | | |
353 | 416 | | |
354 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| |||
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
| 284 | + | |
| 285 | + | |
283 | 286 | | |
284 | 287 | | |
285 | 288 | | |
| |||
355 | 358 | | |
356 | 359 | | |
357 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
358 | 372 | | |
359 | 373 | | |
360 | 374 | | |
| |||
366 | 380 | | |
367 | 381 | | |
368 | 382 | | |
| 383 | + | |
369 | 384 | | |
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
618 | 666 | | |
619 | 667 | | |
0 commit comments