-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(lambda-python): remove Pillow dependency (#18722)
`Pillow` is an image processing library that we don't need at all, but our tests use. It has a high priority CVE reported against it. Since we don't actually need it, away it goes. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
12 changed files
with
7 additions
and
128 deletions.
There are no files selected for viewing
3 changes: 0 additions & 3 deletions
3
packages/@aws-cdk/aws-lambda-python/test/lambda-handler-custom-build/index.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import requests | ||
from PIL import Image | ||
|
||
def handler(event, context): | ||
response = requests.get('https://a0.awsstatic.com/main/images/logos/aws_smile-header-desktop-en-white_59x35.png', stream=True) | ||
img = Image.open(response.raw) | ||
|
||
print(response.status_code) | ||
print(img.size) | ||
|
||
return response.status_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,3 @@ verify_ssl = true | |
|
||
[packages] | ||
requests = "==2.26.0" | ||
Pillow = "==8.4.0" |
61 changes: 7 additions & 54 deletions
61
packages/@aws-cdk/aws-lambda-python/test/lambda-handler-pipenv/Pipfile.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
packages/@aws-cdk/aws-lambda-python/test/lambda-handler-pipenv/index.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import requests | ||
from PIL import Image | ||
|
||
def handler(event, context): | ||
response = requests.get('https://a0.awsstatic.com/main/images/logos/aws_smile-header-desktop-en-white_59x35.png', stream=True) | ||
img = Image.open(response.raw) | ||
|
||
print(response.status_code) | ||
print(img.size) | ||
|
||
return response.status_code |
3 changes: 0 additions & 3 deletions
3
packages/@aws-cdk/aws-lambda-python/test/lambda-handler-poetry/index.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import requests | ||
from PIL import Image | ||
|
||
def handler(event, context): | ||
response = requests.get('https://a0.awsstatic.com/main/images/logos/aws_smile-header-desktop-en-white_59x35.png', stream=True) | ||
img = Image.open(response.raw) | ||
|
||
print(response.status_code) | ||
print(img.size) | ||
|
||
return response.status_code |
51 changes: 0 additions & 51 deletions
51
packages/@aws-cdk/aws-lambda-python/test/lambda-handler-poetry/poetry.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
packages/@aws-cdk/aws-lambda-python/test/lambda-handler-project/lambda/index.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
import requests | ||
from PIL import Image | ||
import shared | ||
|
||
def handler(event, context): | ||
response = requests.get(shared.get_url(), stream=True) | ||
img = Image.open(response.raw) | ||
|
||
print(response.status_code) | ||
print(img.size) | ||
|
||
return response.status_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,3 @@ chardet==3.0.4 | |
idna==2.10 | ||
urllib3==1.26.7 | ||
# Requests used by this lambda | ||
requests==2.26.0 | ||
Pillow==8.4.0 |
3 changes: 0 additions & 3 deletions
3
packages/@aws-cdk/aws-lambda-python/test/lambda-handler/index.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import requests | ||
from PIL import Image | ||
|
||
def handler(event, context): | ||
response = requests.get('https://a0.awsstatic.com/main/images/logos/aws_smile-header-desktop-en-white_59x35.png', stream=True) | ||
img = Image.open(response.raw) | ||
|
||
print(response.status_code) | ||
print(img.size) | ||
|
||
return response.status_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters