Add auth.userNameCaseInsensitive option

In Gerrit usernames are handled case sensitive, e.g. johndoe and
JohnDoe can both exist as separate accounts. This could lead to
issues when migrating an account from LDAP to an internal account,
if ldap.localUsernameToLowerCase was set. Such usernames can also
be rather confusing for users, if they try to identify authors of
comments or changes.

This change adds an option to handle accounts case insensitive but
case preserving. To achieve this the external ID notes of external IDs
using the 'gerrit:' or 'username:' scheme are named with the SHA-1
from the lowercase external ID. With this change there can
be no accounts with usernames only different in capitalization. On
existing Gerrit sites this may require to migrate the external ID
note names to match the new scheme. A tool to do so will be provided
in a separate change.

Change-Id: I64db5ed5256564dbc03952e9721615f42212ad48
diff --git a/proto/cache.proto b/proto/cache.proto
index 4f4c838..16e5e95 100644
--- a/proto/cache.proto
+++ b/proto/cache.proto
@@ -268,13 +268,14 @@
 // com.google.gerrit.server.account.externalids.AllExternalIds.
 // Next ID: 2
 message AllExternalIdsProto {
-  // Next ID: 6
+  // Next ID: 7
   message ExternalIdProto {
     string key = 1;
     int32 accountId = 2;
     string email = 3;
     string password = 4;
     bytes blobId = 5;
+    bool isCaseInsensitive = 6;
   }
   repeated ExternalIdProto external_id = 1;
 }