Documentation ¶
Index ¶
- Constants
- Variables
- func SetupViper(v *viper.Viper, filename string)
- type Account
- type AccountCCPA
- type AccountGDPR
- func (a *AccountGDPR) BasicEnforcementVendor(bidder openrtb_ext.BidderName) (value, exists bool)
- func (a *AccountGDPR) EnabledForIntegrationType(integrationType IntegrationType) *bool
- func (a *AccountGDPR) FeatureOneEnforced() (value, exists bool)
- func (a *AccountGDPR) FeatureOneVendorException(bidder openrtb_ext.BidderName) (value, exists bool)
- func (a *AccountGDPR) PurposeEnforced(purpose consentconstants.Purpose) (value, exists bool)
- func (a *AccountGDPR) PurposeEnforcingVendors(purpose consentconstants.Purpose) (value, exists bool)
- func (a *AccountGDPR) PurposeOneTreatmentAccessAllowed() (value, exists bool)
- func (a *AccountGDPR) PurposeOneTreatmentEnabled() (value, exists bool)
- func (a *AccountGDPR) PurposeVendorException(purpose consentconstants.Purpose, bidder openrtb_ext.BidderName) (value, exists bool)
- type AccountGDPRPurpose
- type AccountGDPRPurposeOneTreatment
- type AccountGDPRSpecialFeature
- type AccountIntegration
- type Adapter
- type AdapterAlternateBidderCodes
- type AdapterXAPI
- type AdsCertInProcess
- type AdsCertRemote
- type AlternateBidderCodes
- type Analytics
- type AuctionTimeouts
- type BidderAdsCert
- type BidderInfo
- type BidderInfoExperiment
- type BidderInfos
- type CCPA
- type Cache
- type CacheEventsConfig
- type CapabilitiesInfo
- type Configuration
- type Cookie
- type CookieSync
- type CurrencyConverter
- type DataType
- type Debug
- type DebugInfo
- type DefReqConfig
- type DefReqFiles
- type DefaultTTLs
- type DisabledMetrics
- type Event
- type Events
- type Experiment
- type ExperimentAdsCert
- type ExternalCache
- type FileFetcherConfig
- type FileLogs
- type GDPR
- type GDPRTimeouts
- type HTTPClient
- type HTTPEventsConfig
- type HTTPFetcherConfig
- type HostCookie
- type InMemoryCache
- type InfluxMetrics
- type IntegrationType
- type InterstitialSize
- type LMT
- type MaintainerInfo
- type Metrics
- type PlatformInfo
- type PostgresCacheInitializer
- type PostgresConfig
- type PostgresConnection
- type PostgresFetcherQueries
- type PostgresUpdatePolling
- type Privacy
- type PrometheusMetrics
- type Pubstack
- type PubstackBuffer
- type RequestTimeoutHeaders
- type RequestValidation
- type StoredRequests
- type Syncer
- type SyncerEndpoint
- type TCF2
- func (t *TCF2) BasicEnforcementVendor(openrtb_ext.BidderName) bool
- func (t *TCF2) FeatureOneEnforced() (value bool)
- func (t *TCF2) FeatureOneVendorException(bidder openrtb_ext.BidderName) (value bool)
- func (t *TCF2) IntegrationEnabled(integrationType IntegrationType) bool
- func (t *TCF2) IsEnabled() bool
- func (t *TCF2) PurposeEnforced(purpose consentconstants.Purpose) (value bool)
- func (t *TCF2) PurposeEnforcingVendors(purpose consentconstants.Purpose) (value bool)
- func (t *TCF2) PurposeOneTreatmentAccessAllowed() (value bool)
- func (t *TCF2) PurposeOneTreatmentEnabled() (value bool)
- func (t *TCF2) PurposeVendorException(purpose consentconstants.Purpose, bidder openrtb_ext.BidderName) (value bool)
- type TCF2Purpose
- type TCF2PurposeOneTreatment
- type TCF2SpecialFeature
- type TimeoutNotification
- type TrackingEventType
- type UserSync
- type UserSyncCooperative
- type VASTEvent
- type VASTEventElement
- type VTrack
Constants ¶
const ( TCF2FullEnforcement = "full" TCF2NoEnforcement = "no" )
const ( AdCertsSignerModeOff = "off" AdCertsSignerModeInprocess = "inprocess" AdCertsSignerModeRemote = "remote" )
const MIN_COOKIE_SIZE_BYTES = 500
Variables ¶
var ( ErrSignerModeIncorrect = errors.New("signer mode is not specified, specify 'off', 'inprocess' or 'remote'") ErrInProcessSignerInvalidPrivateKey = errors.New("private key for inprocess signer cannot be empty") ErrMsgInProcessSignerInvalidURL = "invalid url for inprocess signer" ErrMsgInProcessSignerInvalidDNSRenewalInterval = "invalid dns renewal interval for inprocess signer" ErrMsgInProcessSignerInvalidDNSCheckInterval = "invalid dns check interval for inprocess signer" ErrMsgInvalidRemoteSignerURL = "invalid url for remote signer" ErrMsgInvalidRemoteSignerSigningTimeout = "invalid signing timeout for remote signer" )
var ResolvedInterstitialSizes = []InterstitialSize{}/* 250 elements not displayed */
ResolvedInterstitialSizes is a list of sizes sorted by size (larger first) and frequency (more common sizes first) since that seemed like a reasonable weight balancing the two factors. Originally sources from AppNexus/Xandr stats.
Functions ¶
func SetupViper ¶
Set the default config values for the viper object we are using.
Types ¶
type Account ¶
type Account struct { ID string `mapstructure:"id" json:"id"` Disabled bool `mapstructure:"disabled" json:"disabled"` CacheTTL DefaultTTLs `mapstructure:"cache_ttl" json:"cache_ttl"` EventsEnabled bool `mapstructure:"events_enabled" json:"events_enabled"` CCPA AccountCCPA `mapstructure:"ccpa" json:"ccpa"` GDPR AccountGDPR `mapstructure:"gdpr" json:"gdpr"` DebugAllow bool `mapstructure:"debug_allow" json:"debug_allow"` DefaultIntegration string `mapstructure:"default_integration" json:"default_integration"` CookieSync CookieSync `mapstructure:"cookie_sync" json:"cookie_sync"` Events Events `mapstructure:"events" json:"events"` // Don't enable this feature. It is still under developmment - https://github.com/prebid/prebid-server/issues/1725 TruncateTargetAttribute *int `mapstructure:"truncate_target_attr" json:"truncate_target_attr"` AlternateBidderCodes AlternateBidderCodes `mapstructure:"alternatebiddercodes" json:"alternatebiddercodes"` }
Account represents a publisher account configuration
type AccountCCPA ¶
type AccountCCPA struct { Enabled *bool `mapstructure:"enabled" json:"enabled,omitempty"` IntegrationEnabled AccountIntegration `mapstructure:"integration_enabled" json:"integration_enabled"` }
AccountCCPA represents account-specific CCPA configuration
func (*AccountCCPA) EnabledForIntegrationType ¶
func (a *AccountCCPA) EnabledForIntegrationType(integrationType IntegrationType) *bool
EnabledForIntegrationType indicates whether CCPA is turned on at the account level for the specified integration type by using the integration type setting if defined or the general CCPA setting if defined; otherwise it returns nil
type AccountGDPR ¶
type AccountGDPR struct { Enabled *bool `mapstructure:"enabled" json:"enabled,omitempty"` IntegrationEnabled AccountIntegration `mapstructure:"integration_enabled" json:"integration_enabled"` // Array of basic enforcement vendors that is used to create the hash table so vendor names can be instantly accessed BasicEnforcementVendors []string `mapstructure:"basic_enforcement_vendors" json:"basic_enforcement_vendors"` BasicEnforcementVendorsMap map[string]struct{} Purpose1 AccountGDPRPurpose `mapstructure:"purpose1" json:"purpose1"` Purpose2 AccountGDPRPurpose `mapstructure:"purpose2" json:"purpose2"` Purpose3 AccountGDPRPurpose `mapstructure:"purpose3" json:"purpose3"` Purpose4 AccountGDPRPurpose `mapstructure:"purpose4" json:"purpose4"` Purpose5 AccountGDPRPurpose `mapstructure:"purpose5" json:"purpose5"` Purpose6 AccountGDPRPurpose `mapstructure:"purpose6" json:"purpose6"` Purpose7 AccountGDPRPurpose `mapstructure:"purpose7" json:"purpose7"` Purpose8 AccountGDPRPurpose `mapstructure:"purpose8" json:"purpose8"` Purpose9 AccountGDPRPurpose `mapstructure:"purpose9" json:"purpose9"` Purpose10 AccountGDPRPurpose `mapstructure:"purpose10" json:"purpose10"` // Hash table of purpose configs for convenient purpose config lookup PurposeConfigs map[consentconstants.Purpose]*AccountGDPRPurpose PurposeOneTreatment AccountGDPRPurposeOneTreatment `mapstructure:"purpose_one_treatment" json:"purpose_one_treatment"` SpecialFeature1 AccountGDPRSpecialFeature `mapstructure:"special_feature1" json:"special_feature1"` }
AccountGDPR represents account-specific GDPR configuration
func (*AccountGDPR) BasicEnforcementVendor ¶ added in v0.206.0
func (a *AccountGDPR) BasicEnforcementVendor(bidder openrtb_ext.BidderName) (value, exists bool)
BasicEnforcementVendor checks if the given bidder is considered a basic enforcement vendor which indicates whether weak vendor enforcement applies to that bidder.
func (*AccountGDPR) EnabledForIntegrationType ¶
func (a *AccountGDPR) EnabledForIntegrationType(integrationType IntegrationType) *bool
EnabledForIntegrationType indicates whether GDPR is turned on at the account level for the specified integration type by using the integration type setting if defined or the general GDPR setting if defined; otherwise it returns nil.
func (*AccountGDPR) FeatureOneEnforced ¶ added in v0.206.0
func (a *AccountGDPR) FeatureOneEnforced() (value, exists bool)
FeatureOneEnforced gets the account level feature one enforced setting returning the value and whether or not it was set. If not set, a default value of true is returned matching host default behavior.
func (*AccountGDPR) FeatureOneVendorException ¶ added in v0.206.0
func (a *AccountGDPR) FeatureOneVendorException(bidder openrtb_ext.BidderName) (value, exists bool)
FeatureOneVendorException checks if the given bidder is a vendor exception.
func (*AccountGDPR) PurposeEnforced ¶ added in v0.206.0
func (a *AccountGDPR) PurposeEnforced(purpose consentconstants.Purpose) (value, exists bool)
PurposeEnforced checks if full enforcement is turned on for a given purpose at the account level. It returns the enforcement strategy type and whether or not it is set on the account. If not set, a default value of true is returned matching host default behavior.
func (*AccountGDPR) PurposeEnforcingVendors ¶ added in v0.206.0
func (a *AccountGDPR) PurposeEnforcingVendors(purpose consentconstants.Purpose) (value, exists bool)
PurposeEnforcingVendors gets the account level enforce vendors setting for a given purpose returning the value and whether or not it is set. If not set, a default value of true is returned matching host default behavior.
func (*AccountGDPR) PurposeOneTreatmentAccessAllowed ¶ added in v0.206.0
func (a *AccountGDPR) PurposeOneTreatmentAccessAllowed() (value, exists bool)
PurposeOneTreatmentAccessAllowed gets the account level purpose one treatment access allowed setting returning the value and whether or not it is set. If not set, a default value of true is returned matching host default behavior.
func (*AccountGDPR) PurposeOneTreatmentEnabled ¶ added in v0.206.0
func (a *AccountGDPR) PurposeOneTreatmentEnabled() (value, exists bool)
PurposeOneTreatmentEnabled gets the account level purpose one treatment enabled setting returning the value and whether or not it is set. If not set, a default value of true is returned matching host default behavior.
func (*AccountGDPR) PurposeVendorException ¶ added in v0.206.0
func (a *AccountGDPR) PurposeVendorException(purpose consentconstants.Purpose, bidder openrtb_ext.BidderName) (value, exists bool)
PurposeVendorException checks if the given bidder is a vendor exception for a given purpose.
type AccountGDPRPurpose ¶ added in v0.206.0
type AccountGDPRPurpose struct { EnforcePurpose string `mapstructure:"enforce_purpose" json:"enforce_purpose,omitempty"` EnforceVendors *bool `mapstructure:"enforce_vendors" json:"enforce_vendors,omitempty"` // Array of vendor exceptions that is used to create the hash table VendorExceptionMap so vendor names can be instantly accessed VendorExceptions []openrtb_ext.BidderName `mapstructure:"vendor_exceptions" json:"vendor_exceptions"` VendorExceptionMap map[openrtb_ext.BidderName]struct{} }
AccountGDPRPurpose represents account-specific GDPR purpose configuration
type AccountGDPRPurposeOneTreatment ¶ added in v0.206.0
type AccountGDPRPurposeOneTreatment struct { Enabled *bool `mapstructure:"enabled"` AccessAllowed *bool `mapstructure:"access_allowed"` }
AccountGDPRPurposeOneTreatment represents account-specific GDPR purpose one treatment configuration
type AccountGDPRSpecialFeature ¶ added in v0.206.0
type AccountGDPRSpecialFeature struct { Enforce *bool `mapstructure:"enforce" json:"enforce"` // Array of vendor exceptions that is used to create the hash table VendorExceptionMap so vendor names can be instantly accessed VendorExceptions []openrtb_ext.BidderName `mapstructure:"vendor_exceptions" json:"vendor_exceptions"` VendorExceptionMap map[openrtb_ext.BidderName]struct{} }
AccountGDPRSpecialFeature represents account-specific GDPR special feature configuration
type AccountIntegration ¶
type AccountIntegration struct { AMP *bool `mapstructure:"amp" json:"amp,omitempty"` App *bool `mapstructure:"app" json:"app,omitempty"` Video *bool `mapstructure:"video" json:"video,omitempty"` Web *bool `mapstructure:"web" json:"web,omitempty"` }
AccountIntegration indicates whether a particular privacy policy (GDPR, CCPA) is enabled for each integration type
func (*AccountIntegration) GetByIntegrationType ¶
func (a *AccountIntegration) GetByIntegrationType(integrationType IntegrationType) *bool
GetByIntegrationType looks up the account integration enabled setting for the specified integration type
type Adapter ¶
type Adapter struct { Disabled bool `mapstructure:"disabled"` Endpoint string `mapstructure:"endpoint"` ExtraAdapterInfo string `mapstructure:"extra_info"` Syncer *Syncer `mapstructure:"usersync"` // needed for backwards compatibility UserSyncURL string `mapstructure:"usersync_url"` // needed for Rubicon XAPI AdapterXAPI `mapstructure:"xapi"` // needed for Facebook PlatformID string `mapstructure:"platform_id"` AppSecret string `mapstructure:"app_secret"` }
type AdapterAlternateBidderCodes ¶ added in v0.216.0
type AdapterXAPI ¶
type AdsCertInProcess ¶ added in v0.220.0
type AdsCertInProcess struct { // Origin is ads.cert hostname for the originating party Origin string `mapstructure:"origin"` // PrivateKey is a base-64 encoded private key. PrivateKey string `mapstructure:"key"` // DNSCheckIntervalInSeconds specifies frequency to check origin _delivery._adscert and _adscert subdomains, used for indexing data, default: 30 DNSCheckIntervalInSeconds int `mapstructure:"domain_check_interval_seconds"` // DNSRenewalIntervalInSeconds specifies frequency to renew origin _delivery._adscert and _adscert subdomains, used for indexing data, default: 30 DNSRenewalIntervalInSeconds int `mapstructure:"domain_renewal_interval_seconds"` }
AdsCertInProcess configures data to sign requests using ads certs library in core PBS logic
type AdsCertRemote ¶ added in v0.220.0
type AdsCertRemote struct { // Url is the address of gRPC server that will create a call signature Url string `mapstructure:"url"` // SigningTimeoutMs specifies how long this client will wait for signing to finish before abandoning SigningTimeoutMs int `mapstructure:"signing_timeout_ms"` }
AdsCertRemote configures data to sign requests using remote signatory service
type AlternateBidderCodes ¶ added in v0.216.0
type AlternateBidderCodes struct { Enabled bool `mapstructure:"enabled" json:"enabled"` Bidders map[string]AdapterAlternateBidderCodes `mapstructure:"bidders" json:"bidders"` }
func (*AlternateBidderCodes) IsValidBidderCode ¶ added in v0.216.0
func (bidderCodes *AlternateBidderCodes) IsValidBidderCode(bidder, alternateBidder string) (bool, error)
type AuctionTimeouts ¶
type AuctionTimeouts struct { // The default timeout is used if the user's request didn't define one. Use 0 if there's no default. Default uint64 `mapstructure:"default"` // The max timeout is used as an absolute cap, to prevent excessively long ones. Use 0 for no cap Max uint64 `mapstructure:"max"` }
func (*AuctionTimeouts) LimitAuctionTimeout ¶
func (cfg *AuctionTimeouts) LimitAuctionTimeout(requested time.Duration) time.Duration
LimitAuctionTimeout returns the min of requested or cfg.MaxAuctionTimeout. Both values treat "0" as "infinite".
type BidderAdsCert ¶ added in v0.220.0
type BidderAdsCert struct {
Enabled bool `yaml:"enabled"`
}
BidderAdsCert enables Call Sign feature for bidder
type BidderInfo ¶
type BidderInfo struct { Enabled bool // copied from adapter config for convenience. to be refactored. Maintainer *MaintainerInfo `yaml:"maintainer"` Capabilities *CapabilitiesInfo `yaml:"capabilities"` ModifyingVastXmlAllowed bool `yaml:"modifyingVastXmlAllowed"` Debug *DebugInfo `yaml:"debug"` GVLVendorID uint16 `yaml:"gvlVendorID"` Syncer *Syncer `yaml:"userSync"` Experiment BidderInfoExperiment `yaml:"experiment"` EndpointCompression string `yaml:"endpointCompression"` // EndpointCompression determines, if set, the type of compression the bid request will undergo before being sent to the corresponding bid server }
BidderInfo specifies all configuration for a bidder except for enabled status, endpoint, and extra information.
type BidderInfoExperiment ¶ added in v0.220.0
type BidderInfoExperiment struct {
AdsCert BidderAdsCert `yaml:"adsCert"`
}
BidderInfoExperiment specifies non-production ready feature config for a bidder
type BidderInfos ¶
type BidderInfos map[string]BidderInfo
BidderInfos contains a mapping of bidder name to bidder info.
func LoadBidderInfoFromDisk ¶
func LoadBidderInfoFromDisk(path string, adapterConfigs map[string]Adapter, bidders []string) (BidderInfos, error)
LoadBidderInfoFromDisk parses all static/bidder-info/{bidder}.yaml files from the file system.
func (BidderInfos) ToGVLVendorIDMap ¶
func (infos BidderInfos) ToGVLVendorIDMap() map[openrtb_ext.BidderName]uint16
ToGVLVendorIDMap transforms a BidderInfos object to a map of bidder names to GVL id. Disabled bidders are omitted from the result.
type Cache ¶
type Cache struct { Scheme string `mapstructure:"scheme"` Host string `mapstructure:"host"` Query string `mapstructure:"query"` // A static timeout here is not ideal. This is a hack because we have some aggressive timelines for OpenRTB support. // This value specifies how much time the prebid server host expects a call to prebid cache to take. // // OpenRTB allows the caller to specify the auction timeout. Prebid Server will subtract _this_ amount of time // from the timeout it gives demand sources to respond. // // In reality, the cache response time will probably fluctuate with the traffic over time. Someday, // this should be replaced by code which tracks the response time of recent cache calls and // adjusts the time dynamically. ExpectedTimeMillis int `mapstructure:"expected_millis"` DefaultTTLs DefaultTTLs `mapstructure:"default_ttl_seconds"` }
Cache configures the url used internally by Prebid Server to communicate with Prebid Cache.
func (*Cache) GetBaseURL ¶
Allows for protocol relative URL if scheme is empty
type CacheEventsConfig ¶
type CacheEventsConfig struct { // Enabled should be true to enable the events api endpoint Enabled bool `mapstructure:"enabled"` // Endpoint is the url path exposed for this stored requests events api Endpoint string `mapstructure:"endpoint"` }
CacheEventsConfig configured stored_requests/events/api/api.go
type CapabilitiesInfo ¶
type CapabilitiesInfo struct { App *PlatformInfo `yaml:"app"` Site *PlatformInfo `yaml:"site"` }
CapabilitiesInfo specifies the supported platforms for a bidder.
type Configuration ¶
type Configuration struct { ExternalURL string `mapstructure:"external_url"` Host string `mapstructure:"host"` Port int `mapstructure:"port"` UnixSocketEnable bool `mapstructure:"unix_socket_enable"` UnixSocketName string `mapstructure:"unix_socket_name"` Client HTTPClient `mapstructure:"http_client"` CacheClient HTTPClient `mapstructure:"http_client_cache"` AdminPort int `mapstructure:"admin_port"` EnableGzip bool `mapstructure:"enable_gzip"` // GarbageCollectorThreshold allocates virtual memory (in bytes) which is not used by PBS but // serves as a hack to trigger the garbage collector only when the heap reaches at least this size. // More info: https://github.com/golang/go/issues/48409 GarbageCollectorThreshold int `mapstructure:"garbage_collector_threshold"` // StatusResponse is the string which will be returned by the /status endpoint when things are OK. // If empty, it will return a 204 with no content. StatusResponse string `mapstructure:"status_response"` AuctionTimeouts AuctionTimeouts `mapstructure:"auction_timeouts_ms"` CacheURL Cache `mapstructure:"cache"` ExtCacheURL ExternalCache `mapstructure:"external_cache"` RecaptchaSecret string `mapstructure:"recaptcha_secret"` HostCookie HostCookie `mapstructure:"host_cookie"` Metrics Metrics `mapstructure:"metrics"` StoredRequests StoredRequests `mapstructure:"stored_requests"` StoredRequestsAMP StoredRequests `mapstructure:"stored_amp_req"` CategoryMapping StoredRequests `mapstructure:"category_mapping"` VTrack VTrack `mapstructure:"vtrack"` Event Event `mapstructure:"event"` Accounts StoredRequests `mapstructure:"accounts"` UserSync UserSync `mapstructure:"user_sync"` // Note that StoredVideo refers to stored video requests, and has nothing to do with caching video creatives. StoredVideo StoredRequests `mapstructure:"stored_video_req"` StoredResponses StoredRequests `mapstructure:"stored_responses"` // Adapters should have a key for every openrtb_ext.BidderName, converted to lower-case. // Se also: https://github.com/spf13/viper/issues/371#issuecomment-335388559 Adapters map[string]Adapter `mapstructure:"adapters"` MaxRequestSize int64 `mapstructure:"max_request_size"` Analytics Analytics `mapstructure:"analytics"` AMPTimeoutAdjustment int64 `mapstructure:"amp_timeout_adjustment_ms"` GDPR GDPR `mapstructure:"gdpr"` CCPA CCPA `mapstructure:"ccpa"` LMT LMT `mapstructure:"lmt"` CurrencyConverter CurrencyConverter `mapstructure:"currency_converter"` DefReqConfig DefReqConfig `mapstructure:"default_request"` VideoStoredRequestRequired bool `mapstructure:"video_stored_request_required"` // Array of blacklisted apps that is used to create the hash table BlacklistedAppMap so App.ID's can be instantly accessed. BlacklistedApps []string `mapstructure:"blacklisted_apps,flow"` BlacklistedAppMap map[string]bool // Array of blacklisted accounts that is used to create the hash table BlacklistedAcctMap so Account.ID's can be instantly accessed. BlacklistedAccts []string `mapstructure:"blacklisted_accts,flow"` BlacklistedAcctMap map[string]bool // Is publisher/account ID required to be submitted in the OpenRTB2 request AccountRequired bool `mapstructure:"account_required"` // AccountDefaults defines default settings for valid accounts that are partially defined // and provides a way to set global settings that can be overridden at account level. AccountDefaults Account `mapstructure:"account_defaults"` // Local private file containing SSL certificates PemCertsFile string `mapstructure:"certificates_file"` // Custom headers to handle request timeouts from queueing infrastructure RequestTimeoutHeaders RequestTimeoutHeaders `mapstructure:"request_timeout_headers"` // Debug/logging flags go here Debug Debug `mapstructure:"debug"` // RequestValidation specifies the request validation options. RequestValidation RequestValidation `mapstructure:"request_validation"` // When true, PBS will assign a randomly generated UUID to req.Source.TID if it is empty AutoGenSourceTID bool `mapstructure:"auto_gen_source_tid"` //When true, new bid id will be generated in seatbid[].bid[].ext.prebid.bidid and used in event urls instead GenerateBidID bool `mapstructure:"generate_bid_id"` // GenerateRequestID overrides the bidrequest.id in an AMP Request or an App Stored Request with a generated UUID if set to true. The default is false. GenerateRequestID bool `mapstructure:"generate_request_id"` HostSChainNode *openrtb2.SupplyChainNode `mapstructure:"host_schain_node"` // Experiment configures non-production ready features. Experiment Experiment `mapstructure:"experiment"` // contains filtered or unexported fields }
Configuration specifies the static application config.
func New ¶
func New(v *viper.Viper) (*Configuration, error)
New uses viper to get our server configurations.
func (*Configuration) AccountDefaultsJSON ¶
func (cfg *Configuration) AccountDefaultsJSON() json.RawMessage
AccountDefaultsJSON returns the precompiled JSON form of account_defaults
func (*Configuration) GetCachedAssetURL ¶
func (cfg *Configuration) GetCachedAssetURL(uuid string) string
func (*Configuration) MarshalAccountDefaults ¶
func (cfg *Configuration) MarshalAccountDefaults() error
MarshalAccountDefaults compiles AccountDefaults into the JSON format used for merge patch
type CookieSync ¶ added in v0.204.0
type CookieSync struct { DefaultLimit *int `mapstructure:"default_limit" json:"default_limit"` MaxLimit *int `mapstructure:"max_limit" json:"max_limit"` DefaultCoopSync *bool `mapstructure:"default_coop_sync" json:"default_coop_sync"` }
CookieSync represents the account-level defaults for the cookie sync endpoint.
type CurrencyConverter ¶
type Debug ¶
type Debug struct { TimeoutNotification TimeoutNotification `mapstructure:"timeout_notification"` OverrideToken string `mapstructure:"override_token"` }
type DebugInfo ¶
type DebugInfo struct {
Allow bool `yaml:"allow"`
}
DebugInfo specifies the supported debug options for a bidder.
type DefReqConfig ¶
type DefReqConfig struct { Type string `mapstructure:"type"` FileSystem DefReqFiles `mapstructure:"file"` AliasInfo bool `mapstructure:"alias_info"` }
AliasConfig will define the various source(s) or the default aliases Currently only filesystem is supported, but keeping the config structure
type DefReqFiles ¶
type DefReqFiles struct {
FileName string `mapstructure:"name"`
}
type DefaultTTLs ¶
type DefaultTTLs struct { Banner int `mapstructure:"banner"` Video int `mapstructure:"video"` Native int `mapstructure:"native"` Audio int `mapstructure:"audio"` }
Default TTLs to use to cache bids for different types of imps.
type DisabledMetrics ¶
type DisabledMetrics struct { // True if we want to stop collecting account-to-adapter metrics AccountAdapterDetails bool `mapstructure:"account_adapter_details"` // True if we want to stop collecting account debug request metrics AccountDebug bool `mapstructure:"account_debug"` // True if we want to stop collecting account stored respponses metrics AccountStoredResponses bool `mapstructure:"account_stored_responses"` // True if we don't want to collect metrics about the connections prebid // server establishes with bidder servers such as the number of connections // that were created or reused. AdapterConnectionMetrics bool `mapstructure:"adapter_connections_metrics"` // True if we don't want to collect the per adapter GDPR request blocked metric AdapterGDPRRequestBlocked bool `mapstructure:"adapter_gdpr_request_blocked"` }
type Events ¶ added in v0.201.0
type Events struct { Enabled bool `mapstructure:"enabled" json:"enabled"` DefaultURL string `mapstructure:"default_url" json:"default_url"` VASTEvents []VASTEvent `mapstructure:"vast_events" json:"vast_events,omitempty"` }
Events indicates the various types of events to be captured typically for injecting tracker URLs within the VAST XML Don't enable this feature. It is still under developmment. Please follow https://github.com/prebid/prebid-server/issues/1725 for more updates
type Experiment ¶ added in v0.220.0
type Experiment struct {
AdCerts ExperimentAdsCert `mapstructure:"adscert"`
}
Experiment defines if experimental features are available
type ExperimentAdsCert ¶ added in v0.220.0
type ExperimentAdsCert struct { Mode string `mapstructure:"mode"` InProcess AdsCertInProcess `mapstructure:"inprocess"` Remote AdsCertRemote `mapstructure:"remote"` }
ExperimentAdsCert configures and enables functionality to generate and send Ads Cert Auth header to bidders
type ExternalCache ¶
type ExternalCache struct { Scheme string `mapstructure:"scheme"` Host string `mapstructure:"host"` Path string `mapstructure:"path"` }
ExternalCache configures the externally accessible cache url.
type FileFetcherConfig ¶
type FileFetcherConfig struct { // Enabled should be true if Stored Requests should be loaded from the filesystem. Enabled bool `mapstructure:"enabled"` // Path to the directory this file fetcher gets data from. Path string `mapstructure:"directorypath"` }
FileFetcherConfig configures a stored_requests/backends/file_fetcher/fetcher.go
type FileLogs ¶
type FileLogs struct {
Filename string `mapstructure:"filename"`
}
FileLogs Corresponding config for FileLogger as a PBS Analytics Module
type GDPR ¶
type GDPR struct { Enabled bool `mapstructure:"enabled"` HostVendorID int `mapstructure:"host_vendor_id"` DefaultValue string `mapstructure:"default_value"` Timeouts GDPRTimeouts `mapstructure:"timeouts_ms"` NonStandardPublishers []string `mapstructure:"non_standard_publishers,flow"` NonStandardPublisherMap map[string]struct{} TCF2 TCF2 `mapstructure:"tcf2"` AMPException bool `mapstructure:"amp_exception"` // Deprecated: Use account-level GDPR settings (gdpr.integration_enabled.amp) instead // EEACountries (EEA = European Economic Area) are a list of countries where we should assume GDPR applies. // If the gdpr flag is unset in a request, but geo.country is set, we will assume GDPR applies if and only // if the country matches one on this list. If both the GDPR flag and country are not set, we default // to DefaultValue EEACountries []string `mapstructure:"eea_countries"` EEACountriesMap map[string]struct{} }
type GDPRTimeouts ¶
type GDPRTimeouts struct { InitVendorlistFetch int `mapstructure:"init_vendorlist_fetches"` ActiveVendorlistFetch int `mapstructure:"active_vendorlist_fetch"` }
func (*GDPRTimeouts) ActiveTimeout ¶
func (t *GDPRTimeouts) ActiveTimeout() time.Duration
func (*GDPRTimeouts) InitTimeout ¶
func (t *GDPRTimeouts) InitTimeout() time.Duration
type HTTPClient ¶
type HTTPEventsConfig ¶
type HTTPEventsConfig struct { Endpoint string `mapstructure:"endpoint"` RefreshRate int64 `mapstructure:"refresh_rate_seconds"` Timeout int `mapstructure:"timeout_ms"` AmpEndpoint string `mapstructure:"amp_endpoint"` }
HTTPEventsConfig configures stored_requests/events/http/http.go
func (HTTPEventsConfig) RefreshRateDuration ¶
func (cfg HTTPEventsConfig) RefreshRateDuration() time.Duration
func (HTTPEventsConfig) TimeoutDuration ¶
func (cfg HTTPEventsConfig) TimeoutDuration() time.Duration
type HTTPFetcherConfig ¶
type HTTPFetcherConfig struct { Endpoint string `mapstructure:"endpoint"` AmpEndpoint string `mapstructure:"amp_endpoint"` }
HTTPFetcherConfig configures a stored_requests/backends/http_fetcher/fetcher.go
type HostCookie ¶
type HostCookie struct { Domain string `mapstructure:"domain"` Family string `mapstructure:"family"` CookieName string `mapstructure:"cookie_name"` OptOutURL string `mapstructure:"opt_out_url"` OptInURL string `mapstructure:"opt_in_url"` MaxCookieSizeBytes int `mapstructure:"max_cookie_size_bytes"` OptOutCookie Cookie `mapstructure:"optout_cookie"` // Cookie timeout in days TTL int64 `mapstructure:"ttl_days"` }
func (*HostCookie) TTLDuration ¶
func (cfg *HostCookie) TTLDuration() time.Duration
type InMemoryCache ¶
type InMemoryCache struct { // Identify the type of memory cache. "none", "unbounded", "lru" Type string `mapstructure:"type"` // TTL is the maximum number of seconds that an unused value will stay in the cache. // TTL <= 0 can be used for "no ttl". Elements will still be evicted based on the Size. TTL int `mapstructure:"ttl_seconds"` // Size is the max total cache size allowed for single caches Size int `mapstructure:"size_bytes"` // RequestCacheSize is the max number of bytes allowed in the cache for Stored Requests. Values <= 0 will have no limit RequestCacheSize int `mapstructure:"request_cache_size_bytes"` // ImpCacheSize is the max number of bytes allowed in the cache for Stored Imps. Values <= 0 will have no limit ImpCacheSize int `mapstructure:"imp_cache_size_bytes"` // ResponsesCacheSize is the max number of bytes allowed in the cache for Stored Responses. Values <= 0 will have no limit RespCacheSize int `mapstructure:"resp_cache_size_bytes"` }
type InfluxMetrics ¶
type InfluxMetrics struct { Host string `mapstructure:"host"` Database string `mapstructure:"database"` Measurement string `mapstructure:"measurement"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` AlignTimestamps bool `mapstructure:"align_timestamps"` MetricSendInterval int `mapstructure:"metric_send_interval"` }
type IntegrationType ¶
type IntegrationType string
IntegrationType enumerates the values of integrations Prebid Server can configure for an account
const ( IntegrationTypeAMP IntegrationType = "amp" IntegrationTypeApp IntegrationType = "app" IntegrationTypeVideo IntegrationType = "video" IntegrationTypeWeb IntegrationType = "web" )
Possible values of integration types Prebid Server can configure for an account
type InterstitialSize ¶
InterstitialSize represents the width and height of an interstitial ad.
type MaintainerInfo ¶
type MaintainerInfo struct {
Email string `yaml:"email"`
}
MaintainerInfo specifies the support email address for a bidder.
type Metrics ¶
type Metrics struct { Influxdb InfluxMetrics `mapstructure:"influxdb"` Prometheus PrometheusMetrics `mapstructure:"prometheus"` Disabled DisabledMetrics `mapstructure:"disabled_metrics"` }
type PlatformInfo ¶
type PlatformInfo struct {
MediaTypes []openrtb_ext.BidType `yaml:"mediaTypes"`
}
PlatformInfo specifies the supported media types for a bidder.
type PostgresCacheInitializer ¶
type PostgresCacheInitializer struct { Timeout int `mapstructure:"timeout_ms"` // Query should be something like: // // SELECT id, requestData, 'request' AS type FROM stored_requests // UNION ALL // SELECT id, impData, 'imp' AS type FROM stored_imps // // This query will be run once on startup to fetch _all_ known Stored Request data from the database. // // For more details on the expected format of requestData and impData, see stored_requests/events/postgres/polling.go Query string `mapstructure:"query"` // AmpQuery is just like Query, but for AMP Stored Requests AmpQuery string `mapstructure:"amp_query"` }
type PostgresConfig ¶
type PostgresConfig struct { ConnectionInfo PostgresConnection `mapstructure:"connection"` FetcherQueries PostgresFetcherQueries `mapstructure:"fetcher"` CacheInitialization PostgresCacheInitializer `mapstructure:"initialize_caches"` PollUpdates PostgresUpdatePolling `mapstructure:"poll_for_updates"` }
PostgresConfig configures the Stored Request ecosystem to use Postgres. This must include a Fetcher, and may optionally include some EventProducers to populate and refresh the caches.
type PostgresConnection ¶
type PostgresConnection struct { Database string `mapstructure:"dbname"` Host string `mapstructure:"host"` Port int `mapstructure:"port"` Username string `mapstructure:"user"` Password string `mapstructure:"password"` }
PostgresConnection has options which put types to the Postgres Connection string. See: https://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters
func (*PostgresConnection) ConnString ¶
func (cfg *PostgresConnection) ConnString() string
type PostgresFetcherQueries ¶
type PostgresFetcherQueries struct { // QueryTemplate is the Postgres Query which can be used to fetch configs from the database. // It is a Template, rather than a full Query, because a single HTTP request may reference multiple Stored Requests. // // In the simplest case, this could be something like: // SELECT id, requestData, 'request' as type // FROM stored_requests // WHERE id in %REQUEST_ID_LIST% // UNION ALL // SELECT id, impData, 'imp' as type // FROM stored_imps // WHERE id in %IMP_ID_LIST% // // The MakeQuery function will transform this query into: // SELECT id, requestData, 'request' as type // FROM stored_requests // WHERE id in ($1) // UNION ALL // SELECT id, impData, 'imp' as type // FROM stored_imps // WHERE id in ($2, $3, $4, ...) // // ... where the number of "$x" args depends on how many IDs are nested within the HTTP request. QueryTemplate string `mapstructure:"query"` // AmpQueryTemplate is the same as QueryTemplate, but used in the `/openrtb2/amp` endpoint. AmpQueryTemplate string `mapstructure:"amp_query"` }
func (*PostgresFetcherQueries) MakeQuery ¶
func (cfg *PostgresFetcherQueries) MakeQuery(numReqs int, numImps int) (query string)
MakeQuery builds a query which can fetch numReqs Stored Requests and numImps Stored Imps. See the docs on PostgresConfig.QueryTemplate for a description of how it works.
func (*PostgresFetcherQueries) MakeQueryResponses ¶ added in v0.189.0
func (cfg *PostgresFetcherQueries) MakeQueryResponses(numIds int) (query string)
type PostgresUpdatePolling ¶
type PostgresUpdatePolling struct { // RefreshRate determines how frequently the Query and AmpQuery are run. RefreshRate int `mapstructure:"refresh_rate_seconds"` // Timeout is the amount of time before a call to the database is aborted. Timeout int `mapstructure:"timeout_ms"` // An example UpdateQuery is: // // SELECT id, requestData, 'request' AS type // FROM stored_requests // WHERE last_updated > $1 // UNION ALL // SELECT id, requestData, 'imp' AS type // FROM stored_imps // WHERE last_updated > $1 // // The code will be run periodically to fetch updates from the database. Query string `mapstructure:"query"` // AmpQuery is the same as Query, but used for the `/openrtb2/amp` endpoint. AmpQuery string `mapstructure:"amp_query"` }
type PrometheusMetrics ¶
type PrometheusMetrics struct { Port int `mapstructure:"port"` Namespace string `mapstructure:"namespace"` Subsystem string `mapstructure:"subsystem"` TimeoutMillisRaw int `mapstructure:"timeout_ms"` }
func (*PrometheusMetrics) Timeout ¶
func (m *PrometheusMetrics) Timeout() time.Duration
type Pubstack ¶
type Pubstack struct { Enabled bool `mapstructure:"enabled"` ScopeId string `mapstructure:"scopeid"` IntakeUrl string `mapstructure:"endpoint"` Buffers PubstackBuffer `mapstructure:"buffers"` ConfRefresh string `mapstructure:"configuration_refresh_delay"` }
type PubstackBuffer ¶
type RequestTimeoutHeaders ¶
type RequestValidation ¶
type RequestValidation struct { IPv4PrivateNetworks []string `mapstructure:"ipv4_private_networks,flow"` IPv4PrivateNetworksParsed []net.IPNet IPv6PrivateNetworks []string `mapstructure:"ipv6_private_networks,flow"` IPv6PrivateNetworksParsed []net.IPNet }
RequestValidation specifies the request validation options.
func (*RequestValidation) Parse ¶
func (r *RequestValidation) Parse() error
Parse converts the CIDR representation of the IPv4 and IPv6 private networks as net.IPNet structs, or returns an error if at least one is invalid.
type StoredRequests ¶
type StoredRequests struct { // Files should be used if Stored Requests should be loaded from the filesystem. // Fetchers are in stored_requests/backends/file_system/fetcher.go Files FileFetcherConfig `mapstructure:"filesystem"` // Postgres configures Fetchers and EventProducers which read from a Postgres DB. // Fetchers are in stored_requests/backends/db_fetcher/postgres.go // EventProducers are in stored_requests/events/postgres Postgres PostgresConfig `mapstructure:"postgres"` // HTTP configures an instance of stored_requests/backends/http/http_fetcher.go. // If non-nil, Stored Requests will be fetched from the endpoint described there. HTTP HTTPFetcherConfig `mapstructure:"http"` // InMemoryCache configures an instance of stored_requests/caches/memory/cache.go. // If non-nil, Stored Requests will be saved in an in-memory cache. InMemoryCache InMemoryCache `mapstructure:"in_memory_cache"` // CacheEvents configures an instance of stored_requests/events/api/api.go. // This is a sub-object containing the endpoint name to use for this API endpoint. CacheEvents CacheEventsConfig `mapstructure:"cache_events"` // HTTPEvents configures an instance of stored_requests/events/http/http.go. // If non-nil, the server will use those endpoints to populate and update the cache. HTTPEvents HTTPEventsConfig `mapstructure:"http_events"` // contains filtered or unexported fields }
StoredRequests struct defines options for stored requests for each data type including some amp stored_requests options
func (*StoredRequests) DataType ¶
func (sr *StoredRequests) DataType() DataType
DataType returns the DataType associated with this config
func (*StoredRequests) Section ¶
func (sr *StoredRequests) Section() string
Section returns the config section
func (*StoredRequests) SetDataType ¶
func (sr *StoredRequests) SetDataType(dataType DataType)
SetDataType sets the DataType on this config. Needed for tests.
type Syncer ¶ added in v0.173.0
type Syncer struct { // Key is used as the record key for the user sync cookie. We recommend using the bidder name // as the key for consistency, but that is not enforced as a requirement. Key string `yaml:"key" mapstructure:"key"` // Supports allows bidders to specify which user sync endpoints they support but which don't have // good defaults. Host companies should contact the bidder for the endpoint configuration. Hosts // may not override this value. Supports []string `yaml:"supports"` // IFrame configures an iframe endpoint for user syncing. IFrame *SyncerEndpoint `yaml:"iframe" mapstructure:"iframe"` // Redirect configures an redirect endpoint for user syncing. This is also known as an image // endpoint in the Prebid.js project. Redirect *SyncerEndpoint `yaml:"redirect" mapstructure:"redirect"` // ExternalURL is available as a macro to the RedirectURL template. ExternalURL string `yaml:"externalUrl" mapstructure:"external_url"` // SupportCORS identifies if CORS is supported for the user syncing endpoints. SupportCORS *bool `yaml:"supportCors" mapstructure:"support_cors"` }
Syncer specifies the user sync settings for a bidder. This struct is shared by the account config, so it needs to have both yaml and mapstructure mappings.
type SyncerEndpoint ¶ added in v0.173.0
type SyncerEndpoint struct { // URL is the endpoint on the bidder server the user will be redirected to when a user sync is // requested. The following macros are resolved at application startup: // // {{.RedirectURL}} - This will be replaced with a redirect url generated using the RedirectURL // template and url escaped for safe inclusion in any part of the URL. // // The following macros are specific to individual requests and are resolved at runtime using the // Go template engine. For more information on Go templates, see: https://golang.org/pkg/text/template/ // // {{.GDPR}} - This will be replaced with the "gdpr" property sent to /cookie_sync. // {{.Consent}} - This will be replaced with the "consent" property sent to /cookie_sync. // {{.USPrivacy}} - This will be replaced with the "us_privacy" property sent to /cookie_sync. URL string `yaml:"url" mapstructure:"url"` // RedirectURL is an endpoint on the host server the user will be redirected to when a user sync // request has been completed by the bidder server. The following macros are resolved at application // startup: // // {{.ExternalURL}} - This will be replaced with the host server's externally reachable http path. // {{.SyncerKey}} - This will be replaced with the syncer key. // {{.SyncType}} - This will be replaced with the sync type, either 'b' for iframe syncs or 'i' // for redirect/image syncs. // {{.UserMacro}} - This will be replaced with the bidder server's user id macro. // // The endpoint on the host server is usually Prebid Server's /setuid endpoint. The default value is: // `{{.ExternalURL}}/setuid?bidder={{.SyncerKey}}&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&f={{.SyncType}}&uid={{.UserMacro}}` RedirectURL string `yaml:"redirectUrl" mapstructure:"redirect_url"` // ExternalURL is available as a macro to the RedirectURL template. If not specified, either the syncer configuration // value or the host configuration value is used. ExternalURL string `yaml:"externalUrl" mapstructure:"external_url"` // UserMacro is available as a macro to the RedirectURL template. This value is specific to the bidder server // and has no default. UserMacro string `yaml:"userMacro" mapstructure:"user_macro"` }
SyncerEndpoint specifies the configuration of the URL returned by the /cookie_sync endpoint for a specific bidder. Bidders must specify at least one endpoint configuration to be eligible for selection during a user sync request.
URL is the only required field, although we highly recommend to use the available macros to make the configuration readable and maintainable. User sync urls include a redirect url back to Prebid Server which is url escaped and can be very diffcult for humans to read.
In most cases, bidders will specify a URL with a `{{.RedirectURL}}` macro for the call back to Prebid Server and a UserMacro which the bidder server will replace with the user's id. Example:
url: "https://sync.bidderserver.com/usersync?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}" userMacro: "$UID"
Prebid Server is configured with a default RedirectURL template matching the /setuid call. This may be overridden for all bidders with the `user_sync.redirect_url` host configuration or for a specific bidder with the RedirectURL value in this struct.
func (*SyncerEndpoint) Override ¶ added in v0.173.0
func (s *SyncerEndpoint) Override(original *SyncerEndpoint) *SyncerEndpoint
Override returns a new SyncerEndpoint object where values in the original are replaced by non-empty/non-default values in the override. No changes are made to the original or override SyncerEndpoint.
type TCF2 ¶
type TCF2 struct { Enabled bool `mapstructure:"enabled"` Purpose1 TCF2Purpose `mapstructure:"purpose1"` Purpose2 TCF2Purpose `mapstructure:"purpose2"` Purpose3 TCF2Purpose `mapstructure:"purpose3"` Purpose4 TCF2Purpose `mapstructure:"purpose4"` Purpose5 TCF2Purpose `mapstructure:"purpose5"` Purpose6 TCF2Purpose `mapstructure:"purpose6"` Purpose7 TCF2Purpose `mapstructure:"purpose7"` Purpose8 TCF2Purpose `mapstructure:"purpose8"` Purpose9 TCF2Purpose `mapstructure:"purpose9"` Purpose10 TCF2Purpose `mapstructure:"purpose10"` // Map of purpose configs for easy purpose lookup PurposeConfigs map[consentconstants.Purpose]*TCF2Purpose SpecialFeature1 TCF2SpecialFeature `mapstructure:"special_feature1"` PurposeOneTreatment TCF2PurposeOneTreatment `mapstructure:"purpose_one_treatment"` }
TCF2 defines the TCF2 specific configurations for GDPR
func (*TCF2) BasicEnforcementVendor ¶ added in v0.206.0
func (t *TCF2) BasicEnforcementVendor(openrtb_ext.BidderName) bool
BasicEnforcementVendor checks if the given bidder is considered a basic enforcement vendor which indicates whether weak vendor enforcement applies to that bidder. If set, the legal basis calculation for the bidder only considers consent to the purpose, not the vendor. The idea is that the publisher trusts this vendor to enforce the appropriate rules on their own. This only comes into play when enforceVendors is true as it lists those vendors that are exempt for vendor enforcement.
func (*TCF2) FeatureOneEnforced ¶ added in v0.206.0
FeatureOneEnforced checks if special feature one is enforced. If it is enforced, PBS will determine whether geo information may be passed through in the bid request.
func (*TCF2) FeatureOneVendorException ¶ added in v0.206.0
func (t *TCF2) FeatureOneVendorException(bidder openrtb_ext.BidderName) (value bool)
FeatureOneVendorException checks if the specified bidder is considered a vendor exception for special feature one. If a bidder is a vendor exception, PBS will bypass the pass geo calculation passing the geo information in the bid request.
func (*TCF2) IntegrationEnabled ¶ added in v0.206.0
func (t *TCF2) IntegrationEnabled(integrationType IntegrationType) bool
IntegrationEnabled checks if a given integration type is enabled. All integration types are considered either enabled or disabled based on the Enabled flag.
func (*TCF2) PurposeEnforced ¶ added in v0.206.0
func (t *TCF2) PurposeEnforced(purpose consentconstants.Purpose) (value bool)
PurposeEnforced checks if full enforcement is turned on for a given purpose. With full enforcement enabled, the GDPR full enforcement algorithm will execute for that purpose determining legal basis; otherwise it's skipped.
func (*TCF2) PurposeEnforcingVendors ¶ added in v0.206.0
func (t *TCF2) PurposeEnforcingVendors(purpose consentconstants.Purpose) (value bool)
PurposeEnforcingVendors checks if enforcing vendors is turned on for a given purpose. With enforcing vendors enabled, the GDPR full enforcement algorithm considers the GVL when determining legal basis; otherwise it's skipped.
func (*TCF2) PurposeOneTreatmentAccessAllowed ¶ added in v0.206.0
PurposeOneTreatmentAccessAllowed checks if purpose one treatment access is allowed.
func (*TCF2) PurposeOneTreatmentEnabled ¶ added in v0.206.0
PurposeOneTreatmentEnabled checks if purpose one treatment is enabled.
func (*TCF2) PurposeVendorException ¶ added in v0.206.0
func (t *TCF2) PurposeVendorException(purpose consentconstants.Purpose, bidder openrtb_ext.BidderName) (value bool)
PurposeVendorException checks if the specified bidder is considered a vendor exception for a given purpose. If a bidder is a vendor exception, the GDPR full enforcement algorithm will bypass the legal basis calculation assuming the request is valid and there isn't a "deny all" publisher restriction
type TCF2Purpose ¶ added in v0.168.0
type TCF2Purpose struct { Enabled bool `mapstructure:"enabled"` // Deprecated: Use enforce_purpose instead EnforcePurpose string `mapstructure:"enforce_purpose"` EnforceVendors bool `mapstructure:"enforce_vendors"` // Array of vendor exceptions that is used to create the hash table VendorExceptionMap so vendor names can be instantly accessed VendorExceptions []openrtb_ext.BidderName `mapstructure:"vendor_exceptions"` VendorExceptionMap map[openrtb_ext.BidderName]struct{} }
Making a purpose struct so purpose specific details can be added later.
type TCF2PurposeOneTreatment ¶ added in v0.168.0
type TCF2SpecialFeature ¶ added in v0.190.0
type TCF2SpecialFeature struct { Enforce bool `mapstructure:"enforce"` // Array of vendor exceptions that is used to create the hash table VendorExceptionMap so vendor names can be instantly accessed VendorExceptions []openrtb_ext.BidderName `mapstructure:"vendor_exceptions"` VendorExceptionMap map[openrtb_ext.BidderName]struct{} }
type TimeoutNotification ¶
type TrackingEventType ¶ added in v0.201.0
type TrackingEventType string
TrackingEventType indicates quartile events
const ( Start TrackingEventType = "start" FirstQuartile TrackingEventType = "firstQuartile" MidPoint TrackingEventType = "midPoint" ThirdQuartile TrackingEventType = "thirdQuartile" Complete TrackingEventType = "complete" )
type UserSync ¶ added in v0.173.0
type UserSync struct { Cooperative UserSyncCooperative `mapstructure:"coop_sync"` ExternalURL string `mapstructure:"external_url"` RedirectURL string `mapstructure:"redirect_url"` }
UserSync specifies the static global user sync configuration.
type UserSyncCooperative ¶ added in v0.173.0
type UserSyncCooperative struct { EnabledByDefault bool `mapstructure:"default"` PriorityGroups [][]string `mapstructure:"priority_groups"` }
UserSyncCooperative specifies the static global default cooperative cookie sync
type VASTEvent ¶ added in v0.201.0
type VASTEvent struct { CreateElement VASTEventElement `mapstructure:"create_element" json:"create_element"` Type TrackingEventType `mapstructure:"type" json:"type"` ExcludeDefaultURL bool `mapstructure:"exclude_default_url" json:"exclude_default_url"` URLs []string `mapstructure:"urls" json:"urls"` }
VASTEvent indicates the configurations required for injecting VAST event trackers within VAST XML
type VASTEventElement ¶ added in v0.201.0
type VASTEventElement string
VASTEventElement indicates valid VAST event element
const ( ImpressionVASTElement VASTEventElement = "impression" TrackingVASTElement VASTEventElement = "tracking" ClickTrackingVASTElement VASTEventElement = "clicktracking" CompanionClickThroughVASTElement VASTEventElement = "companionclickthrough" ErrorVASTElement VASTEventElement = "error" NonLinearClickTrackingVASTElement VASTEventElement = "nonlinearclicktracking" )