codeigniter4 / codeigniter4/shield

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

オープン
#1,255 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
dev enhancement
主要言語
PHP
スター
427
フォーク
144
平均マージ
9時間 19分
マージ済み PR(30日)
6

説明

**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.**

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。