github.com/bartle-stripe/trillian@v1.2.1/storage/cloudspanner/spannerpb/spanner.proto (about) 1 syntax = "proto3"; 2 3 option go_package = "github.com/google/trillian/storage/cloudspanner/spannerpb"; 4 5 package spannerpb; 6 7 import "google/protobuf/any.proto"; 8 9 // State of the Tree. 10 // Mirrors trillian.TreeState. 11 enum TreeState { 12 UNKNOWN_TREE_STATE = 0; 13 ACTIVE = 1; 14 FROZEN = 2; 15 } 16 17 // Type of the Tree. 18 // Mirrors trillian.TreeType. 19 enum TreeType { 20 UNKNOWN = 0; 21 LOG = 1; 22 MAP = 2; 23 } 24 25 // Defines the preimage protection used for tree leaves / nodes. 26 // Eg, RFC6962 dictates a 0x00 prefix for leaves and 0x01 for nodes. 27 // Mirrors trillian.HashStrategy. 28 enum HashStrategy { 29 UNKNOWN_HASH_STRATEGY = 0; 30 RFC_6962 = 1; 31 TEST_MAP_HASHER = 2; 32 OBJECT_RFC6962_SHA256 = 3; 33 CONIKS_SHA512_256 = 4; 34 } 35 36 // Supported hash algorithms. 37 // The numbering space is the same as for TLS, given in RFC 5246 s7.4.1.4.1. See 38 // http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-18. 39 // Mirrors trillian.HashAlgorithm. 40 enum HashAlgorithm { 41 // No hash algorithm is used. 42 NONE = 0; 43 // SHA256 is used. 44 SHA256 = 4; 45 } 46 47 // Supported signature algorithms. 48 // The numbering space is the same as for TLS, given in RFC 5246 s7.4.1.4.1. See 49 // http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-16. 50 // Mirrors trillian.SignatureAlgorithm. 51 enum SignatureAlgorithm { 52 // Anonymous signature scheme. 53 ANONYMOUS = 0; 54 // RSA signature scheme. 55 RSA = 1; 56 // ECDSA signature scheme. 57 ECDSA = 3; 58 } 59 60 // LogStorageConfig holds settings which tune the storage implementation for 61 // a given log tree. 62 message LogStorageConfig { 63 // num_unseq_buckets defines the length of the unsequenced time ring buffer. 64 // This value must *never* be reduced for any provisioned tree. 65 // 66 // This value should be >= 1, and there's probably not much benefit in 67 // raising it past about 4. 68 // TODO(al): test what the effects of various values are here. 69 int64 num_unseq_buckets = 1; 70 71 // num_merkle_buckets defines the number of individual buckets below each 72 // unsequenced ring bucket. 73 // This value may be changed at any time (so long as you understand the 74 // impact it'll have on integration performace!) 75 // 76 // This value must lie in the range [1..256] 77 int64 num_merkle_buckets = 2; 78 } 79 80 // MapStorageConfig holds settings which tune the storage implementation for 81 // a given map tree. 82 message MapStorageConfig { 83 } 84 85 // TreeInfo stores information about a Trillian tree. 86 message TreeInfo { 87 // tree_id is the ID of the tree, and is used as a primary key. 88 int64 tree_id = 1; 89 90 // key_id identifies the private key associated with this tree. 91 int64 key_id = 2; 92 93 // name is a short name for this tree. 94 string name = 3; 95 96 // description is a short free form text describing the tree. 97 string description = 4; 98 99 // tree_type identifies whether this is a Log or a Map tree. 100 TreeType tree_type = 5; 101 102 // tree_state is the state of the tree. 103 TreeState tree_state = 8; 104 105 // hash_strategy is the hashing strategy used by the tree. 106 HashStrategy hash_strategy = 9; 107 108 // hash_algorithm is the hash algorithm used by the tree. 109 HashAlgorithm hash_algorithm = 10; 110 111 // signature_algorithm is the signature algorithm used by the tree. 112 SignatureAlgorithm signature_algorithm = 11; 113 114 reserved 12; 115 116 // create_time_nanos is the creation timestamp of the tree, in nanos since 117 // epoch. 118 int64 create_time_nanos = 13; 119 120 // update_time_nanos is the last update time of the tree, in nanos since 121 // epoch. 122 int64 update_time_nanos = 14; 123 124 // private_key should be used to generate signatures for this tree. 125 google.protobuf.Any private_key = 15; 126 127 // public_key_der should be used to verify signatures produced by this tree. 128 // It is the key in DER-encoded PKIX form. 129 bytes public_key_der = 16; 130 131 // config contains the log or map specific tree configuration. 132 oneof storage_config { 133 LogStorageConfig log_storage_config = 6; 134 MapStorageConfig map_storage_config = 7; 135 } 136 137 // max_root_duration_millis is the interval after which a new signed root is 138 // produced even if there have been no submission. If zero, this behavior is 139 // disabled. 140 int64 max_root_duration_millis = 17; 141 142 // If true the tree was soft deleted. 143 bool deleted = 18; 144 145 // Time of tree deletion, if any. 146 int64 delete_time_nanos = 19; 147 } 148 149 // TreeHead is the storage format for Trillian's commitment to a particular 150 // tree state. 151 message TreeHead { 152 // tree_id identifies the tree this TreeHead is built from. 153 int64 tree_id = 1; 154 155 // ts_nanos is the nanosecond resolution timestamp at which the 156 // TreeHead was created. 157 int64 ts_nanos = 2; 158 159 // tree_size is the number of entries in the tree. 160 int64 tree_size = 3; 161 162 // root_hash is the root of the tree. 163 bytes root_hash = 4; 164 165 reserved 5; 166 167 // Deleted: old spannerpb.DigitallySigned 168 reserved 8; 169 // signature holds the raw digital signature across the serialized log_root 170 // (not present) represented by the data in this TreeHead. 171 bytes signature = 10; 172 173 // tree_revision identifies the revision at which the TreeHead was created. 174 int64 tree_revision = 6; 175 176 // metadata is a blob of opaque data specific to the personality layer that an 177 // application associates with each TreeHead, and which must be covered by the 178 // tree head signature. Only used for Maps at present. 179 reserved 7; 180 bytes metadata = 9; 181 }