in github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/wizard/AccountController.java [181:197]
private void setAccoutPublicKeys(
IdentifiedUser user, GitHubLogin hubLogin, HttpServletRequest req) throws IOException {
GHMyself myself = hubLogin.getMyself();
List<GHVerifiedKey> githubKeys = myself.getPublicVerifiedKeys();
HashSet<String> gerritKeys = Sets.newHashSet(getCurrentGerritSshKeys(user));
for (GHKey ghKey : githubKeys) {
String sshKeyCheckedParam = "key_check_" + ghKey.getId();
String sshKeyWithLabel = ghKey.getKey() + " " + ghKey.getTitle();
String checked = req.getParameter(sshKeyCheckedParam);
if (checked != null
&& checked.equalsIgnoreCase("on")
&& !gerritKeys.contains(ghKey.getKey())) {
addSshKey(user, sshKeyWithLabel);
gerritKeys.add(ghKey.getKey());
}
}
}