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

encrypt and decrypt endpoint lost data for encryptor retrievement #2252

Closed
RouxAntoine opened this issue Apr 16, 2023 · 0 comments · Fixed by #2253
Closed

encrypt and decrypt endpoint lost data for encryptor retrievement #2252

RouxAntoine opened this issue Apr 16, 2023 · 0 comments · Fixed by #2253
Labels
Milestone

Comments

@RouxAntoine
Copy link
Contributor

Version

Spring cloud config server 4.0.2

Explanation

in this commit b2508eb

encrypt and decrypt controller

b2508eb#diff-f18a83930fb437413479ed50adc18dedbf115b37e560d8481185a796c24444d8R107-L131

b2508eb#diff-f18a83930fb437413479ed50adc18dedbf115b37e560d8481185a796c24444d8R127-L150

stop to propagate data variable to EnvironmentPrefixHelper.getEncryptorKeys()

Sample with custom TextEncryptorLocator

@Configuration(proxyBeanMethods = false)
public class Encryption {

    private final DefaultTextEncryptionAutoConfiguration defaultTextEncryptionAutoConfiguration;

    public Encryption() {
        defaultTextEncryptionAutoConfiguration = new DefaultTextEncryptionAutoConfiguration();
    }

    @Bean
    public TextEncryptorLocator textEncryptorLocator(MultiKeyProperties multiKeyProperties) {
        return keys -> {
            KeyProperties keyPropertiesForClient = multiKeyProperties.encrypt().get(keys.get("application"));
            return defaultTextEncryptionAutoConfiguration.defaultTextEncryptor(keyPropertiesForClient);
        };
    }

}
$ curl -s localhost:8090/encrypt --data-urlencode '{"key":"one","secret":"value"}Hello world 2'

the keys map contained nothing except name and profiles entry

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
2 participants