Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup "replaceJsonStringProperty" body filter with Spring Boot Auto-configuration #298

Closed
thomasreiser opened this issue Jun 22, 2018 · 1 comment

Comments

@thomasreiser
Copy link

Currently I cannot find a possibility to setup the replaceJsonStringProperty body filter via the Spring Boot auto-configuration. I would require this setup in order to obfuscate some values sent within the request body.

Is there a way to do this without working around the auto-configuration?

@whiskeysierra
Copy link
Collaborator

whiskeysierra commented Jun 22, 2018

I assume you're looking for a way to configure it within the application.yml. That is in fact not supported right now, but in standard auto-configuration fashion you can just provide your own BodyFilter that takes precedence of the default:

@Bean
public BodyFilter bodyFilter() {
    return merge(defaultValue(), replaceJsonStringProperty(singleton("secret"), "XXX"));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants