codeigniter4 / codeigniter4/shield
Dev: Add IP Restriction for Access Token and HMAC in Shield
- 主要语言
- PHP
- 星标
- 427
- 派生
- 144
- 平均合并
- 9 小时 19 分钟
- 30 天内合并 PR
- 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:**

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.**
贡献指南
调研方向
从 Config/AuthToken.php 开始,跟踪 issue 中描述的 auth_identities、令牌生成和令牌验证路径。比较将 allowed_ips 存储在 extra 中与添加专用列,然后确定配置和多个 IP 应如何工作。完成意味着配置的 IP 限制会随令牌一起保存,在使用期间强制执行,并且可以启用或禁用。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- php
- 领域
- authentication, authorization, security
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100