Add ACL Support
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
- 42/100
Hướng nghiên cứu
Bắt đầu với WIT binding tại stubs/wit_world/imports/acl.py và xem xét giao diện ACL cũng như các yêu cầu API trong issue này. Sử dụng test.toml cùng với data/acl.json và các bài kiểm thử @on_viceroy để xác minh việc mở một ACL, khớp các địa chỉ IPv4 và IPv6, phân tích metadata của entry và trả về None khi không có kết quả khớp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Overview
Add support for Fastly's Access Control Lists (ACLs), providing IP-based blocklists and access control.
WIT Interface
interface acl {
use types.{error, open-error, ip-address};
resource acl {
open: static func(name: string) -> result<acl, open-error>;
lookup: func(ip-addr: ip-address) -> result<option<body>, acl-error>;
}
enum acl-error {
too-many-requests,
generic-error
}
}
WIT bindings: stubs/wit_world/imports/acl.py
API Design
- Implement
ACLresource wrapper lookup(ip)acceptsstr,IPv4Address, orIPv6Addressand returnsOptional[dict]- Parse JSON body response from WIT layer when IP matches ACL entry
- Return
Nonewhen IP not found in ACL (no match)
Cross-SDK Comparison: All SDKs expose open(name) and lookup(ip) returning entry with prefix, action, id fields. Simple consistent API across languages.
Viceroy Testing
Viceroy supports ACL with JSON file-based test data via test.toml:
[local_server]
# Path to JSON file with ACL entries
acls.my_blocklist = "../data/acl.json"
# Or using object syntax
acls.my_allowlist = { file = "../data/allowlist.json" }
ACL JSON file format maps IP addresses to metadata objects. Lookup operations work with test data. Tests can use @on_viceroy with file references in TOML configuration.
Reference
- Ngôn ngữ chính
- Python
- Star
- 5
- Fork
- 1
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fastly/compute-sdk-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
fastly/compute-sdk-python#116 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
fastly/compute-sdk-python#98 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
fastly/compute-sdk-python#74 ·
-
Add HTTP Downstream Metadata API Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
fastly/compute-sdk-python#61 ·
-
fastly/compute-sdk-python#60 · 1 người được giao ·
Tất cả issue của fastly/compute-sdk-python
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100