in TeamCity.GitHubIssues-server/src/main/java/jetbrains/buildServer/issueTracker/github/GitHubIssueProvider.java [95:132]
public Collection<InvalidProperty> process(Map<String, String> map) {
final List<InvalidProperty> result = new ArrayList<>();
// authTokenType -
String authTypeParam = map.get(PARAM_AUTH_TYPE);
if (isEmptyOrSpaces(authTypeParam)) {
authTypeParam = AUTH_ANONYMOUS;
}
// we have auth type. check against it
if (authTypeParam.equals(AUTH_LOGINPASSWORD)) {
checkNotEmptyParam(result, map, PARAM_USERNAME, "Username must be specified");
checkNotEmptyParam(result, map, PARAM_PASSWORD, "Password must be specified");
} else if (authTypeParam.equals(AUTH_ACCESSTOKEN)) {
checkNotEmptyParam(result, map, PARAM_ACCESS_TOKEN, "Access token must be specified");
} else if (authTypeParam.equals(AUTH_STORED_TOKEN)) {
checkNotEmptyParam(result, map, PARAM_TOKEN_ID, "Token id token must be specified");
}
if (checkNotEmptyParam(result, map, PARAM_PATTERN, "Issue pattern must not be empty")) {
try {
String patternString = map.get(PARAM_PATTERN);
//noinspection ResultOfMethodCallIgnored
Pattern.compile(patternString);
} catch (PatternSyntaxException e) {
result.add(new InvalidProperty(PARAM_PATTERN, "Syntax of issue pattern is not correct"));
}
}
if (checkNotEmptyParam(result, map, PARAM_REPOSITORY, "Repository must be specified")) {
String repo = getHostProperty(map);
try {
new URL(repo);
} catch (MalformedURLException e) {
result.add(new InvalidProperty(PARAM_REPOSITORY, "Repository URL is not correct"));
}
}
return result;
}