gdpr

package
v0.180.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 21 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowHostCookies

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

AllowHostCookies represents a GDPR permissions policy with host cookie syncing always allowed

func (AllowHostCookies) AuctionActivitiesAllowed

func (p AllowHostCookies) AuctionActivitiesAllowed(ctx context.Context,
	bidder openrtb_ext.BidderName,
	PublisherID string,
	gdprSignal Signal,
	consent string,
	weakVendorEnforcement bool) (allowBidRequest bool, passGeo bool, passID bool, err error)

func (AllowHostCookies) BidderSyncAllowed

func (p AllowHostCookies) BidderSyncAllowed(ctx context.Context, bidder openrtb_ext.BidderName, gdprSignal Signal, consent string) (bool, error)

func (*AllowHostCookies) HostCookiesAllowed

func (p *AllowHostCookies) HostCookiesAllowed(ctx context.Context, gdprSignal Signal, consent string) (bool, error)

HostCookiesAllowed always returns true

type AlwaysAllow

type AlwaysAllow struct{}

Exporting to allow for easy test setups

func (AlwaysAllow) AuctionActivitiesAllowed

func (a AlwaysAllow) AuctionActivitiesAllowed(ctx context.Context, bidder openrtb_ext.BidderName, PublisherID string, gdprSignal Signal, consent string, weakVendorEnforcement bool) (allowBidRequest bool, passGeo bool, passID bool, err error)

func (AlwaysAllow) BidderSyncAllowed

func (a AlwaysAllow) BidderSyncAllowed(ctx context.Context, bidder openrtb_ext.BidderName, gdprSignal Signal, consent string) (bool, error)

func (AlwaysAllow) HostCookiesAllowed

func (a AlwaysAllow) HostCookiesAllowed(ctx context.Context, gdprSignal Signal, consent string) (bool, error)

type ErrorMalformedConsent

type ErrorMalformedConsent struct {
	Consent string
	Cause   error
}

An ErrorMalformedConsent will be returned by the Permissions interface if the consent string argument was the reason for the failure.

func (*ErrorMalformedConsent) Error

func (e *ErrorMalformedConsent) Error() string

type Permissions

type Permissions interface {
	// Determines whether or not the host company is allowed to read/write cookies.
	//
	// If the consent string was nonsensical, the returned error will be an ErrorMalformedConsent.
	HostCookiesAllowed(ctx context.Context, gdprSignal Signal, consent string) (bool, error)

	// Determines whether or not the given bidder is allowed to user personal info for ad targeting.
	//
	// If the consent string was nonsensical, the returned error will be an ErrorMalformedConsent.
	BidderSyncAllowed(ctx context.Context, bidder openrtb_ext.BidderName, gdprSignal Signal, consent string) (bool, error)

	// Determines whether or not to send PI information to a bidder, or mask it out.
	//
	// If the consent string was nonsensical, the returned error will be an ErrorMalformedConsent.
	AuctionActivitiesAllowed(ctx context.Context, bidder openrtb_ext.BidderName, PublisherID string, gdprSignal Signal, consent string, weakVendorEnforcement bool) (allowBidReq bool, passGeo bool, passID bool, err error)
}

func NewPermissions

func NewPermissions(ctx context.Context, cfg config.GDPR, vendorIDs map[openrtb_ext.BidderName]uint16, client *http.Client) Permissions

NewPermissions gets an instance of the Permissions for use elsewhere in the project.

type Signal

type Signal int
const (
	SignalAmbiguous Signal = -1
	SignalNo        Signal = 0
	SignalYes       Signal = 1
)

func SignalNormalize added in v0.173.0

func SignalNormalize(signal Signal, config config.GDPR) Signal

SignalNormalize normalizes a GDPR signal to ensure it's always either SignalYes or SignalNo.

func SignalParse

func SignalParse(rawSignal string) (Signal, error)

SignalParse returns a parsed GDPR signal or a parse error.

Jump to

Keyboard shortcuts

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