in runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/UserCredentialsServiceImpl.java [113:138]
private UserCredentials getPredefinedProfile(@NotNull final String profileName, final boolean trowException) {
final String userName;
final String password;
userName = tryGetFirstNotEmpty(myProfileParametersService.tryGetProperty(profileName, Constants.USER));
if(StringUtil.isEmptyOrSpaces(userName)) {
if(trowException) {
throw new BuildStartException("RunAs user must be defined for \"" + profileName + "\"");
}
else {
return null;
}
}
password = tryGetFirstNotEmpty(myProfileParametersService.tryGetProperty(profileName, Constants.PASSWORD), myProfileParametersService.tryGetProperty(profileName, Constants.CONFIG_PASSWORD));
if(StringUtil.isEmptyOrSpaces(password)) {
if(trowException) {
throw new BuildStartException("RunAs password must be defined for \"" + profileName + "\"");
}
else {
return null;
}
}
return createCredentials(profileName, userName, password, true);
}