license-gate
license-gate copied to clipboard
Add IP binding feature to license management
- Introduced
ipBoundEnabledandipfields in the license schema to allow binding a license to the first IP that uses it. - Updated validation logic to handle IP binding and return appropriate error messages for mismatched IPs.
- Enhanced OpenAPI documentation to reflect new fields and validation results.
- Updated frontend components to support the new IP binding feature.
bump
Hey there, sorry for the late reply.
This is a cool idea, but I think having this only work for one IP is a bit limiting. Also, I feel like expanding the current IP limit logic would be cleaner.
I would suggest removing the ip field from the License model and having the ipBoundEnabled be an extension of the current ipLimit setting. If you disable the 12h lookback for the IP count check, then it should have the same effect.
In the editor you could then also just have a checkbox in the IP limit editor that toggles the IP binding (i.e. don't only check back for the past 12h).
The "Clear IP bindings" button would be a bit worse, as it would have to clean the logs, but I think that is a compromise we can make to keep it clean.
Alternative: Rename ip to ipBindings and make it a JSON string array to support multiple IPs
@DevLeoko have you abandoned the AdvancedBan plugin?