Skip to content

Commit

Permalink
DF-20252 s3-csv-reader removing verbose error messages (#3340)
Browse files Browse the repository at this point in the history
* DF-20252 s3-csv-reader removing verbose error messages

* bucket & keyPrefix input sanitisation + tests

* update dependencies

* add changeset
  • Loading branch information
mmcallister-cll authored Jul 11, 2024
1 parent 9f98cbf commit 33bd0a4
Show file tree
Hide file tree
Showing 29 changed files with 533 additions and 69 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-dogs-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/s3-csv-reader-adapter': minor
---

security mitigations
171 changes: 160 additions & 11 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 9 additions & 9 deletions packages/sources/s3-csv-reader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ There are no rate limits for this adapter.

### Input Params

| Required? | Name | Aliases | Description | Type | Options | Default | Depends On | Not Valid With |
| :-------: | :-----------: | :----------: | :---------------------------------------------------------------------------------------------------------------: | :----: | :-----: | :-----: | :--------: | :------------: |
|| bucket | | The S3 bucket to query | string | | | | |
|| keyPrefix | `pathPrefix` | The path prefix of the file stored in S3. <Date.csv> is appended to search for older files. | string | | | | |
|| headerRow | | The 1-indexed row of the CSV file that contains the column headers | number | | | | |
|| matcherColumn | | The column field to compare with the matcherValue | string | | | | |
|| matcherValue | | The value to match with matcherField | string | | | | |
|| resultColumn | | The column of the CSV file to return a result for, where the row value for matcherColumn is equal to matcherValue | string | | | | |
| Required? | Name | Aliases | Description | Type | Options | Default | Depends On | Not Valid With |
| :-------: | :-----------: | :----------: | :--------------------------------------------------------------------------------------------------------------------------------------: | :----: | :-----: | :-----: | :--------: | :------------: |
|| bucket | | The S3 bucket to query | string | | | | |
|| keyPrefix | `pathPrefix` | The path prefix of the file stored in S3. Will be prefixed onto <DATE>.csv to search for older files, e.g. 'path/prefix-01-02-2024.csv'. | string | | | | |
|| headerRow | | The 1-indexed row of the CSV file that contains the column headers | number | | | | |
|| matcherColumn | | The column field to compare with the matcherValue | string | | | | |
|| matcherValue | | The value to match with matcherField | string | | | | |
|| resultColumn | | The column of the CSV file to return a result for, where the row value for matcherColumn is equal to matcherValue | string | | | | |

### Example

Expand All @@ -48,7 +48,7 @@ Request:
{
"data": {
"endpoint": "csv",
"bucket": "s3_bucket",
"bucket": "s3-bucket",
"keyPrefix": "path/to/file",
"headerRow": 2,
"matcherColumn": "matcherColumn",
Expand Down
8 changes: 4 additions & 4 deletions packages/sources/s3-csv-reader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
"start": "yarn server:dist"
},
"devDependencies": {
"@types/jest": "27.5.2",
"@types/node": "16.11.68",
"@types/jest": "29.5.12",
"@types/node": "20.14.10",
"nock": "13.5.4",
"typescript": "5.0.4"
"typescript": "5.5.3"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.600.0",
"@chainlink/external-adapter-framework": "1.1.0",
"csv-parse": "5.5.6",
"date-fns": "3.6.0",
"tslib": "2.4.1"
"tslib": "2.6.3"
}
}
Loading

0 comments on commit 33bd0a4

Please sign in to comment.