privacy

package
v0.275.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ComponentTypeBidder       = "bidder"
	ComponentTypeAnalytics    = "analytics"
	ComponentTypeRealTimeData = "rtd"
	ComponentTypeGeneral      = "general"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity added in v0.256.0

type Activity int

Activity defines Prebid Server actions which can be controlled directly by the publisher or via privacy policies.

const (
	ActivitySyncUser Activity = iota + 1
	ActivityFetchBids
	ActivityEnrichUserFPD
	ActivityReportAnalytics
	ActivityTransmitUserFPD
	ActivityTransmitPreciseGeo
	ActivityTransmitUniqueRequestIDs
	ActivityTransmitTIDs
)

func (Activity) String added in v0.256.0

func (a Activity) String() string

type ActivityControl added in v0.263.0

type ActivityControl struct {
	// contains filtered or unexported fields
}

func NewActivityControl added in v0.263.0

func NewActivityControl(cfg *config.AccountPrivacy) ActivityControl

func (ActivityControl) Allow added in v0.263.0

func (e ActivityControl) Allow(activity Activity, target Component, request ActivityRequest) bool

type ActivityPlan added in v0.263.0

type ActivityPlan struct {
	// contains filtered or unexported fields
}

func (ActivityPlan) Evaluate added in v0.268.0

func (p ActivityPlan) Evaluate(target Component, request ActivityRequest) bool

type ActivityRequest added in v0.274.0

type ActivityRequest struct {
	// contains filtered or unexported fields
}

func NewRequestFromBidRequest added in v0.274.0

func NewRequestFromBidRequest(r openrtb_ext.RequestWrapper) ActivityRequest

func NewRequestFromPolicies added in v0.274.0

func NewRequestFromPolicies(p Policies) ActivityRequest

func (ActivityRequest) IsBidRequest added in v0.274.0

func (r ActivityRequest) IsBidRequest() bool

func (ActivityRequest) IsPolicies added in v0.274.0

func (r ActivityRequest) IsPolicies() bool

type ActivityResult added in v0.263.0

type ActivityResult int
const (
	ActivityAbstain ActivityResult = iota
	ActivityAllow
	ActivityDeny
)

type Component added in v0.271.0

type Component struct {
	Type string
	Name string
}

func (Component) MatchesName added in v0.274.0

func (c Component) MatchesName(v string) bool

func (Component) MatchesType added in v0.274.0

func (c Component) MatchesType(v string) bool

type ConditionRule added in v0.274.0

type ConditionRule struct {
	// contains filtered or unexported fields
}

func (ConditionRule) Evaluate added in v0.274.0

func (r ConditionRule) Evaluate(target Component, request ActivityRequest) ActivityResult

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

	// activities
	UFPD       bool
	Eids       bool
	PreciseGeo bool
	TID        bool
}

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

func (Enforcement) AnyActivities added in v0.267.0

func (e Enforcement) AnyActivities() bool

func (Enforcement) AnyLegacy added in v0.267.0

func (e Enforcement) AnyLegacy() bool

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

func (Enforcement) Apply

func (e Enforcement) Apply(bidRequest *openrtb2.BidRequest, privacy config.AccountPrivacy)

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 {
	GPPSID []int8
}

Policies contains privacy signals and consent for non-OpenRTB activities.

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 Rule added in v0.271.0

type Rule interface {
	Evaluate(target Component, request ActivityRequest) ActivityResult
}

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

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

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

	// ScrubStrategyIPV6Subnet zeroes out the last 16 bits of an IPV6 sub net address.
	ScrubStrategyIPV6Subnet
)

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
)

type Scrubber

type Scrubber interface {
	ScrubRequest(bidRequest *openrtb2.BidRequest, enforcement Enforcement) *openrtb2.BidRequest
	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(ipV6 config.IPv6, ipV4 config.IPv4) 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