telefonicaid / iotagent-node-lib

Module to enable IoT Agent developers to build custom agents for their devices that can easily connect to NGSI Context Brokers
https://iotagent-node-lib.rtfd.io/
GNU Affero General Public License v3.0
60 stars 86 forks source link

log `from` using `x-forwarded-for header`/ 'x-real-ip' for incoming requests: #918

Closed AlvaroVega closed 4 years ago

fgalan commented 4 years ago

I think this is the same behavior Orion implements, in case you want to get inspiration from it :)

https://fiware-orion.readthedocs.io/en/master/admin/logs/index.html#log-format

from. Source IP of the HTTP request associated to the transaction, except if the request includes X-Forwarded-For header (which overrides the former) or X-Real-IP (which overrides X-Forwarded-For and source IP).

Curiously, Orion also considers another header (X-Real-IP). Maybe IOTAs should also take it into account, for the sake of homogeneity.

fgalan commented 4 years ago

Maybe similar issues should be created in other outstanding IOTAs