Skip to content

Conversation

@LeMakhno
Copy link

No description provided.

Signed-off-by: l.makhnorylov <lmakhnorylov@gmail.com>
* Specify additional property transformer classes
* {@link org.springframework.vault.core.util.PropertyTransformer}.
*/
Class<? extends PropertyTransformer>[] propertyTransformers() default {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introducing another flavor of property transformation creates ambiguity and takes away the simplicity of use. We have property-prefixing in place and we don't want to give up on simplicity.

The huge benefit of the current design approach is that all property transformations are visible from just looking at the annotation. Any other transformers require navigation and indirection.

Instead, I suggest exploring a design towards annotation-based property mapping. Admittedly, @VaultProperties(mapping = {@PropertyMapping(from="password", to="spring.datasource.password")} reads rather clunky, but that is still a direction worth exploring. Maybe you want to explore textblocks or other syntactical variants so that we come to a design that is simple and allows for addressing your use-case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mp911de i liked the approach with @PropertyMapping as annotation parameter, also i came up with idea of specitying an array of strings, where each 2 items is pair of from-to property names. But i like the variant with @PropertyMapping more

@VaultProperties(mapping = { "url", "spring.datasource.url", "user", "spring.datasource.username", "pwd", "spring.datasource.password" })

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mp911de implemented approach with @PropertyMapping

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

Successfully merging this pull request may close these issues.

2 participants