Enforce dynamodb key size limit [solves #3866] (#3888)

* add tests for dynamodb max key size

correct too-large error for ddb key

* remove unnecessary requires_boto_gte decorator from ddb tests

* remove literal emoji from ddb test

* implement dynamodb key limits, WIP

* correct direction of dynamodb range key length check

* fix tests for dynamodb max key size check

* catch ddb validation errors and rethrow properly

* finish ddb key size limit fixes

* fix linting

* handle unicode in v2.7 tests

* fix encoding issue in py2.7 for ddb

* linting

* Python2/3 compatability

Co-authored-by: Bert Blommers <info@bertblommers.nl>
This commit is contained in:
Matthew Davis 2021-04-30 22:47:47 +10:00 committed by GitHub
commit d6384fcb35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 359 additions and 28 deletions

View file

@ -230,7 +230,7 @@ def unix_time_millis(dt=None):
def gen_amz_crc32(response, headerdict=None):
if not isinstance(response, bytes):
response = response.encode()
response = response.encode("utf-8")
crc = binascii.crc32(response)
if six.PY2: