Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Make the sync client content encoding a tunable #1076

Merged

Conversation

pmarkowsky
Copy link
Contributor

@pmarkowsky pmarkowsky commented Apr 21, 2023

This adds a new configuration option SyncClientContentEncoding which allows you to tweak the content encoding used by the sync client.

Currently this supports the following options:

Value Expected Behavior
"" (default) zlib compressed with Content-Encoding set to deflate
"gzip" gzip compressed requests with Content-Encoding set to gzip
"deflate" zlib compressed with Content-Encoding set to deflate
"none" Content is not compressed at all

⚠️ This also removes the EnableBackwardsCompatibleContentEncoding config option.

Testing

Tested with a hacked up version of moroz.

Headers when SyncClientContentEncoding is set to gzip

POST /v1/santa/preflight/<machine_id>
Host: santa:8080
Content-Type: application/json
Connection: keep-alive
Accept: */*
Content-Encoding: gzip
User-Agent: santactl-sync/9999.1.1
Content-Length: 402
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate

Headers when SyncClientContentEncoding is set to None

POST /v1/santa/preflight/<machine_id>
Host: santa:8080
Content-Type: application/json
Connection: keep-alive
Accept: */*
User-Agent: santactl-sync/9999.1.1
Content-Length: 536
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate

This makes the sync client's content encoding a tunable so that it can be
compatible with more sync servers.
@pmarkowsky pmarkowsky added the sync service Issues related to the sync service / protocol label Apr 21, 2023
@pmarkowsky pmarkowsky requested a review from a team as a code owner April 21, 2023 19:24
Source/common/SNTCommonEnums.h Outdated Show resolved Hide resolved
Source/common/SNTConfigurator.m Outdated Show resolved Hide resolved
Source/common/SNTConfigurator.m Outdated Show resolved Hide resolved
Source/santasyncservice/SNTSyncState.h Outdated Show resolved Hide resolved
Source/santasyncservice/SNTSyncStage.m Outdated Show resolved Hide resolved
Source/santasyncservice/SNTSyncState.h Outdated Show resolved Hide resolved
docs/deployment/configuration.md Outdated Show resolved Hide resolved
Source/common/SNTConfigurator.h Show resolved Hide resolved
pmarkowsky and others added 2 commits April 21, 2023 16:12
Co-authored-by: Russell Hancox <russellhancox@users.noreply.github.com>
Incorporated review feedback.

Removed the "backwards compatibility" config option.
Source/common/SNTCommonEnums.h Outdated Show resolved Hide resolved
@pmarkowsky pmarkowsky merged commit 7fc06ea into google:main Apr 24, 2023
@pmarkowsky pmarkowsky deleted the markowsky/sync-client-contentencoding-toggle branch April 24, 2023 13:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
sync service Issues related to the sync service / protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants