Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORTB 2.6: Full support with down convert for 2.5 adapters #4019

Merged
merged 19 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9cf7495
ORTB 2.6 upconvert, validation, usage and unit test updates (#3970)
bsardo Oct 11, 2024
82ecf6f
ORTB 2.6: Consolidate CleanOpenRTBRequest loops (#3974)
bsardo Oct 11, 2024
c2d4387
Schain writer receives request wrapper instead of request (#3976)
VeronikaSolovei9 Oct 14, 2024
99b833a
ORTB 2.6: Code fixes and unit test updates after consolidating loops …
bsardo Oct 14, 2024
1283264
ORTB 2.6: Temporarily remove down convert and make test suite pass (#…
bsardo Oct 19, 2024
8758945
ORTB 2.6: Push wrapper into prepare user function (#4002)
bsardo Oct 21, 2024
4963906
ORTB 2.6: Push wrapper into set legacy from GPP functions (#4001)
bsardo Oct 21, 2024
64e7c4f
ORTB 2.6: Pass bidder request wrapper into isBidderBlockedByPrivacy (…
bsardo Oct 21, 2024
d6b07ab
ORTB 2.6: Harden SetImps to cover larger changes (#4004)
hhhjort Oct 22, 2024
b2d6db8
ORTB 2.6: Push wrapper into Eidpermissions and ApplyFPD (#3998)
VeronikaSolovei9 Oct 24, 2024
5539f33
ORTB 2.6: Call convert down to 2.5 (#4008)
bsardo Oct 24, 2024
470cc49
ORTB 2.6: Fix non-JSON tests (#4009)
hhhjort Oct 25, 2024
c482a75
ORTB 2.6: Adds a Regs clone (#4012)
hhhjort Oct 25, 2024
88630ff
ORTB 2.6: Fix AMP endpoint openrtb2 tests and add AMP upconvert test …
bsardo Oct 25, 2024
9364cb8
ORTB 2.6: Add auction endpoint test and allow capturing validated req…
bsardo Oct 26, 2024
a0d3e56
ORTB 2.6: Test exchange json fixes and remove clear fields function c…
VeronikaSolovei9 Oct 27, 2024
8636a19
ORTB 2.6: Endpoint JSON test framework captures mock bidder requests …
bsardo Oct 28, 2024
a496202
Review feedback
bsardo Oct 29, 2024
9685f12
Merge branch 'master' into ortb26
bsardo Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adapters/openx/openx.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func preprocess(imp *openrtb2.Imp, reqExt *openxReqExt) error {

if imp.Video != nil {
videoCopy := *imp.Video
if bidderExt.Prebid != nil && bidderExt.Prebid.IsRewardedInventory != nil && *bidderExt.Prebid.IsRewardedInventory == 1 {
if imp.Rwdd == 1 {
videoCopy.Ext = json.RawMessage(`{"rewarded":1}`)
} else {
videoCopy.Ext = nil
Expand Down
7 changes: 3 additions & 4 deletions adapters/openx/openxtest/exemplary/video-rewarded.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
}
},
"instl": 1,
"rwdd": 1,
"ext": {
"bidder": {
"unit": "539439964",
"delDomain": "se-demo-d.openx.net"
},
"prebid": {
"is_rewarded_inventory": 1
}
}
}
Expand All @@ -46,7 +44,8 @@
}
},
"tagid": "539439964",
"instl": 1
"instl": 1,
"rwdd": 1
}
],
"ext": {
Expand Down
2 changes: 1 addition & 1 deletion amp/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func buildGdprTCF2ConsentWriter(ampParams Params) gdpr.ConsentWriter {
// set regs.ext.gdpr if non-nil gdpr_applies was set to true
gdprValue = parseGdprApplies(ampParams.GdprApplies)
}
writer.RegExtGDPR = &gdprValue
writer.GDPR = &gdprValue

return writer
}
Expand Down
40 changes: 20 additions & 20 deletions amp/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ func TestPrivacyReader(t *testing.T) {
},
expected: expectedResults{
policyWriter: gdpr.ConsentWriter{
Consent: "CPdiPIJPdiPIJACABBENAzCv_____3___wAAAQNd_X9cAAAAAAAA",
RegExtGDPR: &int8One,
Consent: "CPdiPIJPdiPIJACABBENAzCv_____3___wAAAQNd_X9cAAAAAAAA",
GDPR: &int8One,
},
warning: nil,
},
Expand Down Expand Up @@ -378,8 +378,8 @@ func TestPrivacyReader(t *testing.T) {
},
expected: expectedResults{
policyWriter: gdpr.ConsentWriter{
Consent: "CPdiPIJPdiPIJACABBENAzCv_____3___wAAAQNd_X9cAAAAAAAA",
RegExtGDPR: &int8One,
Consent: "CPdiPIJPdiPIJACABBENAzCv_____3___wAAAQNd_X9cAAAAAAAA",
GDPR: &int8One,
},
warning: nil,
},
Expand All @@ -400,8 +400,8 @@ func TestPrivacyReader(t *testing.T) {
},
expected: expectedResults{
policyWriter: gdpr.ConsentWriter{
Consent: "INVALID_GDPR",
RegExtGDPR: &int8One,
Consent: "INVALID_GDPR",
GDPR: &int8One,
},
warning: &errortypes.Warning{
Message: "Consent string 'INVALID_GDPR' is not a valid TCF2 consent string.",
Expand All @@ -420,8 +420,8 @@ func TestPrivacyReader(t *testing.T) {
},
expected: expectedResults{
policyWriter: gdpr.ConsentWriter{
Consent: "INVALID_GDPR",
RegExtGDPR: &int8Zero,
Consent: "INVALID_GDPR",
GDPR: &int8Zero,
},
warning: &errortypes.Warning{
Message: "Consent string 'INVALID_GDPR' is not a valid TCF2 consent string.",
Expand All @@ -440,8 +440,8 @@ func TestPrivacyReader(t *testing.T) {
},
expected: expectedResults{
policyWriter: gdpr.ConsentWriter{
Consent: "CPdiPIJPdiPIJACABBENAzCv_____3___wAAAQNd_X9cAAAAAAAA",
RegExtGDPR: &int8Zero,
Consent: "CPdiPIJPdiPIJACABBENAzCv_____3___wAAAQNd_X9cAAAAAAAA",
GDPR: &int8Zero,
},
warning: nil,
},
Expand All @@ -457,8 +457,8 @@ func TestPrivacyReader(t *testing.T) {
},
expected: expectedResults{
policyWriter: gdpr.ConsentWriter{
Consent: "CPdiPIJPdiPIJACABBENAzCv_____3___wAAAQNd_X9cAAAAAAAA",
RegExtGDPR: &int8One,
Consent: "CPdiPIJPdiPIJACABBENAzCv_____3___wAAAQNd_X9cAAAAAAAA",
GDPR: &int8One,
},
warning: nil,
},
Expand All @@ -473,8 +473,8 @@ func TestPrivacyReader(t *testing.T) {
},
expected: expectedResults{
policyWriter: gdpr.ConsentWriter{
Consent: "CPdiPIJPdiPIJACABBENAzCv_____3___wAAAQNd_X9cAAAAAAAA",
RegExtGDPR: &int8One,
Consent: "CPdiPIJPdiPIJACABBENAzCv_____3___wAAAQNd_X9cAAAAAAAA",
GDPR: &int8One,
},
warning: nil,
},
Expand Down Expand Up @@ -559,8 +559,8 @@ func TestBuildGdprTCF2ConsentWriter(t *testing.T) {
desc: "gdpr_applies not set",
inParams: Params{Consent: consentString},
expectedWriter: gdpr.ConsentWriter{
Consent: consentString,
RegExtGDPR: &int8One,
Consent: consentString,
GDPR: &int8One,
},
},
{
Expand All @@ -570,8 +570,8 @@ func TestBuildGdprTCF2ConsentWriter(t *testing.T) {
GdprApplies: &boolFalse,
},
expectedWriter: gdpr.ConsentWriter{
Consent: consentString,
RegExtGDPR: &int8Zero,
Consent: consentString,
GDPR: &int8Zero,
},
},
{
Expand All @@ -581,8 +581,8 @@ func TestBuildGdprTCF2ConsentWriter(t *testing.T) {
GdprApplies: &boolTrue,
},
expectedWriter: gdpr.ConsentWriter{
Consent: consentString,
RegExtGDPR: &int8One,
Consent: consentString,
GDPR: &int8One,
},
},
}
Expand Down
10 changes: 3 additions & 7 deletions analytics/agma/agma_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,11 @@ func (l *AgmaLogger) extractPublisherAndSite(requestWrapper *openrtb_ext.Request
}

func (l *AgmaLogger) shouldTrackEvent(requestWrapper *openrtb_ext.RequestWrapper) (bool, string) {
userExt, err := requestWrapper.GetUserExt()
if err != nil || userExt == nil {
if requestWrapper.User == nil {
return false, ""
}
consent := userExt.GetConsent()
if consent == nil {
return false, ""
}
consentStr := *consent
consentStr := requestWrapper.User.Consent

parsedConsent, err := vendorconsent.ParseString(consentStr)
if err != nil {
return false, ""
Expand Down
25 changes: 12 additions & 13 deletions analytics/agma/agma_module_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package agma

import (
"encoding/json"
"io"
"net/http"
"net/http/httptest"
Expand Down Expand Up @@ -37,7 +36,7 @@ var mockValidAuctionObject = analytics.AuctionObject{
UA: "ua",
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "` + agmaConsent + `"}`),
Consent: agmaConsent,
},
},
},
Expand All @@ -59,7 +58,7 @@ var mockValidVideoObject = analytics.VideoObject{
UA: "ua",
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "` + agmaConsent + `"}`),
Consent: agmaConsent,
},
},
},
Expand All @@ -81,7 +80,7 @@ var mockValidAmpObject = analytics.AmpObject{
UA: "ua",
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "` + agmaConsent + `"}`),
Consent: agmaConsent,
},
},
},
Expand Down Expand Up @@ -212,7 +211,7 @@ func TestShouldTrackEvent(t *testing.T) {
},
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "` + agmaConsent + `"}`),
Consent: agmaConsent,
},
},
})
Expand Down Expand Up @@ -245,7 +244,7 @@ func TestShouldTrackEvent(t *testing.T) {
},
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "CP4LywcP4LywcLRAAAENCZCAAAIAAAIAAAAAIxQAQIwgAAAA.II7Nd_X__bX9n-_7_6ft0eY1f9_r37uQzDhfNs-8F3L_W_LwX32E7NF36tq4KmR4ku1bBIQNtHMnUDUmxaolVrzHsak2cpyNKJ_JkknsZe2dYGF9Pn9lD-YKZ7_5_9_f52T_9_9_-39z3_9f___dv_-__-vjf_599n_v9fV_78_Kf9______-____________8A"}`),
Consent: "CP4LywcP4LywcLRAAAENCZCAAAIAAAIAAAAAIxQAQIwgAAAA.II7Nd_X__bX9n-_7_6ft0eY1f9_r37uQzDhfNs-8F3L_W_LwX32E7NF36tq4KmR4ku1bBIQNtHMnUDUmxaolVrzHsak2cpyNKJ_JkknsZe2dYGF9Pn9lD-YKZ7_5_9_f52T_9_9_-39z3_9f___dv_-__-vjf_599n_v9fV_78_Kf9______-____________8A",
},
},
})
Expand All @@ -263,7 +262,7 @@ func TestShouldTrackEvent(t *testing.T) {
},
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "CP4LywcP4LywcLRAAAENCZCAAIAAAAAAAAAAIxQAQIxAAAAA.II7Nd_X__bX9n-_7_6ft0eY1f9_r37uQzDhfNs-8F3L_W_LwX32E7NF36tq4KmR4ku1bBIQNtHMnUDUmxaolVrzHsak2cpyNKJ_JkknsZe2dYGF9Pn9lD-YKZ7_5_9_f52T_9_9_-39z3_9f___dv_-__-vjf_599n_v9fV_78_Kf9______-____________8A"}`),
Consent: "CP4LywcP4LywcLRAAAENCZCAAIAAAAAAAAAAIxQAQIxAAAAA.II7Nd_X__bX9n-_7_6ft0eY1f9_r37uQzDhfNs-8F3L_W_LwX32E7NF36tq4KmR4ku1bBIQNtHMnUDUmxaolVrzHsak2cpyNKJ_JkknsZe2dYGF9Pn9lD-YKZ7_5_9_f52T_9_9_-39z3_9f___dv_-__-vjf_599n_v9fV_78_Kf9______-____________8A",
},
},
})
Expand All @@ -281,7 +280,7 @@ func TestShouldTrackEvent(t *testing.T) {
},
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "` + agmaConsent + `"}`),
Consent: agmaConsent,
},
},
})
Expand All @@ -296,7 +295,7 @@ func TestShouldTrackEvent(t *testing.T) {
ID: "track-me",
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "` + agmaConsent + `"}`),
Consent: agmaConsent,
},
},
})
Expand All @@ -311,7 +310,7 @@ func TestShouldTrackEvent(t *testing.T) {
Bundle: "track-me",
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "` + agmaConsent + `"}`),
Consent: agmaConsent,
},
},
})
Expand Down Expand Up @@ -359,7 +358,7 @@ func TestShouldTrackMultipleAccounts(t *testing.T) {
},
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "` + agmaConsent + `"}`),
Consent: agmaConsent,
},
},
})
Expand All @@ -377,7 +376,7 @@ func TestShouldTrackMultipleAccounts(t *testing.T) {
},
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"consent": "` + agmaConsent + `"}`),
Consent: agmaConsent,
},
},
})
Expand Down Expand Up @@ -691,7 +690,7 @@ func TestRaceEnd2End(t *testing.T) {

time.Sleep(250 * time.Millisecond)

expected := "[{\"type\":\"amp\",\"id\":\"some-id\",\"code\":\"abcd\",\"site\":{\"id\":\"track-me-site\",\"publisher\":{\"id\":\"track-me\"}},\"device\":{\"ua\":\"ua\"},\"user\":{\"ext\":{\"consent\": \"" + agmaConsent + "\"}},\"created_at\":\"2023-02-01T00:00:00Z\"},{\"type\":\"amp\",\"id\":\"some-id\",\"code\":\"abcd\",\"site\":{\"id\":\"track-me-site\",\"publisher\":{\"id\":\"track-me\"}},\"device\":{\"ua\":\"ua\"},\"user\":{\"ext\":{\"consent\": \"" + agmaConsent + "\"}},\"created_at\":\"2023-02-01T00:00:00Z\"}]"
expected := "[{\"type\":\"amp\",\"id\":\"some-id\",\"code\":\"abcd\",\"site\":{\"id\":\"track-me-site\",\"publisher\":{\"id\":\"track-me\"}},\"device\":{\"ua\":\"ua\"},\"user\":{\"consent\":\"" + agmaConsent + "\"},\"created_at\":\"2023-02-01T00:00:00Z\"},{\"type\":\"amp\",\"id\":\"some-id\",\"code\":\"abcd\",\"site\":{\"id\":\"track-me-site\",\"publisher\":{\"id\":\"track-me\"}},\"device\":{\"ua\":\"ua\"},\"user\":{\"consent\":\"" + agmaConsent + "\"},\"created_at\":\"2023-02-01T00:00:00Z\"}]"

mu.Lock()
actual := requestBodyAsString
Expand Down
8 changes: 8 additions & 0 deletions endpoints/openrtb2/amp_auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,14 @@ func (deps *endpointDeps) parseAmpRequest(httpRequest *http.Request) (req *openr
// move to using the request wrapper
req = &openrtb_ext.RequestWrapper{BidRequest: reqNormal}

// normalize to openrtb 2.6
if err := openrtb_ext.ConvertUpTo26(req); err != nil {
errs = append(errs, err)
}
if errortypes.ContainsFatalError(errs) {
return
}

// Need to ensure cache and targeting are turned on
e = initAmpTargetingAndCache(req)
if errs = append(errs, e...); errortypes.ContainsFatalError(errs) {
Expand Down
Loading
Loading