-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix regex URLs so that a dot is actually interpreted as a dot (#4110)
- Loading branch information
Showing
36 changed files
with
81 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import AWSCertificateManagerResponse | ||
|
||
url_bases = ["https?://acm.(.+).amazonaws.com"] | ||
url_bases = ["https?://acm\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": AWSCertificateManagerResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import AthenaResponse | ||
|
||
url_bases = ["https?://athena.(.+).amazonaws.com"] | ||
url_bases = ["https?://athena\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": AthenaResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import AutoScalingResponse | ||
|
||
url_bases = ["https?://autoscaling.(.+).amazonaws.com"] | ||
url_bases = [r"https?://autoscaling\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": AutoScalingResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import CloudFormationResponse | ||
|
||
url_bases = ["https?://cloudformation.(.+).amazonaws.com"] | ||
url_bases = [r"https?://cloudformation\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": CloudFormationResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import CodeCommitResponse | ||
|
||
url_bases = ["https?://codecommit.(.+).amazonaws.com"] | ||
url_bases = [r"https?://codecommit\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": CodeCommitResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import CodePipelineResponse | ||
|
||
url_bases = ["https?://codepipeline.(.+).amazonaws.com"] | ||
url_bases = [r"https?://codepipeline\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": CodePipelineResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import ConfigResponse | ||
|
||
url_bases = ["https?://config.(.+).amazonaws.com"] | ||
url_bases = [r"https?://config\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": ConfigResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import DataPipelineResponse | ||
|
||
url_bases = ["https?://datapipeline.(.+).amazonaws.com"] | ||
url_bases = [r"https?://datapipeline\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": DataPipelineResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import DynamoHandler | ||
|
||
url_bases = ["https?://dynamodb.(.+).amazonaws.com"] | ||
url_bases = [r"https?://dynamodb\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/": DynamoHandler.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import DynamoHandler | ||
|
||
url_bases = ["https?://dynamodb.(.+).amazonaws.com"] | ||
url_bases = [r"https?://dynamodb\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/": DynamoHandler.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
from __future__ import unicode_literals | ||
from .responses import ECRResponse | ||
|
||
url_bases = ["https?://ecr.(.+).amazonaws.com", "https?://api.ecr.(.+).amazonaws.com"] | ||
url_bases = [ | ||
r"https?://ecr\.(.+)\.amazonaws\.com", | ||
r"https?://api\.ecr\.(.+)\.amazonaws\.com", | ||
] | ||
|
||
url_paths = {"{0}/$": ECRResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import EC2ContainerServiceResponse | ||
|
||
url_bases = ["https?://ecs.(.+).amazonaws.com"] | ||
url_bases = [r"https?://ecs\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": EC2ContainerServiceResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import IamResponse | ||
|
||
url_bases = ["https?://iam(.*).amazonaws.com"] | ||
url_bases = [r"https?://iam\.(.*\.)?amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": IamResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import KmsResponse | ||
|
||
url_bases = ["https?://kms.(.+).amazonaws.com"] | ||
url_bases = [r"https?://kms\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": KmsResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from .responses import LogsResponse | ||
|
||
url_bases = ["https?://logs.(.+).amazonaws.com"] | ||
url_bases = [r"https?://logs\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": LogsResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import OrganizationsResponse | ||
|
||
url_bases = ["https?://organizations.(.+).amazonaws.com"] | ||
url_bases = [r"https?://organizations\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": OrganizationsResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import RDS2Response | ||
|
||
url_bases = ["https?://rds.(.+).amazonaws.com", "https?://rds.amazonaws.com"] | ||
url_bases = [r"https?://rds\.(.+)\.amazonaws\.com", r"https?://rds\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": RDS2Response.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import RedshiftResponse | ||
|
||
url_bases = ["https?://redshift.(.+).amazonaws.com"] | ||
url_bases = [r"https?://redshift\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": RedshiftResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import SecretsManagerResponse | ||
|
||
url_bases = ["https?://secretsmanager.(.+).amazonaws.com"] | ||
url_bases = [r"https?://secretsmanager\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": SecretsManagerResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
from __future__ import unicode_literals | ||
from .responses import EmailResponse | ||
|
||
url_bases = ["https?://email.(.+).amazonaws.com", "https?://ses.(.+).amazonaws.com"] | ||
url_bases = [ | ||
r"https?://email\.(.+)\.amazonaws\.com", | ||
r"https?://ses\.(.+)\.amazonaws\.com", | ||
] | ||
|
||
url_paths = {"{0}/$": EmailResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import SNSResponse | ||
|
||
url_bases = ["https?://sns.(.+).amazonaws.com"] | ||
url_bases = [r"https?://sns\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": SNSResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
from __future__ import unicode_literals | ||
from .responses import SimpleSystemManagerResponse | ||
|
||
url_bases = ["https?://ssm.(.+).amazonaws.com", "https?://ssm.(.+).amazonaws.com.cn"] | ||
url_bases = [ | ||
r"https?://ssm\.(.+)\.amazonaws\.com", | ||
r"https?://ssm\.(.+)\.amazonaws\.com\.cn", | ||
] | ||
|
||
url_paths = {"{0}/$": SimpleSystemManagerResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from __future__ import unicode_literals | ||
from .responses import TokenResponse | ||
|
||
url_bases = ["https?://sts(.*).amazonaws.com(|.cn)"] | ||
url_bases = [r"https?://sts\.(.*\.)?amazonaws\.com(|.cn)"] | ||
|
||
url_paths = {"{0}/$": TokenResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from .responses import SWFResponse | ||
|
||
url_bases = ["https?://swf.(.+).amazonaws.com"] | ||
url_bases = [r"https?://swf\.(.+)\.amazonaws\.com"] | ||
|
||
url_paths = {"{0}/$": SWFResponse.dispatch} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import boto3 | ||
import moto | ||
import pytest | ||
from moto import mock_s3 | ||
|
||
|
||
service_names = [ | ||
(d[5:], "") | ||
for d in dir(moto) | ||
if d.startswith("mock_") | ||
and not d.endswith("_deprecated") | ||
and not d == "mock_xray_client" | ||
and not d == "mock_all" | ||
] | ||
|
||
|
||
class TestMockBucketStartingWithServiceName: | ||
""" | ||
https://github.com/spulec/moto/issues/4099 | ||
""" | ||
|
||
@pytest.mark.parametrize( | ||
"service_name,decorator", service_names, | ||
) | ||
def test_bucketname_starting_with_service_name(self, service_name, decorator): | ||
|
||
decorator = getattr(moto, "mock_{}".format(service_name)) | ||
with decorator(): | ||
with mock_s3(): | ||
s3_client = boto3.client("s3", "eu-west-1") | ||
bucket_name = "{}-bucket".format(service_name) | ||
s3_client.create_bucket( | ||
ACL="private", | ||
Bucket=bucket_name, | ||
CreateBucketConfiguration={"LocationConstraint": "eu-west-1"}, | ||
) |