vendorconsent

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: Apache-2.0 Imports: 10 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConsentV2 added in v0.9.0

func IsConsentV2(consent string) bool

IsConsentV2 return true if the consent strings looks like a tcf v2 consent string

func Parse

func Parse(data []byte) (api.VendorConsents, error)

Parse parses the TCF 2.0 vendor consent data from the string. This string should *not* be encoded (by base64 or any other encoding). If the data is malformed and cannot be interpreted as a vendor consent string, this will return an error.

func ParseString added in v0.9.0

func ParseString(consent string) (api.VendorConsents, error)

ParseString parses the TCF 2.0 vendor string base64 encoded

Types

type ConsentMetadata added in v0.8.0

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

ConsentMetadata implements the parts of the VendorConsents interface which are common to BitFields and RangeSections. This relies on Parse to have done some validation already, to make sure that functions on it don't overflow the bounds of the byte array.

func (ConsentMetadata) CheckPubRestriction added in v0.8.0

func (c ConsentMetadata) CheckPubRestriction(purposeID uint8, restrictType uint8, vendor uint16) bool

CheckPubRestriction returns the publisher restriction for a given purpose id, restriction type and vendor id

func (ConsentMetadata) CmpID added in v0.8.0

func (c ConsentMetadata) CmpID() uint16

CmpID returns the Consent Management Platform identifier stored in bits 79 to 90

func (ConsentMetadata) CmpVersion added in v0.8.0

func (c ConsentMetadata) CmpVersion() uint16

CmpVersion returns the Consent Management Platform version stored in bits 91 to 102

func (ConsentMetadata) ConsentLanguage added in v0.8.0

func (c ConsentMetadata) ConsentLanguage() string

ConsentLanguage returns the two letter code for consent language stored in bits 109 to 120

func (ConsentMetadata) ConsentScreen added in v0.8.0

func (c ConsentMetadata) ConsentScreen() uint8

ConsentScreen returns the consent screen info stored in bits 103 to 108

func (ConsentMetadata) Created added in v0.8.0

func (c ConsentMetadata) Created() time.Time

Created returns the created date stored in bits 7 to 42

func (ConsentMetadata) LastUpdated added in v0.8.0

func (c ConsentMetadata) LastUpdated() time.Time

LastUpdated returns the last updated date stored in bits 43 to 78

func (ConsentMetadata) MaxVendorID added in v0.8.0

func (c ConsentMetadata) MaxVendorID() uint16

MaxVendorID returns the maximum value for vendor identifier in bits 214 to 229

func (ConsentMetadata) PurposeAllowed added in v0.8.0

func (c ConsentMetadata) PurposeAllowed(id consentconstants.Purpose) bool

PurposeAllowed returns if the given purpose (1 to 24 max) is enabled, info stored in bits 153 to 176

func (ConsentMetadata) PurposeLITransparency added in v0.8.1

func (c ConsentMetadata) PurposeLITransparency(id consentconstants.Purpose) bool

PurposeLITransparency returns if the given purpose transparency (1 to 24 max) is enabled, info stored in bits 177 to 200

func (ConsentMetadata) PurposeOneTreatment added in v0.8.0

func (c ConsentMetadata) PurposeOneTreatment() bool

PurposeOneTreatment returns if Purpose 1 is enable, info stored in bit 201

func (ConsentMetadata) SpecialFeatureOptIn added in v0.8.0

func (c ConsentMetadata) SpecialFeatureOptIn(id uint16) bool

SpecialFeatureOptIn returns if the given special feature is enable, stored in bits 140 to 152

func (ConsentMetadata) TCFPolicyVersion added in v1.12.0

func (c ConsentMetadata) TCFPolicyVersion() uint8

TCFPolicyVersion returns the TCF policy version stored in bits 133 to 138

func (ConsentMetadata) VendorConsent added in v0.8.0

func (c ConsentMetadata) VendorConsent(id uint16) bool

VendorConsent returns true if there is consent for the given vendor id

func (ConsentMetadata) VendorLegitInterest added in v0.8.0

func (c ConsentMetadata) VendorLegitInterest(id uint16) bool

VendorLegitInterest returns true if there is legitimate interest established for the given vendor id

func (ConsentMetadata) VendorLegitInterestMaxID added in v0.8.3

func (c ConsentMetadata) VendorLegitInterestMaxID() uint16

VendorLegitInterestMaxID returns the vendor legitimate interest max id

func (ConsentMetadata) VendorListVersion added in v0.8.0

func (c ConsentMetadata) VendorListVersion() uint16

VendorListVersion returns the vendor list version stored in bits 121 to 132

func (ConsentMetadata) Version added in v0.8.0

func (c ConsentMetadata) Version() uint8

Version returns the version stored in the first 6 bits

Jump to

Keyboard shortcuts

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