logbook icon indicating copy to clipboard operation
logbook copied to clipboard

Disable the creation of bean jsonBodyFieldsFilter from LogbookAutoConfiguration

Open aldex32 opened this issue 1 year ago • 1 comments

I would like to disable the creation of jsonBodyFieldsFilter from LogbookAutoConfiguration so I am able to create my own BodyFilter which allows for a more flexible obfuscation (such as partial obfuscation) of the fields declared in logbook.obfuscate.json-body-fields instead of using a fixed replacement. The filter can be any implementation of BodyFilter.

Not sure whether this can be considered a bug or a feature. Perhaps a possible fix would be introducing @ConditionalOnProperty where we can define a property to disable it?

  • Version used: 3.9.0

aldex32 avatar Sep 03 '24 11:09 aldex32

I happen to come across this issue, and I've asked in discussion something that seems similar: https://github.com/zalando/logbook/discussions/1840.

Just linking this here, because I think you're asking for even more flexibility, which seems to be even better than having a fallback to BodyFilter.none().

aukevanleeuwen avatar Sep 09 '24 10:09 aukevanleeuwen

The fix for the issue (https://github.com/zalando/logbook/pull/2007) will be added to the next release. Resolving it (to get it to the release notes), feel free to reopen, if it's not fully addressed.

kasmarian avatar Feb 26 '25 09:02 kasmarian