xref: /aosp_15_r20/external/cronet/components/metrics/structured/lib/proto/key.proto (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1// Copyright 2023 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5syntax = "proto2";
6
7package metrics.structured;
8
9option optimize_for = LITE_RUNTIME;
10
11// These protos are used for storing key information for structured metrics. All
12// changes should be backwards-compatible. This file is manually synced between
13// chromium and platform2. Any changes should first be made to chromium and then
14// copied to platform2.
15//
16// chromium path: components/metrics/structured/lib/proto/key.proto
17// platform2 path: metrics/structured/proto/storage.proto
18
19// All information about the key for a single project.
20message KeyProto {
21  // The key itself.
22  optional string key = 1;
23
24  // When the key was last rotated, in days since the unix epoch.
25  optional int64 last_rotation = 2;
26
27  // The maximum number of days between rotations.
28  optional int64 rotation_period = 3;
29}
30
31// Stores keys for all projects.
32message KeyDataProto {
33  // Maps the first 8 bytes of the MD5 hash of the project name to that
34  // project's key.
35  map<fixed64, KeyProto> keys = 1;
36}
37