_get_blocked_template() missing 1 required positional argument

Đang mở
#688 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
security

Hướng nghiên cứu

Bắt đầu tại datadog_lambda/asm.py:226 và kiểm tra lời gọi đến http_utils._get_blocked_template cùng với phạm vi phiên bản ddtrace được báo cáo. Tái hiện lỗi thiếu đối số khi ASM được bật, sau đó xác minh rằng đường dẫn phản hồi bị chặn không còn phát sinh TypeError đối với các triển khai container bị ảnh hưởng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Customers encountering the following error

def get_asm_blocked_response(
        event_source: _EventSource,
    ) -> Optional[Dict[str, Any]]:
        """Get the blocked response for the given event source."""
        if event_source.event_type not in _http_event_types:
            return None
        blocked = get_blocked()
        if not blocked:
            return None
        desired_type = blocked.get("type", "auto")
        if desired_type == "none":
            content_type = "text/plain; charset=utf-8"
            content = ""
        else:
            content_type = blocked.get("content-type", "application/json")
            content = http_utils._get_blocked_template(content_type)
E           TypeError: _get_blocked_template() missing 1 required positional argument: 'security_response_id'
datadog_lambda/asm.py:226: TypeError

or similar errors related to the _get_blocked_template function signature should check the version of ddtrace they are using. Customers encountering this error are likely using lambda with containers and/or have overridden the version of ddtrace packaged with the Datadog Python Lambda Layer. If you are using ddtrace v3.19.0 or above and have ASM enabled, please downgrade to a ddtrace version between v3.16.2 and v3.18.1.
Customers not using ddtrace v3.19.0 or above should not be affected by this issue.

Ngôn ngữ chính
Python
Star
102
Fork
52
Merge trung bình
5 ngày 19 giờ
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DataDog/datadog-lambda-python

Tất cả issue của DataDog/datadog-lambda-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.