Add webhook verification tests for edge cases

Đang mở Phù hợp với người mới
#5 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
testing

Hướng nghiên cứu

Đọc apidly/webhook.py và các bài kiểm thử webhook hiện có trong tests/test_sdk.py, sau đó thêm các trường hợp riêng vào tests/test_webhook.py. Bao phủ mọi trường hợp biên được liệt kê và xác nhận kết quả là False hoặc ngoại lệ đã được tài liệu hóa mà không gây lỗi; chạy python -m pytest -q để xác nhận bộ kiểm thử chạy thành công khi ngoại tuyến.

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

Mô tả

good first issue help wanted tests

Context

apidly/webhook.py has verify_webhook, verify_standard_webhook and verify_webhook_request. They are used in tests/test_sdk.py, but a dedicated, easy-to-read file for the edge cases would help the next person who touches signing.

Acceptance criteria

  • tests/test_webhook.py with cases for: a timestamp outside the tolerance, a tampered body, a wrong secret, headers in different letter case, several signatures in one header, a missing header, and a body passed as bytes and as str.
  • Each case asserts False (or the documented exception), never a crash.
  • python -m pytest -q passes; no network.

Pointers

  • apidly/webhook.py, tests/test_sdk.py (existing webhook tests), examples/04_webhook_receiver.py

Not sure where to start, or want to claim it? Comment here first, or ask in Discussions. See CONTRIBUTING.md. Tests run offline and never call the real API.

Ngôn ngữ chính
Python
Star
1
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

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 apidly-ltd/apidly-python

Tất cả issue của apidly-ltd/apidly-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.