kuzzleio / kuzzle

Open-source Back-end, self-hostable & ready to use - Real-time, storage, advanced search - Web, Apps, Mobile, IoT -
https://kuzzle.io
Apache License 2.0
1.43k stars 123 forks source link

Inject IP address to request contexts #1106

Closed scottinet closed 6 years ago

scottinet commented 6 years ago

Request contexts contain a few information, useful to contextualize how a request has been passed to Kuzzle.

Since we do know from what IP address a request has been submitted, I think we should inject that information too in the request context, in a new ips: <Array> property

Use case: provide a way to plugin developers to grant or deny access to Kuzzle API features depending of the IP address. For instance by allowing access to some API methods only from IPs registered in a white list

scottinet commented 6 years ago

Internal backlog task: https://jira.kaliop.net/browse/KZL-49

scottinet commented 6 years ago

Another client also needs the source URL (when available), and I don't see why not adding it while we are at it.