codeigniter4 / codeigniter4/shield

Dev: Add IP Restriction for Access Token and HMAC in Shield

Đang mở
#1,255 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
dev enhancement
Ngôn ngữ chính
PHP
Star
427
Fork
144
Merge trung bình
9 giờ 19 phút
Pull request đã merge (30 ngày)
6

Mô tả

**Why?**

If a token or HMAC key is leaked, it can only be used from specified IP addresses(Enhanced Security).
Requests from unknown IPs will be rejected(Prevents Unauthorized Access).
Many financial and payment services use this method(Industry Standard for Sensitive APIs).

**Demo:**

![Image](https://github.com/user-attachments/assets/42926823-cf31-4941-844a-e756d1c92a49)

1. Store `allowed_ips` in the **extra** field (as JSON) or add a dedicated `allowed_ips` column to **auth_identities**
2. Store allowed IPs when generating a token
3. Validate IP when using a token
4. Allow enabling/disabling this feature in **Config/AuthToken.php**
5. Support for multi IPs

**If you disagree or have suggestions for improvement, feel free to comment.**

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

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

Hướng nghiên cứu

Start in Config/AuthToken.php and trace the auth_identities, token-generation, and token-validation paths described in the issue. Compare storing allowed_ips in extra with adding a dedicated column, then define how configuration and multiple IPs should work. Done means configured IP restrictions are saved with tokens, enforced during use, and can be enabled or disabled.

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

Đánh giá

Công nghệ
php
Lĩnh vực
authentication, authorization, security
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.