Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

fix(json): absent attributes are dropped, so "every element has X" is vacuously true

Đang mở Phù hợp với người mới
#294 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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
78/100
Loại issue
Lỗi
Độ 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
security

Hướng nghiên cứu

Bắt đầu với entry point get_value của JSON provider và providers/common.get_path_value_from_input, theo dõi cách truyền flag place_none_if_not_found. Thêm fixture cho thuộc tính không tồn tại và xác minh rằng nó thất bại khi flag được bật, trong khi fixture cho thuộc tính hiện diện và phù hợp vẫn pass.

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

Mô tả

bug

The json provider calls providers/common.get_path_value_from_input with the default
place_none_if_not_found=False: elements lacking the path are dropped rather than padded, so a
document that omits the attribute entirely — the classic violation, e.g. a VM with no
linuxConfiguration block — reports null instead of failing. Any wildcard-path policy can catch
an explicitly wrong value but never an absent one.

Fix. Expose the flag on get_value (default keeps today's behaviour). The same code path is
needed by "type-scoped member reads on the json provider" (R2).

Acceptance. A fixture with the attribute absent fails when the flag is set; a fixture with the
attribute present and compliant still passes.

Ngôn ngữ chính
Python
Star
167
Fork
47
Merge trung bình
2 giờ 44 phút
Pull request đã merge (30 ngày)
5

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 StackGuardian/tirith

Tất cả issue của StackGuardian/tirith

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.