Signal-iOS/SignalServiceKit/protobuf
Evan Hahn 653cb30a59 Use reserved in protobufs
_This change should have no user impact._ And you can see that the only
changes to generated files are in comments.

Before this change, we used comments to denote reserved or deprecated
fields. This works, but I think we should instead use the `reserved`
keyword, which offers a few advantages. From [the protobuf docs][0]:

> If you update a message type by entirely removing a field, or
> commenting it out, future users can reuse the field number when making
> their own updates to the type. This can cause severe issues if they
> later load old versions of the same .proto, including data corruption,
> privacy bugs, and so on. One way to make sure this doesn't happen is
> to specify that the field numbers (and/or names, which can also cause
> issues for JSON serialization) of your deleted fields are reserved.
> The protocol buffer compiler will complain if any future users try to
> use these field identifiers.

This updates our proto files to use `reserved` instead of comments. It
also adds support to our wrapper script. (I moved a few things around in
that script, too, for consistency.)

I think this is a useful change on its own, but I think it'll make
things a little better when we deprecate some fields, which we're
planning to do soon.

[0]: https://developers.google.com/protocol-buffers/docs/proto3#reserved
2022-09-27 18:45:38 +00:00
..
ContactDiscovery.proto Generate CDS protos 2022-02-22 12:41:04 -08:00
DeviceTransfer.proto Device Transfer Service 2020-05-18 20:48:08 -07:00
Fingerprint.proto Respond to CR. 2018-08-03 14:03:02 -04:00
Groups.proto Use "modern" proto fields instead of presentation for incoming group changes 2022-09-20 10:44:42 -07:00
KeyBackup.proto Proto changes 2019-10-14 14:51:04 -07:00
Makefile Generate CDS protos 2022-02-22 12:41:04 -08:00
Provisioning.proto Add PNI-related fields to the ProvisioningMessage proto 2022-03-18 13:03:55 -07:00
README.md Fix typos 2022-03-18 11:31:06 -07:00
SessionRecord.proto SSK: Fix session migration for absent pre-key IDs 2021-01-28 12:03:50 -08:00
SignalIOS.proto Remove @required from proto enums. 2019-05-29 11:05:01 -04:00
SignalService.proto Use reserved in protobufs 2022-09-27 18:45:38 +00:00
StorageService.proto Show my story privacy settings the first time you send to my story 2022-09-27 10:06:01 -07:00
WebSocketResources.proto Remove @required from proto enums. 2019-05-29 11:05:01 -04:00

SignalServiceKit Protobufs

These protobuf definitions are copied from Signal-Android, but modified to match some iOS conventions.

Prerequisites

Install Apple's swift-protobuf (not the similarly named protobuf-swift)

brew install swift-protobuf

This should install an up to date protobuf package as a dependency. Note that since we use the legacy proto2 format, we need to specify this in our .proto files.

syntax = "proto2";

Building Protobuf

cd ~/src/WhisperSystems/SignalServiceKit/protobuf
make