Merge changes from topic 'notedb-accounts-1'

* changes:
  AccountsUpdate: Rename atomicUpdate to update
  AccountsUpdate: Rename update method to replace
  Always update accounts atomically
  Migrate accounts to NoteDb (part 2)
  Disallow updates to account.config by direct push or submit
  Migrate accounts to NoteDb (part 1)
  Let AccountsUpdate#insert create the Account instance
  AccountsUpdate: Remove upsert method
This commit is contained in:
Edwin Kempin
2017-06-29 08:26:27 +00:00
committed by Gerrit Code Review
60 changed files with 1288 additions and 339 deletions

View File

@@ -42,6 +42,7 @@ import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -111,7 +112,7 @@ class RunAsFilter implements Filter {
Account target;
try {
target = accountResolver.find(db.get(), runas);
} catch (OrmException e) {
} catch (OrmException | IOException | ConfigInvalidException e) {
log.warn("cannot resolve account for " + RUN_AS, e);
replyError(req, res, SC_INTERNAL_SERVER_ERROR, "cannot resolve " + RUN_AS, e);
return;

View File

@@ -49,6 +49,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -231,7 +232,7 @@ class BecomeAnyAccountLoginServlet extends HttpServlet {
}
try (ReviewDb db = schema.open()) {
return auth(accounts.get(db, id));
} catch (OrmException e) {
} catch (OrmException | IOException | ConfigInvalidException e) {
getServletContext().log("cannot query database", e);
return null;
}