in runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsPropertiesExtension.java [114:150]
private void protectProperty(
final @NotNull AgentRunningBuild runningBuild,
final String propertyValue) {
if (myIsHidingOfPropertyIsNotSupported) {
return;
}
try {
final Method getPasswordReplacerMethod = AgentRunningBuild.class.getMethod("getPasswordReplacer");
if (getPasswordReplacerMethod == null) {
onHidingOfPropertyIsNotSupportedMessage();
return;
}
Object passwordReplacer = getPasswordReplacerMethod.invoke(runningBuild);
if (passwordReplacer == null) {
onHidingOfPropertyIsNotSupportedMessage();
return;
}
final Class<?> passwordReplacerClass = Class.forName("jetbrains.buildServer.util.PasswordReplacer");
if (passwordReplacerClass == null) {
onHidingOfPropertyIsNotSupportedMessage();
return;
}
final Method addPasswordMethod = passwordReplacerClass.getMethod("addPassword", String.class);
if (addPasswordMethod == null) {
onHidingOfPropertyIsNotSupportedMessage();
return;
}
addPasswordMethod.invoke(passwordReplacer, propertyValue);
} catch (Exception ignored) {
onHidingOfPropertyIsNotSupportedMessage();
}
}