Change the uint64 fields in the syncv1.proto to uint32 to ensure backwards compatibility.
This also updates the SNTSyncEventUpload code to use the uint32 values and updates sync protocol docs.
* sync: Drop rules_* fields in postflight to uint32
This lets the protobuf json serializer to send the values as ints (like NSJSONSerialization did) instead of strings. This will cause problems if someone has 4B rules but that's probably a sign of bigger problems
Disable the preserve_proto_field_names option when marshalling JSON requests as this prevents the json_name attribute on fields from working properly. Add that attribute to all fields so that they marshal as expected. Stop setting the always_print_enums_as_ints field as the value we're setting to is the default anyway.
Also add a test that preflight request data looks as expected.
* Improve default value handling for sync proto processing
* Fix capitalization of new enum values in comments
* Fix/add tests, update some docs
* Update more docs
* Lint
* Remove comment. Add LEGACY_NAMES tag for the linter
* Handle non-200 HTTP responses in SNTSyncStage performRequest
If we receive a non-200 HTTP response, we should return an error
instead of parsing the response to an empty protobuf message.
* Fix nil check
---------
Co-authored-by: Matt W <436037+mlw@users.noreply.github.com>
* Convert santa::santad::logs::endpoint_security::serializers::Utilities
* Convert santa::santad::logs::endpoint_security::writers
* Convert santa::santad::logs::endpoint_security::serializers
* Convert santa::santad::logs::endpoint_security and santatest
* Lint
* Change type alias names to not conflict with sysinfo.h
* WIP Basic new enriched types, hooked up serializers
* WIP Expanded enriched types, finished basic string logging
* WIP Standardize instigator and event user strings.
* WIP Remove sudo event for now. Fix proto types.
* Update proto field names. Fix builds on older SDKs.
* Fix more issues with builds on older SDKs.
* Even more build fixes for older SDKs
* Fix basic string test build on older sdks
* More fixes for older SDKs
* WIP Started on proto encoding and tests
* WIP expanded proto support for new events
* Lint. Fix recorder tests for missing event types
* WIP continued expanding proto support for new events
* WIP finished proto support for all new event types
* WIP Comment all new messages and fields in santa.proto
* WIP Use different impl to set strings to sidestep internal absl issues
* Temporarily removing serializer impls and tests to reduce PR size
* Lint fixes
* PR feedback
* Use new Apple docs link for global proxy settings constants
* Missed a file...
* WIP test workflow change
* WIP Fix link
* Remove trailing whitespace