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

Add ACL Support

Đang mở
#52 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
42/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api, backend, testing

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 ACL resource wrapper
  • lookup(ip) accepts str, IPv4Address, or IPv6Address and returns Optional[dict]
  • Parse JSON body response from WIT layer when IP matches ACL entry
  • Return None when 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

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 fastly/compute-sdk-python

Tất cả issue của fastly/compute-sdk-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.