Skip to content

Commit fe60fbe

Browse files
committed
add path type validation in consumeProtectedData
1 parent 0d77e4f commit fe60fbe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
77
### Changed
88

99
- Add optional `path` param in `processProtectedData`
10+
- Add `path` validation in `consumeProtectedData`
1011

1112
## [2.0.0-beta.11] (2025-01-29)
1213

packages/sdk/src/lib/dataProtectorSharing/consumeProtectedData.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
throwIfMissing,
1818
validateOnStatusUpdateCallback,
1919
positiveNumberSchema,
20+
stringSchema,
2021
} from '../../utils/validators.js';
2122
import {
2223
ConsumeProtectedDataParams,
@@ -56,6 +57,7 @@ export const consumeProtectedData = async ({
5657
const vMaxPrice = positiveNumberSchema()
5758
.label('maxPrice')
5859
.validateSync(maxPrice);
60+
const vPath = string().label('path').validateSync(path);
5961
let vApp = addressOrEnsSchema().required().label('app').validateSync(app);
6062
let vWorkerpool = addressOrEnsSchema()
6163
.label('workerpool')
@@ -215,7 +217,7 @@ export const consumeProtectedData = async ({
215217
const { result } = await getResultFromCompletedTask({
216218
iexec,
217219
taskId,
218-
path,
220+
path: vPath,
219221
pemPrivateKey: privateKey,
220222
onStatusUpdate: vOnStatusUpdate,
221223
});

0 commit comments

Comments
 (0)