Commit Graph

5563 Commits

Author SHA1 Message Date
Bert Blommers
ee0f676a03
Merge pull request #2913 from thatguysimon/patch-1
Mark sts > get_caller_identity() as implemented
2020-04-21 16:04:01 +01:00
thatguysimon
12669400b7
Mark sts>get_caller_identity as implemented
Seems like it's implemented but not marked
2020-04-21 16:53:22 +03:00
Bert Blommers
12ac1cbae2
Merge pull request #2911 from cm-iwata/fix_2910_list_thing_principal
Added existence check of target thing to IoT ListThingPrincipals
2020-04-21 07:47:12 +01:00
Bert Blommers
6de239d6e4
Merge pull request #2885 from pvbouwel/ddb_full_parsing
DDB structured parsing
2020-04-21 07:41:20 +01:00
Tomoya Iwata
d9b782be0a fix lint 2020-04-21 14:43:04 +09:00
Tomoya Iwata
b6789a2cc7 Added existence check of target thing to IoT ListThingPrincipals
fix #2910
2020-04-21 14:11:53 +09:00
Dmitry Ryzhikov
1a3a7d6a92 Add test for missing table name 2020-04-20 20:23:37 +03:00
Bert Blommers
1017e040b3
Merge pull request #2904 from rwhogg/elb-iso8601
Use ISO 8601 format for ELB DescribeLoadBalancers
2020-04-20 16:09:48 +01:00
Bert Blommers
0b6b0ce9fe
Merge pull request #2907 from michael-k/classifiers
Add Python 3.8 to trove classifiers
2020-04-20 16:02:59 +01:00
Bert Blommers
9e514672dd
Merge pull request #2906 from asherf/warns
Fix deprecation warnings.
2020-04-20 12:19:58 +01:00
Michael Käufl
ad0805de0e
Add Python 3.8 to trove classifiers 2020-04-20 09:19:24 +02:00
Asher Foa
0d04306861 Fix deprecation warning. 2020-04-19 19:12:48 -07:00
Dmitry Ryzhikov
ed5e0b586c Handle ValueError raised on missing table name 2020-04-20 00:15:00 +03:00
pvbouwel
3a774ed0e0 Make sure reserved_keywords.txt is packaged with the library. 2020-04-19 17:55:00 +01:00
pvbouwel
e6b51a28ee Enable AST Validation
This commit puts AST validation on the execution path. This means updates get
validated prior to being executed. There were quite a few tests that were not
working against Amazon DDB. These tests I considered broken and as such this
commit adapts them such that they pass against Amazon DDB.

test_update_item_on_map()
=> One of the SET actions would try to set a nested element by specifying the nesting on the path
   rather than by putting a map as a value for a non-existent key. This got changed.

test_item_size_is_under_400KB
=> Used the keyword "item" which DDB doesn't like. Change to cont in order to keep the same sizings.
=> Secondly the size error messages differs a bit depending whether it is part of the update or part
   of a put_item. For an update it should be:
   Item size to update has exceeded the maximum allowed size
   otherwise it is
   Item size has exceeded the maximum allowed size'

test_remove_top_level_attribute
=> Used a keyword item.  Use ExpressionAttributeNames

test_update_item_double_nested_remove
=> Used keywords name & first. Migrated to non-deprecated API and use ExpressionAttributeNames

test_update_item_set &
test_boto3_update_item_conditions_pass &
test_boto3_update_item_conditions_pass_because_expect_not_exists &
test_boto3_update_item_conditions_pass_because_expect_not_exists_by_compare_to_null &
test_boto3_update_item_conditions_pass_because_expect_exists_by_compare_to_not_null &
test_boto3_update_item_conditions_fail &
test_boto3_update_item_conditions_fail_because_expect_not_exists &
test_boto3_update_item_conditions_fail_because_expect_not_exists_by_compare_to_null
=> Were broken tests which had string literal instead of value placeholder
2020-04-19 16:58:46 +01:00
pvbouwel
fc4d88401d Improve DDB expressions support3: AST Validation
Part of structured approach for UpdateExpressions:
 1) Expression gets parsed into a tokenlist (tokenized)
 2) Tokenlist get transformed to expression tree (AST)
 3) The AST gets validated (full semantic correctness) -> this commit
 4) AST gets processed to perform the update

