parent
0211e9d78d
commit
c9dd9cc7f9
8 changed files with 120 additions and 13 deletions
|
|
@ -34,6 +34,13 @@ UNSIGNED_REQUESTS = {
|
|||
}
|
||||
UNSIGNED_ACTIONS = {"AssumeRoleWithSAML": ("sts", "us-east-1")}
|
||||
|
||||
# Some services have v4 signing names that differ from the backend service name/id.
|
||||
SIGNING_ALIASES = {
|
||||
"eventbridge": "events",
|
||||
"execute-api": "iot",
|
||||
"iotdata": "data.iot",
|
||||
}
|
||||
|
||||
|
||||
class DomainDispatcherApplication(object):
|
||||
"""
|
||||
|
|
@ -74,6 +81,7 @@ class DomainDispatcherApplication(object):
|
|||
try:
|
||||
credential_scope = auth.split(",")[0].split()[1]
|
||||
_, _, region, service, _ = credential_scope.split("/")
|
||||
service = SIGNING_ALIASES.get(service.lower(), service)
|
||||
except ValueError:
|
||||
# Signature format does not match, this is exceptional and we can't
|
||||
# infer a service-region. A reduced set of services still use
|
||||
|
|
@ -94,11 +102,6 @@ class DomainDispatcherApplication(object):
|
|||
# S3 is the last resort when the target is also unknown
|
||||
service, region = DEFAULT_SERVICE_REGION
|
||||
|
||||
if service == "EventBridge":
|
||||
# Go SDK uses 'EventBridge' in the SigV4 request instead of 'events'
|
||||
# see https://github.com/spulec/moto/issues/3494
|
||||
service = "events"
|
||||
|
||||
if service == "dynamodb":
|
||||
if environ["HTTP_X_AMZ_TARGET"].startswith("DynamoDBStreams"):
|
||||
host = "dynamodbstreams"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue