@Test public void decryptInvalidParams() throws SecretDecryptionException { doThrow(InvalidSecretFormatException.class).when(secretEngine).validate(any()); String secretConfig = "encrypted:s3!paramName:paramValue"; exceptionRule.expect(InvalidSecretFormatException.class); secretManager.decrypt(secretConfig); }
public String decrypt(String configValue) { if (EncryptedSecret.isEncryptedSecret(configValue)) { return new String(decryptAsBytes(configValue)); } return configValue; }
SecretManager { public String decrypt(String configValue) { if (EncryptedSecret.isEncryptedSecret(configValue)) { return new String(decryptAsBytes(configValue)); } return configValue; } }
SecretManager { public String decrypt(String configValue) { if (EncryptedSecret.isEncryptedSecret(configValue)) { return new String(decryptAsBytes(configValue)); } return configValue; } @Autowired  SecretManager(SecretEngineRegistry secretEngineRegistry); }
SecretManager { public String decrypt(String configValue) { if (EncryptedSecret.isEncryptedSecret(configValue)) { return new String(decryptAsBytes(configValue)); } return configValue; } @Autowired  SecretManager(SecretEngineRegistry secretEngineRegistry); String decrypt(String configValue); Path decryptAsFile(String filePathOrEncrypted); byte[] decryptAsBytes(String encryptedString); }
SecretManager { public String decrypt(String configValue) { if (EncryptedSecret.isEncryptedSecret(configValue)) { return new String(decryptAsBytes(configValue)); } return configValue; } @Autowired  SecretManager(SecretEngineRegistry secretEngineRegistry); String decrypt(String configValue); Path decryptAsFile(String filePathOrEncrypted); byte[] decryptAsBytes(String encryptedString);  }