This commit uses the AST to perform validation.  Validation makes sure the
nodes encounterd have valid values and they will also resolve values for
references that refer to item state or values passed into the expression.
2020-04-19 16:58:07 +01:00
Bob Wombat Hogg
891801d569 Use ISO 8601 format for ELB DescribeLoadBalancers 2020-04-18 07:46:28 -04:00
pvbouwel
9ed613e197 Better DDB expressions support2: ExpressionTree
Part of structured approach for UpdateExpressions:
 1) Expression gets parsed into a tokenlist (tokenized)
 2) Tokenlist get transformed to expression tree (AST) -> This commit
 3) The AST gets validated (full semantic correctness)
 4) AST gets processed to perform the update

This commit uses the tokenlist to build an expression tree. This tree is not
yet used. Still it allows to raise additional Validation Exceptions which
previously were missed silently therefore it allows tests to catch these type of
ValidationException. For that reason DDB UpdateExpressions will be parsed
already. It also makes sure we won't break existing tests.

One of the existing tests had to be changed in order to still pass:
 - test_dynamodb_table_with_range_key.test_update_item_with_expression

This test passed in a numeric literal which is not supported by DynamoDB
and with the current tokenization it would get the same error as in AWS
DynamoDB.
2020-04-18 09:19:03 +01:00
pvbouwel
7ea419dd54 Better DDB expressions support1: TokenizationDDB
Currently the mock for DynamoDB has adhoc code to implement
its updateExpression functionality.  This series will
transform the logic such that Update Expressions are processed
as follows:
 1) Expression gets parsed into a tokenlist (tokenized) -> This commit
 2) Tokenlist get transformed to expression tree (AST)
 3) The AST gets validated (full semantic correctness)
 4) AST gets processed to perform the update

This alows for a more realistic mocking. It will throw exceptions much
more aggressively avoiding situations where a test passes against the
mock but fails with an exception when running against AWS.

Introduction of step 3 also allows to have the update expression as an
atomic unit of work. So updates at the start of the expression cannot
be performed if there is an error further down the expression.

This specific commit will tokenize expressions but the tokenlist is not
yet used. It is purely to keep clear boundaries.  It does do a minor
refactoring of the exceptions to allow more re-use and to ease testing.

