local_trusted_vault.proto 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. syntax = "proto2";
  5. option optimize_for = LITE_RUNTIME;
  6. option java_package = "sync_pb";
  7. package sync_pb;
  8. message LocalTrustedVaultKey {
  9. // The actual key.
  10. optional bytes key_material = 1;
  11. }
  12. message LocalDeviceRegistrationInfo {
  13. // Private SecureBox key.
  14. optional bytes private_key_material = 1;
  15. // Indicates whether device is registered, i.e. whether its public key is
  16. // successfully submitted to the server.
  17. optional bool device_registered = 2;
  18. // Used to trigger another device registration attempt, even if device is
  19. // already registered. Not set if `device_registered` is false.
  20. optional int32 device_registered_version = 3;
  21. }
  22. message LocalTrustedVaultDegradedRecoverabilityState {
  23. // Indicates whether the recoverability is degraded.
  24. optional bool is_recoverability_degraded = 1;
  25. // The time (in milliseconds since UNIX epoch) at which last refreshing
  26. // request was sent.
  27. optional int64 last_refresh_time_millis_since_unix_epoch = 2;
  28. }
  29. message LocalTrustedVaultPerUser {
  30. // User identifier.
  31. optional bytes gaia_id = 1;
  32. // All keys known for a user.
  33. repeated LocalTrustedVaultKey vault_key = 2;
  34. // The version corresponding to the last element in `vault_key`.
  35. optional int32 last_vault_key_version = 3;
  36. // Indicates whether `vault_key` is stale, i.e. that the latest locally
  37. // available key isn't the latest key in the vault. New keys need to be
  38. // fetched through key retrieval procedure or by following key rotation.
  39. optional bool keys_are_stale = 4;
  40. // Device key and corresponding registration metadata.
  41. optional LocalDeviceRegistrationInfo local_device_registration_info = 5;
  42. // The time (in milliseconds since UNIX epoch) at which last unsuccessful (due
  43. // to transient errors) request was sent to the vault service. Used for
  44. // throttling requests to the server.
  45. optional int64 last_failed_request_millis_since_unix_epoch = 6;
  46. // Whether keys relevant for the user should be deleted when account becomes
  47. // non-primary.
  48. optional bool should_delete_keys_when_non_primary = 7;
  49. // The state of the degraded recoverability, indicates whether the
  50. // recoverability is degraded and when was the last refreshing time.
  51. optional LocalTrustedVaultDegradedRecoverabilityState
  52. degraded_recoverability_state = 8;
  53. }
  54. message LocalTrustedVault {
  55. repeated LocalTrustedVaultPerUser user = 1;
  56. // Version of the stored data, used to perform data migrations.
  57. optional int32 data_version = 2;
  58. }