Closed dfangl closed 1 month ago
There are some repercussions in 3 other tests, I will verify them and the correct behavior tomorrow.
Attention: Patch coverage is 87.50000%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 94.54%. Comparing base (
d0affa8
) to head (05a82a9
). Report is 1 commits behind head on master.
Files with missing lines | Patch % | Lines |
---|---|---|
moto/iam/models.py | 87.50% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
So, everything seems to be in order, the TypeError which is not covered is required per specification of the default method, but should never be reached in our case.
Motivation
Currently, moto does not urlencode (or quote) IAM policy strings in its return values.
While this seemingly matches the AWS behavior, as described here: https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetRolePolicy.html , more investigation shows AWS actually quoting the IAM policies, as shown in responses (printed by boto3 in debug mode):
While this does not impact many users, the disparity shows when you try to set a field in the IAM policies to a urlencoded value, like necessary for matching the resource for the
apigateway.TagResource
operation: https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonapigatewaymanagement.html#amazonapigatewaymanagement-TagsSince boto3 will unquote the string, it does not matches the input anymore.
Changes