Skip to content

Commit ee98c0d

Browse files
authored
Merge pull request #570 from telefonicaid/task/rename_access_log_fields
Task/rename access log fields
2 parents 7b4711b + 89e062b commit ee98c0d

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

CHANGES_NEXT_RELEASE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
- Add: allow authorize using local PDP implementation (new config.localPDP / AUTHORIZE_BY_LOCAL_PDP setting) (#571)
22
- Add: get roles from keystone and cache them using role names (#571)
3+
- Rename: access logger fields: Service -> srv and SubService -> subsrv (#568)
34
- Remove node cache legacy callbacks warning
45
- Fix: fill from log field with real IP
56
- Upgrade NodeJS version from 16-slim to 24-bullseye-slim in Dockerfile

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,17 +452,17 @@ Accounting access log include data about:
452452
* UserId
453453
* UserName
454454
* ServiceId
455-
* Service
455+
* srv
456456
* SubServiceId
457-
* SubService
457+
* subsrv
458458
* Action
459459
* Path
460460
* Body (Truncated to 100 chars when is valid access)
461461
* Date
462462
* Query
463463
Example of access log:
464464
```
465-
"Right Attempt | ResponseStatus=200 | Token=gAAAAABnBPgPrgwpcAkbQOZIryu5ADUIScyorN3vbPYbTJxTE5AF3RO1y25Tf-sL3EKzvfr_1U3u8IL8ylB4e4B_vD5yZjc9rnrSIqoiC77B7uZ1O1xZCyukq_MkjRxJLqA9yQ5lQtAQCC6ig7Kn5uPhpPD-mhVb7kyQjUw1QjtCiyP7UKXZvKU | Origin=172.17.0.22 | UserId=753b954985bf460fabbd6953c71d50c7 | UserName=adm1 | ServiceId=9f710408f5944c3993db600810e97c83 | Service=smartcity | SubServiceId=/ | SubService=/ | Action=read | Path=/v2/entities | Query={\"limit\":\"15\",\"offset\":\"0\",\"options\":\"count\"} | Body={} | Date=2024-10-08T09:25:30.441Z"
465+
"Right Attempt | ResponseStatus=200 | Token=gAAAAABnBPgPrgwpcAkbQOZIryu5ADUIScyorN3vbPYbTJxTE5AF3RO1y25Tf-sL3EKzvfr_1U3u8IL8ylB4e4B_vD5yZjc9rnrSIqoiC77B7uZ1O1xZCyukq_MkjRxJLqA9yQ5lQtAQCC6ig7Kn5uPhpPD-mhVb7kyQjUw1QjtCiyP7UKXZvKU | Origin=172.17.0.22 | UserId=753b954985bf460fabbd6953c71d50c7 | UserName=adm1 | ServiceId=9f710408f5944c3993db600810e97c83 | srv=smartcity | SubServiceId=/ | subsrv=/ | Action=read | Path=/v2/entities | Query={\"limit\":\"15\",\"offset\":\"0\",\"options\":\"count\"} | Body={} | Date=2024-10-08T09:25:30.441Z"
466466
```
467467
468468
Note that the above format is not the same than the regular PEP log (although it is also based in fields separated by `|`, the fields themselves are not the same).
@@ -509,7 +509,7 @@ configAccessMatch.body = [
509509
When any of theses patterns matches in current access, message access is added with `MATCHED <element> <value>` , where `<element>` would be: `USER`, `HEADER <header-name>`, `SUBPATH`, `SUBQUERY`, `BODY` and `<value>` the value which matches. For example:
510510
511511
```
512-
Right Attempt MATCHED HEADER fiware-service smartcity | ResponseStatus=200 | Token=gAAAAABnBPgPrgwpcAkbQOZIryu5ADUIScyorN3vbPYbTJxTE5AF3RO1y25Tf-sL3EKzvfr_1U3u8IL8ylB4e4B_vD5yZjc9rnrSIqoiC77B7uZ1O1xZCyukq_MkjRxJLqA9yQ5lQtAQCC6ig7Kn5uPhpPD-mhVb7kyQjUw1QjtCiyP7UKXZvKU | Origin=172.17.0.22 | UserId=753b954985bf460fabbd6953c71d50c7 | UserName=adm1 | ServiceId=9f710408f5944c3993db600810e97c83 | Service=smartcity | SubServiceId=/ | SubService=/ | Action=read | Path=/v2/entities | Query={\"limit\":\"15\",\"offset\":\"0\",\"options\":\"count\"} | Body={} | Date=2024-10-08T09:25:30.441Z"
512+
Right Attempt MATCHED HEADER fiware-service smartcity | ResponseStatus=200 | Token=gAAAAABnBPgPrgwpcAkbQOZIryu5ADUIScyorN3vbPYbTJxTE5AF3RO1y25Tf-sL3EKzvfr_1U3u8IL8ylB4e4B_vD5yZjc9rnrSIqoiC77B7uZ1O1xZCyukq_MkjRxJLqA9yQ5lQtAQCC6ig7Kn5uPhpPD-mhVb7kyQjUw1QjtCiyP7UKXZvKU | Origin=172.17.0.22 | UserId=753b954985bf460fabbd6953c71d50c7 | UserName=adm1 | ServiceId=9f710408f5944c3993db600810e97c83 | srv=smartcity | SubServiceId=/ | subsrv=/ | Action=read | Path=/v2/entities | Query={\"limit\":\"15\",\"offset\":\"0\",\"options\":\"count\"} | Body={} | Date=2024-10-08T09:25:30.441Z"
513513
```
514514
Account log has three modes: `all`, `matched`, `wrong`. First one `all` includes right and wrong access regardles if matches or not. Second one `matched` includes all wrong and just rigth matches acess. And `wrong` mode only includes all wrong access, regardless is matches or not with patterns.
515515

lib/fiware-pep-steelskin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ function accountInfoError(error, req, res, next) {
8383
' | UserId=' + req.userId +
8484
' | ServiceId=' + req.serviceId +
8585
' | UserName=' + req.userName +
86-
' | Service=' + req.service +
86+
' | srv=' + req.service +
8787
' | SubServiceId=' + req.subserviceId +
88-
' | SubService=' + req.subService +
88+
' | subsrv=' + req.subService +
8989
' | Action=' + req.action +
9090
' | Path=' + req.path +
9191
' | Query=' + JSON.stringify(req.query) +

lib/middleware/proxy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ function accountInfo(req, res, next) {
275275
' | UserId=' + req.userId +
276276
' | UserName=' + req.userName +
277277
' | ServiceId=' + req.serviceId +
278-
' | Service=' + req.service +
278+
' | srv=' + req.service +
279279
' | SubServiceId=' + req.subserviceId +
280-
' | SubService=' + req.subService +
280+
' | subsrv=' + req.subService +
281281
' | Action=' + req.action +
282282
' | Path=' + req.path +
283283
' | Query=' + JSON.stringify(req.query) +

0 commit comments

Comments
 (0)