This series of changes is to aid providing a long-term solution for
https://github.com/spulec/moto/issues/2806.
2020-04-18 09:16:23 +01:00
Bert Blommers
4f59a3584b
Merge pull request #2901 from kislyuk/patch-1
awslambda: Do not assume X-Amz-Invocation-Type is set
2020-04-17 09:39:33 +01:00
Andrey Kislyuk
76a249c0ec
awslambda: Do not assume X-Amz-Invocation-Type is set 2020-04-16 21:28:27 -07:00
Mike Grima
bdeeeb701a
Merge pull request #2880 from bblommers/bugfix/2877
EC2 - Ensure NCI always has a Subnet
2020-04-16 15:02:45 -07:00
Steve Pulec
da14f692a5
Merge pull request #2900 from spulec/bugfix/rds2-multi-az-stop-db-instance
Bugfix: Allow stop_db_instance for compatible engines (refs #2006)
2020-04-16 16:25:09 -05:00
Hugo Lopes Tavares
4dc46a697d Bugfix: Allow stop_db_instance for compatible engines
From the RDS documentation:
    You can stop and start a DB instance whether it is configured for a single Availability Zone or for Multi-AZ, for database engines that support Multi-AZ deployments. You can't stop an Amazon RDS for SQL Server DB instance in a Multi-AZ configuration.

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_StopInstance.html#USER_StopInstance.Limitations
2020-04-16 15:14:37 -04:00
Erik Hovland
88494c58f9 Add a test for assume_role_with_saml.
Add a test with SAML assertion to test the assume_role_with_saml method
in the STSBackend.
2020-04-16 11:47:30 -07:00
Erik Hovland
b10718eea7 Add AssumeRoleWithSAML response to responses.py.
Add the AssumeRoleWithSAML response to the available STS responses.
2020-04-16 11:47:30 -07:00
Erik Hovland
b7f4ae21d1 Add assume_role_with_saml to STSBackend.
Add the assume_role_with_saml method to the STSBackend class.
2020-04-16 11:47:30 -07:00
Bert Blommers
07c33105e5
Merge pull request #2897 from caphrim007/feature.add-secretsmanager-update-secret
Adds initial support for secretsmanager update_secret
2020-04-16 17:36:12 +01:00
Tim
92bbc3fbac Adds initial support for secretsmanager update_secret
The support in this patch is preliminary and may or may not be feature complete.
It provides the basic support for update_secret so that future work can build
on it as needed.
2020-04-16 08:20:43 -07:00
Bert Blommers
870b34ba76 Spacing 2020-04-16 07:09:50 +01:00
Bert Blommers
47d80621f9 Merge branch 'master' into feature/dynamodb_item_limit 2020-04-16 07:07:59 +01:00
Bert Blommers
adfe08eb29
Merge pull request #38 from spulec/master
Merge upstream
2020-04-16 07:07:25 +01:00
Bert Blommers
92b0586b8b
Merge pull request #2893 from jwfh/instance-types
Update EC2 instance type list
2020-04-16 06:42:58 +01:00
Jacob-House
f04d64d981
Update EC2 instance type list 2020-04-15 18:48:33 -02:30
Bert Blommers
a6902e8713
Update tests/test_dynamodb2/test_dynamodb.py
Co-Authored-By: Guilherme Martins Crocetti <gmcrocetti@gmail.com>
2020-04-15 07:26:09 +01:00
Bert Blommers
532480a3b5
Merge pull request #2888 from usmangani1/lstack#1991
Added implementation for create-model,get-models,get-model in api gat…
2020-04-14 10:34:39 +01:00
Bert Blommers
69f963a3c2 Linting 2020-04-14 08:06:00 +01:00
Bert Blommers
d0c60ecaac
Merge pull request #2891 from DenverJ/enhancement/autoscaling-standby-terminate
Implement enter_standby, exit_standby and terminate_instance_in_auto_scaling_group
2020-04-14 08:01:50 +01:00
Bert Blommers
16aafa3a53
Merge pull request #2889 from pvbouwel/split_models
Allow reuse of DynamoType from models.py
2020-04-14 07:54:58 +01:00
Bert Blommers
c2b4c397f2 DDB test - Fix KeySchema, and set BillingMode for easier online testing 2020-04-14 07:53:15 +01:00
Bert Blommers
8122a40be0
Update moto/dynamodb2/models.py
Co-Authored-By: pvbouwel <petervanbouwel@gmail.com>
2020-04-14 07:48:20 +01:00
Bert Blommers
1e1fe3ee4b
Update moto/dynamodb2/models.py
Co-Authored-By: pvbouwel <petervanbouwel@gmail.com>
2020-04-14 07:48:13 +01:00
Bert Blommers
b63a6f1336
Merge pull request #2884 from usmangani1/2263_Issue
Adding missing Param zoneId in the ec2 describe-availability-zone
2020-04-14 07:12:51 +01:00
DenverJ
d745dfd3d2 Implement enter_standby, exit_standby and terminate_instance_in_auto_scaling_group 2020-04-13 10:54:13 +10:00
pvbouwel
4be97916bf Allow reuse of components packed in models.py
By having models.py as one big file it causes to
easily create circular dependencies. With the current
setup it is not possible to re-use DynamoType. This
refactor moves it out to its own file while trying to
keep the structure as much as it is.
2020-04-12 20:05:35 +01:00
usmankb
1c96a05314 linting 2020-04-12 18:10:23 +05:30
usmankb
79e63e3bcf Added implementation for create-model,get-models,get-model in api gateway 2020-04-12 17:49:22 +05:30
Bert Blommers
755a08e137
Merge pull request #2887 from DenverJ/enhancement/fix-describe-autoscaling-instances-filter
Add instance-id filter to describe_auto_scaling_instances
2020-04-12 11:09:31 +01:00
DenverJ
965046aa39 Fix formatting 2020-04-12 17:08:40 +10:00
DenverJ
593e5dc86a Add instance-id filter to describe_auto_scaling_instances 2020-04-12 13:44:16 +10:00