Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New flag to scrub IP addresses #1161

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/decorators/EventPropertiesDecorator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace MAT_NS_BEGIN {
#define RECORD_FLAGS_EVENTTAG_HASH_PII 0x00100000
// #define MICROSOFT_EVENTTAG_DROP_PII 0x02000000
#define RECORD_FLAGS_EVENTTAG_DROP_PII 0x00200000
#define RECORD_FLAGS_EVENTTAG_SCRUB_IP 0x00400000

class EventPropertiesDecorator : public IDecorator
{
Expand Down Expand Up @@ -125,6 +126,8 @@ namespace MAT_NS_BEGIN {
int64_t tags = eventProperties.GetPolicyBitFlags();
int64_t flags = 0;

// Scrub/obfuscate IP addresses.
flags = RECORD_FLAGS_EVENTTAG_SCRUB_IP;
// We must remap from one bitfield set to another, no way to bit-shift :(
// At the moment 1DS SDK in direct upload mode supports DROP and MARK tags only:
flags |= (tags & MICROSOFT_EVENTTAG_MARK_PII) ? RECORD_FLAGS_EVENTTAG_MARK_PII : 0;
Expand Down
Loading