Allow changeInserter to insert ChangeMessages

Change-Id: I0a199d04faea08fae5bbec0e3715dcd8aea1fc8f
Remove unnecessary handling of NoSuchChangeException in PostReviewers

Change-Id: I4ac49dcd9007eac5a2179b78867ff35f2b201831
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Remove account parsing from Reviewers

Instead reuse the coding from AccountsCollection which also parses
accounts.

Change-Id: Ie805d739127e92589d695a07381b41eefeb19f0f
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Warn if cache.web_sessions.maxAge is to small

Setting maxAge to a small value e.g. 59s can result in the
browser endlessly redirecting trying to setup a new valid
session. Warn administrators that the value is set smaller
than 5 minutes.

Bug: issue 1821
Change-Id: I7a306d93ca5bd55d68d0909be52b259acdbb6db5
Merge "Warn if cache.web_sessions.maxAge is to small"
Support cache.web_sessions.maxAge < 1 minute

When reading cache.web_sessions.maxAge from gerrit.config we specify
MINUTES as the wanted time unit, but then convert it into milliseconds.
By doing this any value < 1 minute (e.g. '59s') is rounded by the
conversion to 0 milliseconds. Fix this by specifying MILLISECONDS as
wanted time unit so that no conversion is needed.

Bug: issue 1821
Change-Id: Ie279ad8fa5ac5a40828c4e24e35d4a8312b810dd
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
When resolving an account by ID check that it actually exists

REST endpoints that accept an account as input, allow that the account
is specified as account ID. The AccountResolver which is used to
resolve accounts currently accepts any account ID even if for this ID
no account exists. As result it is e.g. possible to add a non-existing
account as member to a group or as reviewer to a change.

Change-Id: I0462868df39bb826eb4c3e8f6a435d34e431c907
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Verify session matches container authentiation header

If the user alters their identity in the container invalidate
the Gerrit user session and force a new one to begin.

Bug: issue 1822
Change-Id: Id438576f2e8a2d06dce92806f1698a7ca53d999e
Merge "Support cache.web_sessions.maxAge < 1 minute"
For external group fail with 405 if group endpoint expects internal group

Some group REST endpoints are only supported for internal groups. If
such an endpoint is invoked for an external group always fail with '405
Method Not Allowed'. 405 makes sense since under /groups/<group-id> all
groups are accessible and only some views under this URL are not
supported for external groups.

Change-Id: I912e56c2c2548303e3128ab4041072d51d388b46
Signe-off-by: Edwin Kempin <edwin.kempin@sap.com>
Document that 'id' in DashboardInput is expected to be URL encoded

Change-Id: I4350350f9976d7cce43bd0c74b91818e7428890c
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Merge "Verify session matches container authentiation header"
Update JGit to 2.3.1.201302201838-r.55-ge175daf

Includes a new experimental recursive merge strategy as well as
reworked merge base error handling.

Change-Id: I0feb5cd365fe939b9f7a6155f136ad65605036f0
Catch NoMergeBaseException when no merge base was found

Matching on the IOException string broke in upstream JGit.
Fortunately, upstream now has a new exception type that gets thrown,
along with a reason enum, so our error handling can be more
future-proof.

Change-Id: Icd6156353fa700d4598b601ed4c1cd072de5031c
Use correct time unit for default session timeout

The timeout unit should still be in milliseconds as per Ie279ad8f, but
we need to convert the default timeout value so it does not default to
720ms.

Change-Id: I4a079934b405c85f964d34f9182d257a66d414fe
Merge "Document that 'id' in DashboardInput is expected to be URL encoded"
Merge "Use correct time unit for default session timeout"
Merge "Catch NoMergeBaseException when no merge base was found"
Get LabelTypes via ProjectState in SubmitStrategyFactory

This code may be called from the MergeOp thread, which has no
associated user. The create() method is already complex and it would
make it (and callers) worse to pass in a relevant user directly just
to create a ProjectControl to get the LabelTypes. Instead, since we
just need the ProjectState, get this directly from the cache.

Change-Id: Icffefcde4cf11fb7762d69b575f92ea5be86641e
Merge "When resolving an account by ID check that it actually exists"