grpc-tools 1.56.2 → 1.64.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab8d2fbaaca78b23ab101fc5b459fa9f51736f1efe0413d4970e6a7e62377b12
4
- data.tar.gz: 7f1e8d23ee113d9e7a06814c23d7097b350869d37453b3aeccc07641dcc369f6
3
+ metadata.gz: 68aa14436341f40a20a99f3fd252edd842f0b1697b0f06a2c84f2e705038102a
4
+ data.tar.gz: 3aa3b30c69b9cc7da0b95c944dd259554a86a30344da87844b84fb98aebdaf78
5
5
  SHA512:
6
- metadata.gz: 31414796a0b1a9d45da300cc7e91026dcc79b4307a8a1d6305bc2aa9946b390af6671236331c6e99e127fc9f0a4dbe921f0ee79ce84dcab2282944eb2017e0bb
7
- data.tar.gz: e5a153b8916d61318bef2689bd56854dc9d94ddbb617e73e1155e8cb4eec3329602591db5e8b992739bd8c0f954533db18aaa28d6b757b6c550d894a0bd3f201
6
+ metadata.gz: c81cd8893c358355cf7db22cbc23747e6326300c3511cb96fb1f915bdbf9bdd404a5b9d504f182de5b2fa99708561bd70abcdf1702794f3329d568a4523851eb
7
+ data.tar.gz: a564a2db697dcf08023140baeb70c783a88038dee0b7974ef4abf12cd150d4dff4326e5956c75de9acf7902bf6039b9f90c7b7e0e461778a6eb939ee50ae5263
@@ -149,7 +149,8 @@ message Any {
149
149
  //
150
150
  // Note: this functionality is not currently available in the official
151
151
  // protobuf release, and it is not used for type URLs beginning with
152
- // type.googleapis.com.
152
+ // type.googleapis.com. As of May 2023, there are no widely used type server
153
+ // implementations and no plans to implement one.
153
154
  //
154
155
  // Schemes other than `http`, `https` (or the empty scheme) might be
155
156
  // used with implementation specific semantics.
@@ -1,32 +1,9 @@
1
1
  // Protocol Buffers - Google's data interchange format
2
2
  // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
3
  //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file or at
6
+ // https://developers.google.com/open-source/licenses/bsd
30
7
 
31
8
  // Author: kenton@google.com (Kenton Varda)
32
9
  //
@@ -76,6 +53,11 @@ message CodeGeneratorRequest {
76
53
  // they import. The files will appear in topological order, so each file
77
54
  // appears before any file that imports it.
78
55
  //
56
+ // Note: the files listed in files_to_generate will include runtime-retention
57
+ // options only, but all other files will include source-retention options.
58
+ // The source_file_descriptors field below is available in case you need
59
+ // source-retention options for files_to_generate.
60
+ //
79
61
  // protoc guarantees that all proto_files will be written after
80
62
  // the fields above, even though this is not technically guaranteed by the
81
63
  // protobuf wire format. This theoretically could allow a plugin to stream
@@ -88,6 +70,11 @@ message CodeGeneratorRequest {
88
70
  // fully qualified.
89
71
  repeated FileDescriptorProto proto_file = 15;
90
72
 
73
+ // File descriptors with all options, including source-retention options.
74
+ // These descriptors are only provided for the files listed in
75
+ // files_to_generate.
76
+ repeated FileDescriptorProto source_file_descriptors = 17;
77
+
91
78
  // The version number of protocol compiler.
92
79
  optional Version compiler_version = 3;
93
80
  }
@@ -112,8 +99,21 @@ message CodeGeneratorResponse {
112
99
  enum Feature {
113
100
  FEATURE_NONE = 0;
114
101
  FEATURE_PROTO3_OPTIONAL = 1;
102
+ FEATURE_SUPPORTS_EDITIONS = 2;
115
103
  }
116
104
 
105
+ // The minimum edition this plugin supports. This will be treated as an
106
+ // Edition enum, but we want to allow unknown values. It should be specified
107
+ // according the edition enum value, *not* the edition number. Only takes
108
+ // effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
109
+ optional int32 minimum_edition = 3;
110
+
111
+ // The maximum edition this plugin supports. This will be treated as an
112
+ // Edition enum, but we want to allow unknown values. It should be specified
113
+ // according the edition enum value, *not* the edition number. Only takes
114
+ // effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
115
+ optional int32 maximum_edition = 4;
116
+
117
117
  // Represents a single generated file.
118
118
  message File {
119
119
  // The file name, relative to the output directory. The name must not
@@ -57,6 +57,38 @@ message FileDescriptorSet {
57
57
  repeated FileDescriptorProto file = 1;
58
58
  }
59
59
 
60
+ // The full set of known editions.
61
+ enum Edition {
62
+ // A placeholder for an unknown edition value.
63
+ EDITION_UNKNOWN = 0;
64
+
65
+ // Legacy syntax "editions". These pre-date editions, but behave much like
66
+ // distinct editions. These can't be used to specify the edition of proto
67
+ // files, but feature definitions must supply proto2/proto3 defaults for
68
+ // backwards compatibility.
69
+ EDITION_PROTO2 = 998;
70
+ EDITION_PROTO3 = 999;
71
+
72
+ // Editions that have been released. The specific values are arbitrary and
73
+ // should not be depended on, but they will always be time-ordered for easy
74
+ // comparison.
75
+ EDITION_2023 = 1000;
76
+ EDITION_2024 = 1001;
77
+
78
+ // Placeholder editions for testing feature resolution. These should not be
79
+ // used or relyed on outside of tests.
80
+ EDITION_1_TEST_ONLY = 1;
81
+ EDITION_2_TEST_ONLY = 2;
82
+ EDITION_99997_TEST_ONLY = 99997;
83
+ EDITION_99998_TEST_ONLY = 99998;
84
+ EDITION_99999_TEST_ONLY = 99999;
85
+
86
+ // Placeholder for specifying unbounded edition support. This should only
87
+ // ever be used by plugins that can expect to never require any changes to
88
+ // support a new edition.
89
+ EDITION_MAX = 0x7FFFFFFF;
90
+ }
91
+
60
92
  // Describes a complete .proto file.
61
93
  message FileDescriptorProto {
62
94
  optional string name = 1; // file name, relative to root of source tree
@@ -90,8 +122,8 @@ message FileDescriptorProto {
90
122
  // If `edition` is present, this value must be "editions".
91
123
  optional string syntax = 12;
92
124
 
93
- // The edition of the proto file, which is an opaque string.
94
- optional string edition = 13;
125
+ // The edition of the proto file.
126
+ optional Edition edition = 14;
95
127
  }
96
128
 
97
129
  // Describes a message type.
@@ -146,9 +178,6 @@ message ExtensionRangeOptions {
146
178
  // and enums.
147
179
  optional string type = 3;
148
180
 
149
- // Deprecated. Please use "repeated".
150
- optional bool is_repeated = 4 [deprecated = true];
151
-
152
181
  // If true, indicates that the number is reserved in the extension range,
153
182
  // and any extension field with the number will fail to compile. Set this
154
183
  // when a declared extension field is deleted.
@@ -157,14 +186,18 @@ message ExtensionRangeOptions {
157
186
  // If true, indicates that the extension must be defined as repeated.
158
187
  // Otherwise the extension must be defined as optional.
159
188
  optional bool repeated = 6;
189
+
190
+ reserved 4; // removed is_repeated
160
191
  }
161
192
 
162
- // go/protobuf-stripping-extension-declarations
163
- // Like Metadata, but we use a repeated field to hold all extension
164
- // declarations. This should avoid the size increases of transforming a large
165
- // extension range into small ranges in generated binaries.
193
+ // For external users: DO NOT USE. We are in the process of open sourcing
194
+ // extension declaration and executing internal cleanups before it can be
195
+ // used externally.
166
196
  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];
167
197
 
198
+ // Any features defined in the specific edition.
199
+ optional FeatureSet features = 50;
200
+
168
201
  // The verification state of the extension range.
169
202
  enum VerificationState {
170
203
  // All the extensions of the range must be declared.
@@ -173,9 +206,10 @@ message ExtensionRangeOptions {
173
206
  }
174
207
 
175
208
  // The verification state of the range.
176
- // TODO(b/278783756): flip the default to DECLARATION once all empty ranges
209
+ // TODO: flip the default to DECLARATION once all empty ranges
177
210
  // are marked as UNVERIFIED.
178
- optional VerificationState verification = 3 [default = UNVERIFIED];
211
+ optional VerificationState verification = 3
212
+ [default = UNVERIFIED, retention = RETENTION_SOURCE];
179
213
 
180
214
  // Clients can define custom options in extensions of this message. See above.
181
215
  extensions 1000 to max;
@@ -200,9 +234,10 @@ message FieldDescriptorProto {
200
234
  TYPE_BOOL = 8;
201
235
  TYPE_STRING = 9;
202
236
  // Tag-delimited aggregate.
203
- // Group type is deprecated and not supported in proto3. However, Proto3
237
+ // Group type is deprecated and not supported after google.protobuf. However, Proto3
204
238
  // implementations should still be able to parse the group wire format and
205
- // treat group fields as unknown fields.
239
+ // treat group fields as unknown fields. In Editions, the group wire format
240
+ // can be enabled via the `message_encoding` feature.
206
241
  TYPE_GROUP = 10;
207
242
  TYPE_MESSAGE = 11; // Length-delimited aggregate.
208
243
 
@@ -219,8 +254,11 @@ message FieldDescriptorProto {
219
254
  enum Label {
220
255
  // 0 is reserved for errors
221
256
  LABEL_OPTIONAL = 1;
222
- LABEL_REQUIRED = 2;
223
257
  LABEL_REPEATED = 3;
258
+ // The required label is only allowed in google.protobuf. In proto3 and Editions
259
+ // it's explicitly prohibited. In Editions, the `field_presence` feature
260
+ // can be used to get this behavior.
261
+ LABEL_REQUIRED = 2;
224
262
  }
225
263
 
226
264
  optional string name = 1;
@@ -263,12 +301,12 @@ message FieldDescriptorProto {
263
301
  // If true, this is a proto3 "optional". When a proto3 field is optional, it
264
302
  // tracks presence regardless of field type.
265
303
  //
266
- // When proto3_optional is true, this field must be belong to a oneof to
267
- // signal to old proto3 clients that presence is tracked for this field. This
268
- // oneof is known as a "synthetic" oneof, and this field must be its sole
269
- // member (each proto3 optional field gets its own synthetic oneof). Synthetic
270
- // oneofs exist in the descriptor only, and do not generate any API. Synthetic
271
- // oneofs must be ordered after all "real" oneofs.
304
+ // When proto3_optional is true, this field must belong to a oneof to signal
305
+ // to old proto3 clients that presence is tracked for this field. This oneof
306
+ // is known as a "synthetic" oneof, and this field must be its sole member
307
+ // (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs
308
+ // exist in the descriptor only, and do not generate any API. Synthetic oneofs
309
+ // must be ordered after all "real" oneofs.
272
310
  //
273
311
  // For message fields, proto3_optional doesn't create any semantic change,
274
312
  // since non-repeated message fields always track presence. However it still
@@ -447,7 +485,7 @@ message FileOptions {
447
485
  optional bool cc_generic_services = 16 [default = false];
448
486
  optional bool java_generic_services = 17 [default = false];
449
487
  optional bool py_generic_services = 18 [default = false];
450
- optional bool php_generic_services = 42 [default = false];
488
+ reserved 42; // removed php_generic_services
451
489
 
452
490
  // Is this file deprecated?
453
491
  // Depending on the target platform, this can emit Deprecated annotations
@@ -491,6 +529,9 @@ message FileOptions {
491
529
  // determining the ruby package.
492
530
  optional string ruby_package = 45;
493
531
 
532
+ // Any features defined in the specific edition.
533
+ optional FeatureSet features = 50;
534
+
494
535
  // The parser stores options it doesn't recognize here.
495
536
  // See the documentation for the "Options" section above.
496
537
  repeated UninterpretedOption uninterpreted_option = 999;
@@ -536,10 +577,6 @@ message MessageOptions {
536
577
 
537
578
  reserved 4, 5, 6;
538
579
 
539
- // NOTE: Do not set the option in .proto files. Always use the maps syntax
540
- // instead. The option should only be implicitly set by the proto compiler
541
- // parser.
542
- //
543
580
  // Whether the message is an automatically generated map entry type for the
544
581
  // maps field.
545
582
  //
@@ -557,6 +594,10 @@ message MessageOptions {
557
594
  // use a native map in the target language to hold the keys and values.
558
595
  // The reflection APIs in such implementations still need to work as
559
596
  // if the field is a repeated message field.
597
+ //
598
+ // NOTE: Do not set the option in .proto files. Always use the maps syntax
599
+ // instead. The option should only be implicitly set by the proto compiler
600
+ // parser.
560
601
  optional bool map_entry = 7;
561
602
 
562
603
  reserved 8; // javalite_serializable
@@ -570,10 +611,13 @@ message MessageOptions {
570
611
  // This should only be used as a temporary measure against broken builds due
571
612
  // to the change in behavior for JSON field name conflicts.
572
613
  //
573
- // TODO(b/261750190) This is legacy behavior we plan to remove once downstream
614
+ // TODO This is legacy behavior we plan to remove once downstream
574
615
  // teams have had time to migrate.
575
616
  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];
576
617
 
618
+ // Any features defined in the specific edition.
619
+ optional FeatureSet features = 12;
620
+
577
621
  // The parser stores options it doesn't recognize here. See above.
578
622
  repeated UninterpretedOption uninterpreted_option = 999;
579
623
 
@@ -607,7 +651,9 @@ message FieldOptions {
607
651
  // a more efficient representation on the wire. Rather than repeatedly
608
652
  // writing the tag and type for each element, the entire array is encoded as
609
653
  // a single length-delimited blob. In proto3, only explicit setting it to
610
- // false will avoid using packed encoding.
654
+ // false will avoid using packed encoding. This option is prohibited in
655
+ // Editions, but the `repeated_field_encoding` feature can be used to control
656
+ // the behavior.
611
657
  optional bool packed = 2;
612
658
 
613
659
  // The jstype option determines the JavaScript type used for values of the
@@ -650,19 +696,11 @@ message FieldOptions {
650
696
  // call from multiple threads concurrently, while non-const methods continue
651
697
  // to require exclusive access.
652
698
  //
653
- // Note that implementations may choose not to check required fields within
654
- // a lazy sub-message. That is, calling IsInitialized() on the outer message
655
- // may return true even if the inner message has missing required fields.
656
- // This is necessary because otherwise the inner message would have to be
657
- // parsed in order to perform the check, defeating the purpose of lazy
658
- // parsing. An implementation which chooses not to check required fields
659
- // must be consistent about it. That is, for any particular sub-message, the
660
- // implementation must either *always* check its required fields, or *never*
661
- // check its required fields, regardless of whether or not the message has
662
- // been parsed.
663
- //
664
- // As of May 2022, lazy verifies the contents of the byte stream during
665
- // parsing. An invalid byte stream will cause the overall parsing to fail.
699
+ // Note that lazy message fields are still eagerly verified to check
700
+ // ill-formed wireformat or missing required fields. Calling IsInitialized()
701
+ // on the outer message would fail if the inner message has missing required
702
+ // fields. Failed verification would result in parsing failure (except when
703
+ // uninitialized messages are acceptable).
666
704
  optional bool lazy = 5 [default = false];
667
705
 
668
706
  // unverified_lazy does no correctness checks on the byte stream. This should
@@ -711,19 +749,31 @@ message FieldOptions {
711
749
  TARGET_TYPE_METHOD = 9;
712
750
  }
713
751
 
714
- optional OptionTargetType target = 18 [deprecated = true];
715
752
  repeated OptionTargetType targets = 19;
716
753
 
754
+ message EditionDefault {
755
+ optional Edition edition = 3;
756
+ optional string value = 2; // Textproto value.
757
+ }
758
+ repeated EditionDefault edition_defaults = 20;
759
+
760
+ // Any features defined in the specific edition.
761
+ optional FeatureSet features = 21;
762
+
717
763
  // The parser stores options it doesn't recognize here. See above.
718
764
  repeated UninterpretedOption uninterpreted_option = 999;
719
765
 
720
766
  // Clients can define custom options in extensions of this message. See above.
721
767
  extensions 1000 to max;
722
768
 
723
- reserved 4; // removed jtype
769
+ reserved 4; // removed jtype
770
+ reserved 18; // reserve target, target_obsolete_do_not_use
724
771
  }
725
772
 
726
773
  message OneofOptions {
774
+ // Any features defined in the specific edition.
775
+ optional FeatureSet features = 1;
776
+
727
777
  // The parser stores options it doesn't recognize here. See above.
728
778
  repeated UninterpretedOption uninterpreted_option = 999;
729
779
 
@@ -749,10 +799,13 @@ message EnumOptions {
749
799
  // and strips underscored from the fields before comparison in proto3 only.
750
800
  // The new behavior takes `json_name` into account and applies to proto2 as
751
801
  // well.
752
- // TODO(b/261750190) Remove this legacy behavior once downstream teams have
802
+ // TODO Remove this legacy behavior once downstream teams have
753
803
  // had time to migrate.
754
804
  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];
755
805
 
806
+ // Any features defined in the specific edition.
807
+ optional FeatureSet features = 7;
808
+
756
809
  // The parser stores options it doesn't recognize here. See above.
757
810
  repeated UninterpretedOption uninterpreted_option = 999;
758
811
 
@@ -767,6 +820,14 @@ message EnumValueOptions {
767
820
  // this is a formalization for deprecating enum values.
768
821
  optional bool deprecated = 1 [default = false];
769
822
 
823
+ // Any features defined in the specific edition.
824
+ optional FeatureSet features = 2;
825
+
826
+ // Indicate that fields annotated with this enum value should not be printed
827
+ // out when using debug formats, e.g. when the field contains sensitive
828
+ // credentials.
829
+ optional bool debug_redact = 3 [default = false];
830
+
770
831
  // The parser stores options it doesn't recognize here. See above.
771
832
  repeated UninterpretedOption uninterpreted_option = 999;
772
833
 
@@ -776,6 +837,9 @@ message EnumValueOptions {
776
837
 
777
838
  message ServiceOptions {
778
839
 
840
+ // Any features defined in the specific edition.
841
+ optional FeatureSet features = 34;
842
+
779
843
  // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
780
844
  // framework. We apologize for hoarding these numbers to ourselves, but
781
845
  // we were already using them long before we decided to release Protocol
@@ -818,6 +882,9 @@ message MethodOptions {
818
882
  optional IdempotencyLevel idempotency_level = 34
819
883
  [default = IDEMPOTENCY_UNKNOWN];
820
884
 
885
+ // Any features defined in the specific edition.
886
+ optional FeatureSet features = 35;
887
+
821
888
  // The parser stores options it doesn't recognize here. See above.
822
889
  repeated UninterpretedOption uninterpreted_option = 999;
823
890
 
@@ -853,6 +920,130 @@ message UninterpretedOption {
853
920
  optional string aggregate_value = 8;
854
921
  }
855
922
 
923
+ // ===================================================================
924
+ // Features
925
+
926
+ // TODO Enums in C++ gencode (and potentially other languages) are
927
+ // not well scoped. This means that each of the feature enums below can clash
928
+ // with each other. The short names we've chosen maximize call-site
929
+ // readability, but leave us very open to this scenario. A future feature will
930
+ // be designed and implemented to handle this, hopefully before we ever hit a
931
+ // conflict here.
932
+ message FeatureSet {
933
+ enum FieldPresence {
934
+ FIELD_PRESENCE_UNKNOWN = 0;
935
+ EXPLICIT = 1;
936
+ IMPLICIT = 2;
937
+ LEGACY_REQUIRED = 3;
938
+ }
939
+ optional FieldPresence field_presence = 1 [
940
+ retention = RETENTION_RUNTIME,
941
+ targets = TARGET_TYPE_FIELD,
942
+ targets = TARGET_TYPE_FILE,
943
+ edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" },
944
+ edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" },
945
+ edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" }
946
+ ];
947
+
948
+ enum EnumType {
949
+ ENUM_TYPE_UNKNOWN = 0;
950
+ OPEN = 1;
951
+ CLOSED = 2;
952
+ }
953
+ optional EnumType enum_type = 2 [
954
+ retention = RETENTION_RUNTIME,
955
+ targets = TARGET_TYPE_ENUM,
956
+ targets = TARGET_TYPE_FILE,
957
+ edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" },
958
+ edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" }
959
+ ];
960
+
961
+ enum RepeatedFieldEncoding {
962
+ REPEATED_FIELD_ENCODING_UNKNOWN = 0;
963
+ PACKED = 1;
964
+ EXPANDED = 2;
965
+ }
966
+ optional RepeatedFieldEncoding repeated_field_encoding = 3 [
967
+ retention = RETENTION_RUNTIME,
968
+ targets = TARGET_TYPE_FIELD,
969
+ targets = TARGET_TYPE_FILE,
970
+ edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" },
971
+ edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" }
972
+ ];
973
+
974
+ enum Utf8Validation {
975
+ UTF8_VALIDATION_UNKNOWN = 0;
976
+ VERIFY = 2;
977
+ NONE = 3;
978
+ }
979
+ optional Utf8Validation utf8_validation = 4 [
980
+ retention = RETENTION_RUNTIME,
981
+ targets = TARGET_TYPE_FIELD,
982
+ targets = TARGET_TYPE_FILE,
983
+ edition_defaults = { edition: EDITION_PROTO2, value: "NONE" },
984
+ edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" }
985
+ ];
986
+
987
+ enum MessageEncoding {
988
+ MESSAGE_ENCODING_UNKNOWN = 0;
989
+ LENGTH_PREFIXED = 1;
990
+ DELIMITED = 2;
991
+ }
992
+ optional MessageEncoding message_encoding = 5 [
993
+ retention = RETENTION_RUNTIME,
994
+ targets = TARGET_TYPE_FIELD,
995
+ targets = TARGET_TYPE_FILE,
996
+ edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" }
997
+ ];
998
+
999
+ enum JsonFormat {
1000
+ JSON_FORMAT_UNKNOWN = 0;
1001
+ ALLOW = 1;
1002
+ LEGACY_BEST_EFFORT = 2;
1003
+ }
1004
+ optional JsonFormat json_format = 6 [
1005
+ retention = RETENTION_RUNTIME,
1006
+ targets = TARGET_TYPE_MESSAGE,
1007
+ targets = TARGET_TYPE_ENUM,
1008
+ targets = TARGET_TYPE_FILE,
1009
+ edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" },
1010
+ edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" }
1011
+ ];
1012
+
1013
+ reserved 999;
1014
+
1015
+ extensions 1000; // for Protobuf C++
1016
+ extensions 1001; // for Protobuf Java
1017
+ extensions 1002; // for Protobuf Go
1018
+
1019
+ extensions 9995 to 9999; // For internal testing
1020
+ extensions 10000; // for https://github.com/bufbuild/protobuf-es
1021
+ }
1022
+
1023
+ // A compiled specification for the defaults of a set of features. These
1024
+ // messages are generated from FeatureSet extensions and can be used to seed
1025
+ // feature resolution. The resolution with this object becomes a simple search
1026
+ // for the closest matching edition, followed by proto merges.
1027
+ message FeatureSetDefaults {
1028
+ // A map from every known edition with a unique set of defaults to its
1029
+ // defaults. Not all editions may be contained here. For a given edition,
1030
+ // the defaults at the closest matching edition ordered at or before it should
1031
+ // be used. This field must be in strict ascending order by edition.
1032
+ message FeatureSetEditionDefault {
1033
+ optional Edition edition = 3;
1034
+ optional FeatureSet features = 2;
1035
+ }
1036
+ repeated FeatureSetEditionDefault defaults = 1;
1037
+
1038
+ // The minimum supported edition (inclusive) when this was constructed.
1039
+ // Editions before this will not have defaults.
1040
+ optional Edition minimum_edition = 4;
1041
+
1042
+ // The maximum known edition (inclusive) when this was constructed. Editions
1043
+ // after this will not have reliable defaults.
1044
+ optional Edition maximum_edition = 5;
1045
+ }
1046
+
856
1047
  // ===================================================================
857
1048
  // Optional source code info
858
1049
 
@@ -908,7 +1099,7 @@ message SourceCodeInfo {
908
1099
  // location.
909
1100
  //
910
1101
  // Each element is a field number or an index. They form a path from
911
- // the root FileDescriptorProto to the place where the definition occurs.
1102
+ // the root FileDescriptorProto to the place where the definition appears.
912
1103
  // For example, this path:
913
1104
  // [ 4, 3, 2, 7, 1 ]
914
1105
  // refers to:
Binary file
data/bin/x86-linux/protoc CHANGED
Binary file
@@ -149,7 +149,8 @@ message Any {
149
149
  //
150
150
  // Note: this functionality is not currently available in the official
151
151
  // protobuf release, and it is not used for type URLs beginning with
152
- // type.googleapis.com.
152
+ // type.googleapis.com. As of May 2023, there are no widely used type server
153
+ // implementations and no plans to implement one.
153
154
  //
154
155
  // Schemes other than `http`, `https` (or the empty scheme) might be
155
156
  // used with implementation specific semantics.
@@ -1,32 +1,9 @@
1
1
  // Protocol Buffers - Google's data interchange format
2
2
  // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
3
  //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file or at
6
+ // https://developers.google.com/open-source/licenses/bsd
30
7
 
31
8
  // Author: kenton@google.com (Kenton Varda)
32
9
  //
@@ -76,6 +53,11 @@ message CodeGeneratorRequest {
76
53
  // they import. The files will appear in topological order, so each file
77
54
  // appears before any file that imports it.
78
55
  //
56
+ // Note: the files listed in files_to_generate will include runtime-retention
57
+ // options only, but all other files will include source-retention options.
58
+ // The source_file_descriptors field below is available in case you need
59
+ // source-retention options for files_to_generate.
60
+ //
79
61
  // protoc guarantees that all proto_files will be written after
80
62
  // the fields above, even though this is not technically guaranteed by the
81
63
  // protobuf wire format. This theoretically could allow a plugin to stream
@@ -88,6 +70,11 @@ message CodeGeneratorRequest {
88
70
  // fully qualified.
89
71
  repeated FileDescriptorProto proto_file = 15;
90
72
 
73
+ // File descriptors with all options, including source-retention options.
74
+ // These descriptors are only provided for the files listed in
75
+ // files_to_generate.
76
+ repeated FileDescriptorProto source_file_descriptors = 17;
77
+
91
78
  // The version number of protocol compiler.
92
79
  optional Version compiler_version = 3;
93
80
  }
@@ -112,8 +99,21 @@ message CodeGeneratorResponse {
112
99
  enum Feature {
113
100
  FEATURE_NONE = 0;
114
101
  FEATURE_PROTO3_OPTIONAL = 1;
102
+ FEATURE_SUPPORTS_EDITIONS = 2;
115
103
  }
116
104
 
105
+ // The minimum edition this plugin supports. This will be treated as an
106
+ // Edition enum, but we want to allow unknown values. It should be specified
107
+ // according the edition enum value, *not* the edition number. Only takes
108
+ // effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
109
+ optional int32 minimum_edition = 3;
110
+
111
+ // The maximum edition this plugin supports. This will be treated as an
112
+ // Edition enum, but we want to allow unknown values. It should be specified
113
+ // according the edition enum value, *not* the edition number. Only takes
114
+ // effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
115
+ optional int32 maximum_edition = 4;
116
+
117
117
  // Represents a single generated file.
118
118
  message File {
119
119
  // The file name, relative to the output directory. The name must not