zalando-stups / put-it-to-rest

https://github.com/zalando/riptide/tree/master/riptide-spring-boot-starter
MIT License
11 stars 6 forks source link

Extend default configuration (STUPS) #32

Closed lukasniemeier-zalando closed 8 years ago

lukasniemeier-zalando commented 8 years ago

Our current (Java) configuration looks like this

@Configuration
public class LoggingConfiguration {

    final Pattern pattern = Pattern.compile("(?:(\"(?:access_token|open_id|id_token)\")\\s*\\:\\s*)\".+?\"");
    @Bean
    public BodyObfuscator bodyObfuscator() {
        return ((contentType, body) -> pattern.matcher(body).replaceAll("$1\"XXX\""));
    }
}

Do we want to integrate this into put-it-to-rest?

whiskeysierra commented 8 years ago

Do we want to integrate this into put-it-to-rest?

We have a chicken-egg-problem, because we both auto configurations (RestClientAutoConfiguration and LogbookAutoConfiguration) depend on each other then: The one needs the interceptor the other needs the body obfuscator.

whiskeysierra commented 8 years ago

We should also look at the content type before we do something like that. Or can we even look at the URL? Is this for token generation or verification?