Commit Graph

5288 Commits

Author SHA1 Message Date
=
ef67aee1a3 apply black formatting 2020-04-24 18:53:24 +02:00
=
6483e3be80 do not require secret to exist on PutSecretValue operation 2020-04-24 18:17:03 +02:00
=
3e145ef8df Do not remove tags after secret update, handle description 2020-04-24 16:12:55 +02:00
Antoine Wendlinger
9ed6e52d0a Handle VersionId in S3:delete_objects
VersionId is not read in delete_objects requests, and the behavior
differs from its singular counterpart delete_object.

This fixes the issue.
2020-04-23 19:01:58 +02:00
Bert Blommers
cd6dbe5b03
Merge pull request #2917 from asherf/warns
Add new AWS Region: af-south-1
2020-04-23 17:05:56 +01:00
Asher Foa
1d31ea6397 add two more zones. 2020-04-23 08:25:14 -07:00
Asher Foa
194de2b6ea Add af-south-1
The new version of botcore adds this region: f7dc4730ad (diff-9dfab05d4ba739e097a193e8b5fa61caR13)
Which in turn, breaks moto:
```
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/__init__.py:3: in <module>
    from .acm import mock_acm  # noqa
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/acm/__init__.py:2: in <module>
    from .models import acm_backends
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/acm/models.py:7: in <module>
    from moto.ec2 import ec2_backends
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/__init__.py:2: in <module>
    from .models import ec2_backends
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:5169: in <module>
    ec2_backends = {
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:5170: in <dictcomp>
    region.name: EC2Backend(region.name) for region in RegionsAndZonesBackend.regions
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:5083: in __init__
    super(EC2Backend, self).__init__()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:852: in __init__
    super(InstanceBackend, self).__init__()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1127: in __init__
    super(TagBackend, self).__init__()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:2368: in __init__
    super(EBSBackend, self).__init__()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1904: in __init__
    super(SecurityGroupBackend, self).__init__()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1355: in __init__
    self._load_amis()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1362: in _load_amis
    self.amis[ami_id] = Ami(self, **ami)
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1313: in __init__
    volume = self.ec2_backend.create_volume(15, region_name)
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:2372: in create_volume
    zone = self.get_zone_by_name(zone_name)
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1713: in get_zone_by_name
    for zone in self.zones[self.region_name]:
E   KeyError: 'af-south-1'
```
2020-04-22 14:41:15 -07:00
Dmitry Ryzhikov
e866df9b9d Merge branch 'master' into fix/table-filter-value-error 2020-04-22 20:08:05 +03:00
Bert Blommers
cca3ea9ddf
Merge pull request #2916 from gtmanfred/master
Make all CallbackResponse requests into a Werkzeug Request
2020-04-22 17:18:48 +01:00
Bert Blommers
037c6e1320
Merge pull request #2914 from MarcosBernal/feature/add-get-databases-method-to-glue
Add get_databases method to glue and update IMPLEMENTATION_COVERAGE.md
2020-04-22 16:37:32 +01:00
Bert Blommers
343b20a5fb
Update CONTRIBUTING to add Linting info 2020-04-22 16:36:41 +01:00
Daniel Wallace
d9e2aeed58
blacken 2020-04-22 10:02:25 -05:00
Marcos Bernal España
4cd2b201b5
Update IMPLEMENTATION_COVERAGE.md
Co-Authored-By: Bert Blommers <bblommers@users.noreply.github.com>
2020-04-22 16:44:25 +02:00
Daniel Wallace
50a147592d
Make all CallbackResponse requests into a Werkzeug Request
The "request" object in CallbackResponse is the PreparedRequest send by
whatever client is used to contact the mocked moto service. This can end
up with unparsed bodies, as we added for processing presigned post
requests in #2155. This will make sure that all of the requests comming
in from mocked functions also get processed by werkzeug as if it was
running a live server.
2020-04-22 09:08:30 -05:00
Bert Blommers
25d1e1059e STS - Only check request-body of eligible requests for Actions 2020-04-22 14:11:13 +01:00
Bert Blommers
92b6268cca
Merge pull request #39 from spulec/master
Merge upstream
2020-04-22 12:51:03 +01:00
Bert Blommers
50111929cc STS - Handle AssumeRoleWithSAML as an unsigned request 2020-04-22 12:18:27 +01:00
Bert Blommers
4575f359c1
Merge pull request #2155 from gtmanfred/master
set default status for s3 posts and add success_action_redirect support
2020-04-22 07:25:15 +01:00
Daniel Wallace
80b27a6b93
blacken 2020-04-21 21:43:32 -05:00
Daniel Wallace
4b0ba73204
use werkzeug
hooray, thanks pallets discord!
2020-04-21 20:13:53 -05:00
Daniel Wallace
49b056563a
process multipart form 2020-04-21 19:52:10 -05:00
Daniel Wallace
b3f6e5ab2f
add test 2020-04-21 18:07:50 -05:00
Daniel Wallace
156ba56fdc
set default status for s3 posts
and add support for success_action_redirect.
2020-04-21 18:06:43 -05:00
MarcosBernal
9381c670ab change code style to pass black --check 2020-04-21 22:34:05 +02:00
MarcosBernal
753a39ed0d Add get_databases method to glue moto client. Update IMPLEMENTATION_COVERAGE.md with methods that were covered previously 2020-04-21 20:10:39 +02:00
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