ccpa

package
v0.253.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConsent

func ValidateConsent(consent string) bool

ValidateConsent returns true if the consent string is empty or valid per the IAB CCPA spec.

Types

type ConsentWriter

type ConsentWriter struct {
	Consent string
}

ConsentWriter implements the old PolicyWriter interface for CCPA. This is used where we have not converted to RequestWrapper yet

func (ConsentWriter) Write

func (c ConsentWriter) Write(req *openrtb2.BidRequest) error

Write mutates an OpenRTB bid request with the CCPA consent string.

type ParsedPolicy

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

ParsedPolicy represents parsed and validated CCPA regulatory information. Use this struct to make enforcement decisions.

func (ParsedPolicy) CanEnforce

func (p ParsedPolicy) CanEnforce() bool

CanEnforce returns true when consent is specifically provided by the publisher, as opposed to an empty string.

func (ParsedPolicy) ShouldEnforce

func (p ParsedPolicy) ShouldEnforce(bidder string) bool

ShouldEnforce returns true when the opt-out signal is explicitly detected.

type Policy

type Policy struct {
	Consent       string
	NoSaleBidders []string
}

Policy represents the CCPA regulatory information from an OpenRTB bid request.

func ReadFromRequest

func ReadFromRequest(req *openrtb2.BidRequest) (Policy, error)

func ReadFromRequestWrapper added in v0.169.0

func ReadFromRequestWrapper(req *openrtb_ext.RequestWrapper, gpp gpplib.GppContainer) (Policy, error)

ReadFromRequestWrapper extracts the CCPA regulatory information from an OpenRTB bid request.

func (Policy) Parse

func (p Policy) Parse(validBidders map[string]struct{}) (ParsedPolicy, error)

Parse returns a parsed and validated ParsedPolicy intended for use in enforcement decisions.

func (Policy) Write

func (p Policy) Write(req *openrtb_ext.RequestWrapper) error

Write mutates an OpenRTB bid request with the CCPA regulatory information.

Jump to

Keyboard shortcuts

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