zalando / logbook

An extensible Java library for HTTP request and response logging
MIT License
1.78k stars 256 forks source link

Make Logbook filter order configurable in Spring Boot starter #1835

Open artemik opened 2 months ago

artemik commented 2 months ago

Detailed Description

Make Logbook filter order configurable in Spring Boot starter.

Context

Current Spring Boot starter has hardcoded orders, accordingly to security concerns explained in Logbook docs, for example: https://github.com/zalando/logbook/blob/646f30358fd057b7371d05f7c1c63ec07c99741f/logbook-spring-boot-autoconfigure/src/main/java/org/zalando/logbook/autoconfigure/LogbookAutoConfiguration.java#L463

However, it might be beneficial to adjust the order, to accommodate observability related filters, for example.

Possible Implementation

Make the order configurable.

Your Environment

Logbook 3.8.0

lukasniemeier-zalando commented 2 months ago

Thank you for your idea, I have two (isolated, independent) clarifying questions:

  1. As you are linking to the logbookFilter bean definition, would your use case be solved if you provide your own logbookFilter bean with the desired custom bean order?
  2. If we were to provide configurable bean ordering, would your use case be solved if the order is configurable via the properties (as an integer)?