privacy

package
v0.203.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2022 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnabledPolicyEnforcer

type EnabledPolicyEnforcer struct {
	Enabled        bool
	PolicyEnforcer PolicyEnforcer
}

EnabledPolicyEnforcer decorates a PolicyEnforcer with an enabled flag.

func (EnabledPolicyEnforcer) CanEnforce

func (p EnabledPolicyEnforcer) CanEnforce() bool

CanEnforce returns true when the PolicyEnforcer can enforce.

func (EnabledPolicyEnforcer) ShouldEnforce

func (p EnabledPolicyEnforcer) ShouldEnforce(bidder string) bool

ShouldEnforce returns true when the enforcer is enabled the PolicyEnforcer allows enforcement.

type Enforcement

type Enforcement struct {
	CCPA    bool
	COPPA   bool
	GDPRGeo bool
	GDPRID  bool
	LMT     bool
}

Enforcement represents the privacy policies to enforce for an OpenRTB bid request.

func (Enforcement) Any

func (e Enforcement) Any() bool

Any returns true if at least one privacy policy requires enforcement.

func (Enforcement) Apply

func (e Enforcement) Apply(bidRequest *openrtb2.BidRequest)

Apply cleans personally identifiable information from an OpenRTB bid request.

type NilPolicyEnforcer

type NilPolicyEnforcer struct{}

NilPolicyEnforcer implements the PolicyEnforcer interface but will always return false.

func (NilPolicyEnforcer) CanEnforce

func (NilPolicyEnforcer) CanEnforce() bool

CanEnforce is hardcoded to always return false.

func (NilPolicyEnforcer) ShouldEnforce

func (NilPolicyEnforcer) ShouldEnforce(bidder string) bool

ShouldEnforce is hardcoded to always return false.

type NilPolicyWriter

type NilPolicyWriter struct{}

NilPolicyWriter implements the PolicyWriter interface but performs no action.

func (NilPolicyWriter) Write

Write is hardcoded to perform no action with the OpenRTB bid request.

type Policies

type Policies struct {
	CCPA ccpa.Policy
	GDPR gdpr.Policy
	LMT  lmt.Policy
}

Policies represents the privacy regulations for an OpenRTB bid request.

type PolicyEnforcer

type PolicyEnforcer interface {
	// CanEnforce returns true when policy information is specifically provided by the publisher.
	CanEnforce() bool

	// ShouldEnforce returns true when the OpenRTB request should have personally identifiable
	// information (PII) removed or anonymized per the policy.
	ShouldEnforce(bidder string) bool
}

PolicyEnforcer determines if personally identifiable information (PII) should be removed or anonymized per the policy.

type PolicyWriter

type PolicyWriter interface {
	Write(req *openrtb2.BidRequest) error
}

PolicyWriter mutates an OpenRTB bid request with a policy's regulatory information.

type ScrubStrategyDeviceID

type ScrubStrategyDeviceID int

ScrubStrategyDeviceID defines the approach to remove hardware id and device id data.

const (
	// ScrubStrategyDeviceIDNone does not remove hardware id and device id data.
	ScrubStrategyDeviceIDNone ScrubStrategyDeviceID = iota

	// ScrubStrategyDeviceIDAll removes all hardware and device id data (ifa, mac hashes device id hashes)
	ScrubStrategyDeviceIDAll
)

type ScrubStrategyGeo

type ScrubStrategyGeo int

ScrubStrategyGeo defines the approach to scrub PII from geographical data.

const (
	// ScrubStrategyGeoNone does not remove any geographical data.
	ScrubStrategyGeoNone ScrubStrategyGeo = iota

	// ScrubStrategyGeoFull removes all geographical data.
	ScrubStrategyGeoFull

	// ScrubStrategyGeoReducedPrecision anonymizes geographical data with rounding.
	ScrubStrategyGeoReducedPrecision
)

type ScrubStrategyIPV4

type ScrubStrategyIPV4 int

ScrubStrategyIPV4 defines the approach to scrub PII from an IPV4 address.

const (
	// ScrubStrategyIPV4None does not remove any part of an IPV4 address.
	ScrubStrategyIPV4None ScrubStrategyIPV4 = iota

	// ScrubStrategyIPV4Lowest8 zeroes out the last 8 bits of an IPV4 address.
	ScrubStrategyIPV4Lowest8
)

type ScrubStrategyIPV6

type ScrubStrategyIPV6 int

ScrubStrategyIPV6 defines the approach to scrub PII from an IPV6 address.

const (
	// ScrubStrategyIPV6None does not remove any part of an IPV6 address.
	ScrubStrategyIPV6None ScrubStrategyIPV6 = iota

	// ScrubStrategyIPV6Lowest16 zeroes out the last 16 bits of an IPV6 address.
	ScrubStrategyIPV6Lowest16

	// ScrubStrategyIPV6Lowest32 zeroes out the last 32 bits of an IPV6 address.
	ScrubStrategyIPV6Lowest32
)

type ScrubStrategyUser

type ScrubStrategyUser int

ScrubStrategyUser defines the approach to scrub PII from user data.

const (
	// ScrubStrategyUserNone does not remove non-location data.
	ScrubStrategyUserNone ScrubStrategyUser = iota

	// ScrubStrategyUserIDAndDemographic removes the user's buyer id, exchange id year of birth, and gender.
	ScrubStrategyUserIDAndDemographic

	// ScrubStrategyUserID removes the user's buyer id.
	ScrubStrategyUserID
)

type Scrubber

type Scrubber interface {
	ScrubDevice(device *openrtb2.Device, id ScrubStrategyDeviceID, ipv4 ScrubStrategyIPV4, ipv6 ScrubStrategyIPV6, geo ScrubStrategyGeo) *openrtb2.Device
	ScrubUser(user *openrtb2.User, strategy ScrubStrategyUser, geo ScrubStrategyGeo) *openrtb2.User
}

Scrubber removes PII from parts of an OpenRTB request.

func NewScrubber

func NewScrubber() Scrubber

NewScrubber returns an OpenRTB scrubber.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL