Merge branch 'stable-2.15' into stable-2.16
* stable-2.15: AccountIT: Test that account is not created with invalid email CreateAccount: Fail early when invalid SSH key is given Use base url for commentlink Change-Id: Ifac43208ba54ffcc012e1ff9374272466555bfbc
This commit is contained in:
@@ -131,6 +131,16 @@ public class CreateAccount
|
||||
}
|
||||
|
||||
extIds.add(ExternalId.createUsername(username, accountId, input.httpPassword));
|
||||
|
||||
if (input.sshKey != null) {
|
||||
try {
|
||||
authorizedKeys.addKey(accountId, input.sshKey);
|
||||
sshKeyCache.evict(username);
|
||||
} catch (InvalidSshKeyException e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
for (AccountExternalIdCreator c : externalIdCreators) {
|
||||
extIds.addAll(c.create(accountId, username, input.email));
|
||||
}
|
||||
@@ -163,15 +173,6 @@ public class CreateAccount
|
||||
}
|
||||
}
|
||||
|
||||
if (input.sshKey != null) {
|
||||
try {
|
||||
authorizedKeys.addKey(accountId, input.sshKey);
|
||||
sshKeyCache.evict(username);
|
||||
} catch (InvalidSshKeyException e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
AccountLoader loader = infoLoader.create(true);
|
||||
AccountInfo info = loader.get(accountId);
|
||||
loader.fill();
|
||||
|
||||
Reference in New Issue
Block a user