MCPcopy Create free account
hub / github.com/aws/aws-cli / resolve_response_checksum_algorithms

Function resolve_response_checksum_algorithms

awscli/botocore/httpchecksum.py:499–520  ·  view source on GitHub ↗
(
    request, operation_model, params, supported_algorithms=None
)

Source from the content-addressed store, hash-verified

497
498
499def resolve_response_checksum_algorithms(
500 request, operation_model, params, supported_algorithms=None
501):
502 http_checksum = operation_model.http_checksum
503 mode_member = http_checksum.get("requestValidationModeMember")
504 if mode_member and mode_member in params:
505 if supported_algorithms is None:
506 supported_algorithms = _SUPPORTED_CHECKSUM_ALGORITHMS
507 response_algorithms = set(
508 a.lower() for a in http_checksum.get("responseAlgorithms", [])
509 )
510
511 usable_algorithms = []
512 for algorithm in _ALGORITHMS_PRIORITY_LIST:
513 if algorithm not in response_algorithms:
514 continue
515 if algorithm in supported_algorithms:
516 usable_algorithms.append(algorithm)
517
518 checksum_context = request["context"].get("checksum", {})
519 checksum_context["response_algorithms"] = usable_algorithms
520 request["context"]["checksum"] = checksum_context
521
522
523def handle_checksum_body(http_response, response, context, operation_model):

Calls

no outgoing calls