moto/moto/ssm
Jordan Reiter 126f5a5155
Implement Filter: Contains functionality for describe_params (#3189)
* Implement Filter: Contains functionality for describe_params

This commit adds the Contains functionality. Tests were created
to mimic behavior in AWS/boto3, including that filters with values
in the form of `/name` will match parameters named `/name/match` but
not parameters named `match/with/other-name`. In the test example, a
Contains filter with the value `/tan` would match: `/tangent-3` and
`tangram-4` but not `standby-5`.

* Enforce parameter filter restrictions on get_parameters_by_path

According to the boto3 documentation [1], `Name`, `Path`, and `Tier` are not
allowed values for `Key` in a parameter filter for `get_parameters_by_path`.

This commit enforces this by calling `_validate_parameter_filters` from the
`get_parameters_by_path` method, and adding a check to `_validate_parameter_filters`.

I added 3 test cases to `test_get_parameters_by_path` which check for the correct
exception when calling with a parameter filter using any of these keys.

* Code formatted to match style

* Refactored logic
2020-07-28 10:17:35 +01:00
..
__init__.py Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
exceptions.py black linting 2020-06-30 12:43:42 -04:00
models.py Implement Filter: Contains functionality for describe_params (#3189) 2020-07-28 10:17:35 +01:00
responses.py black linting 2020-06-30 12:43:42 -04:00
urls.py Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
utils.py Use account id constant 2019-12-14 15:51:42 -05:00