aws-samples / aws-samples/amazon-comprehend-s3-object-lambda-functions

PII redaction fails from AWS CLI

オープン
#2 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
31
フォーク
9
PR マージ指標
30日以内にマージされた PR はありません

説明

The PII redaction succeeds when the S3 get is done from the console, as described in the corresponding tutorial. But from the AWS CLI it fails:

```
aws s3api get-object --bucket arn:aws:s3-object-lambda:us-west-2:012345678901:accesspoint/my-redacted-bucket-name --key pii-lambda-test/tutorial.txt /tmp/baz
```
The error is:
```
botocore.exceptions.ClientError: An error occurred (SignatureDoesNotMatch) when calling the GetObject operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.
```

Debugging the lambda, I can see that the code is not correctly including `x-amz-` headers like `x-amz-checksum-mode` when calling the presigned URL. The issue doesn't happen from the console because it is not calculating a checksum on the payload, but other SDKs do. This is due to a logic error in `S3Client._filter_request_headers()`. I've tested a fix and will submit a PR.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。