nextcloud / app_api

Nextcloud AppAPI
https://apps.nextcloud.com/apps/app_api
GNU Affero General Public License v3.0
71 stars 6 forks source link

added logging of ExApp requests made on behalf of user #360

Closed bigcat88 closed 1 month ago

bigcat88 commented 1 month ago
  1. Logs are written to a separate file
  2. Log level - Warning
  3. Only for those requests where "user" is set

Reference: https://github.com/nextcloud/server/pull/46539#pullrequestreview-2182378157

this is how logs look like:

{"reqId":"t9ThOI2CheVn6sDUsUKO","level":2,"time":"2024-08-13T10:08:42+00:00","remoteAddr":"192.168.65.1","user":"admin","app":"nc_py_api","method":"GET","url":"/ocs/v1.php/cloud/capabilities?format=json","message":"impersonation request","userAgent":"python-httpx/0.25.2","version":"30.0.0.7","data":{"app":"nc_py_api"}}
{"reqId":"tVtHIEwQ5YKhbWUFTmKF","level":2,"time":"2024-08-13T10:08:42+00:00","remoteAddr":"192.168.65.1","user":"admin","app":"nc_py_api","method":"PROPFIND","url":"/remote.php/dav/files/admin","message":"impersonation request","userAgent":"python-httpx/0.25.2","version":"30.0.0.7","data":{"app":"nc_py_api"}}