hurl/integration/tests_ok/aws_sigv4.py

14 lines
393 B
Python
Raw Normal View History

from flask import request
from app import app
import re
2023-08-13 14:24:50 +03:00
@app.route("/aws-sigv4", methods=["POST"])
def aws_sigv4():
2023-08-13 14:24:50 +03:00
auth = request.headers.get("Authorization")
assert re.match(
r"^AWS4-HMAC-SHA256 Credential=someAccessKeyId/\d+/eu-central-1/hurltest/aws4_request, SignedHeaders=\S+, Signature=[a-f0-9]+$",
auth,
)
return "Received SigV4 Authorization header"