Merge branch 'stable-2.14' into stable-2.15
* stable-2.14: Set version to 2.14.18 Revert "Fix the missing DB entry in Gerrit DB" Upgrade JGit to 4.7.7.201812240805-r maven_jar: Add repo.eclipse.org to supported repositories Upgrade JGit to 4.5.5.201812240535-r Change-Id: I69dca6c1f942de80b3c77c125b561ae33de8abaa
This commit is contained in:
commit
c3a647653b
|
@ -14,8 +14,6 @@
|
|||
|
||||
package com.google.gerrit.server.account;
|
||||
|
||||
import static com.google.gerrit.server.account.externalids.ExternalId.SCHEME_USERNAME;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.gerrit.common.data.AccessSection;
|
||||
|
@ -138,23 +136,8 @@ public class AccountManager {
|
|||
try (ReviewDb db = schema.open()) {
|
||||
ExternalId id = externalIds.get(who.getExternalIdKey());
|
||||
if (id == null) {
|
||||
if (who.getUserName() != null) {
|
||||
ExternalId.Key key = ExternalId.Key.create(SCHEME_USERNAME, who.getUserName());
|
||||
ExternalId existingId = externalIds.get(key);
|
||||
if (existingId != null) {
|
||||
// An inconsistency is detected in the database, having a record for scheme
|
||||
// "username:"
|
||||
// but no record for scheme "gerrit:". Try to recover by linking
|
||||
// "gerrit:" identity to the existing account.
|
||||
log.warn(
|
||||
"User {} already has an account; link new identity to the existing account.",
|
||||
who.getUserName());
|
||||
return link(existingId.accountId(), who);
|
||||
}
|
||||
}
|
||||
// New account, automatically create and return.
|
||||
//
|
||||
log.debug("External ID not found. Attempting to create new account.");
|
||||
return create(db, who);
|
||||
}
|
||||
|
||||
|
@ -413,16 +396,13 @@ public class AccountManager {
|
|||
public AuthResult link(Account.Id to, AuthRequest who)
|
||||
throws AccountException, OrmException, IOException, ConfigInvalidException {
|
||||
ExternalId extId = externalIds.get(who.getExternalIdKey());
|
||||
log.debug("Link another authentication identity to an existing account");
|
||||
if (extId != null) {
|
||||
if (!extId.accountId().equals(to)) {
|
||||
throw new AccountException(
|
||||
"Identity '" + extId.key().get() + "' in use by another account");
|
||||
}
|
||||
log.debug("Updating existing external ID data");
|
||||
update(who, extId);
|
||||
} else {
|
||||
log.debug("Linking new external ID to the existing account");
|
||||
externalIdsUpdateFactory
|
||||
.create()
|
||||
.insert(ExternalId.createWithEmail(who.getExternalIdKey(), to, who.getEmailAddress()));
|
||||
|
|
|
@ -6,6 +6,8 @@ MAVEN_CENTRAL = "MAVEN_CENTRAL:"
|
|||
|
||||
MAVEN_LOCAL = "MAVEN_LOCAL:"
|
||||
|
||||
ECLIPSE = "ECLIPSE:"
|
||||
|
||||
def _maven_release(ctx, parts):
|
||||
"""induce jar and url name from maven coordinates."""
|
||||
if len(parts) not in [3, 4]:
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
from os import path
|
||||
|
||||
REPO_ROOTS = {
|
||||
'ECLIPSE': 'https://repo.eclipse.org/content/groups/releases',
|
||||
'GERRIT': 'http://gerrit-maven.storage.googleapis.com',
|
||||
'GERRIT_API': 'https://gerrit-api.commondatastorage.googleapis.com/release',
|
||||
'MAVEN_CENTRAL': 'http://repo1.maven.org/maven2',
|
||||
|
|
Loading…
Reference in New Issue