Convert OAuthTokenCache serialization to protobuf

The serializer class lives in OAuthTokenCache.java so the extension
framework doesn't acquire a dep on the cache serialization code, which
currently lives in the server package.

Proto3 doesn't have optional fields, so we can't distinguish between
empty and null for the provider_id field (at least without adding a
separate has_provider_id field). Explicitly treat these the same in
OAuthToken itself, and clarify that other fields are not nullable.

Change-Id: I37bd47ac0c8491e5212fcec4885e063ae50d714d
diff --git a/proto/cache.proto b/proto/cache.proto
index 8f4298f..cf975c6 100644
--- a/proto/cache.proto
+++ b/proto/cache.proto
@@ -35,3 +35,13 @@
   string submit_type = 3;
   string merge_strategy = 4;
 }
+
+// Serialized form of com.google.gerrit.extensions.auth.oauth.OAuthToken.
+// Next ID: 6
+message OAuthTokenProto {
+  string token = 1;
+  string secret = 2;
+  string raw = 3;
+  int64 expires_at = 4;
+  string providerId = 5;
+}