From 4d7e45d04932980f44c122040ed6cbf4c27d9570 Mon Sep 17 00:00:00 2001 From: Mikael Lundin Date: Thu, 5 Sep 2024 10:24:25 +0200 Subject: [PATCH] Removed the requirement for advertiser legal name --- adapters/adnuntius/adnuntius.go | 10 +- .../check-dsa-legalName-omitted.json | 133 ++++++++++++++++++ ...opy.json => check-dsa-pubrender-zero.json} | 0 3 files changed, 140 insertions(+), 3 deletions(-) create mode 100644 adapters/adnuntius/adnuntiustest/supplemental/check-dsa-legalName-omitted.json rename adapters/adnuntius/adnuntiustest/supplemental/{check-dsa-pubrender-zero copy.json => check-dsa-pubrender-zero.json} (100%) diff --git a/adapters/adnuntius/adnuntius.go b/adapters/adnuntius/adnuntius.go index baaebcc780c..16f4319b119 100644 --- a/adapters/adnuntius/adnuntius.go +++ b/adapters/adnuntius/adnuntius.go @@ -387,12 +387,16 @@ func generateReturnExt(ad Ad, request *openrtb2.BidRequest) (json.RawMessage, er } } - if requestRegsExt != nil && requestRegsExt.DSA != nil && &ad.Advertiser != nil && &ad.Advertiser.LegalName != nil { + if requestRegsExt != nil && requestRegsExt.DSA != nil { + legalName := ad.Advertiser.Name + if ad.Advertiser.LegalName != "" { + legalName = ad.Advertiser.LegalName + } ext := &openrtb_ext.ExtBid{ DSA: &openrtb_ext.ExtBidDSA{ AdRender: &adRender, - Paid: ad.Advertiser.LegalName, - Behalf: ad.Advertiser.LegalName, + Paid: legalName, + Behalf: legalName, }, } returnExt, err := json.Marshal(ext) diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-legalName-omitted.json b/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-legalName-omitted.json new file mode 100644 index 00000000000..0b44aa16dca --- /dev/null +++ b/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-legalName-omitted.json @@ -0,0 +1,133 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "user": { + "id": "1kjh3429kjh295jkl" + }, + "site": { + "ext":{ + "data" : { + "key": ["value"] + } + } + }, + "regs": { + "ext": { + "dsa": { + "dsarequired": 3, + "datatopub": 1 + } + } + }, + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "auId": "123" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://whatever.url?format=prebid&tzo=0", + "body": { + "adUnits": [ + { + "auId": "123", + "targetId": "123-test-imp-id", + "dimensions": [[300,250],[300,600]] + } + ], + "kv": { + "key": ["value"] + }, + "metaData": { + "usi": "1kjh3429kjh295jkl" + }, + "context": "unknown" + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "adUnits": [ + { + "auId": "0000000000000123", + "targetId": "123-test-imp-id", + "html": "", + "responseId": "adn-rsp-900646517", + "ads": [ + { + "destinationUrls": { + "url": "http://www.google.com" + }, + "bid": { + "amount": 20.0, + "currency": "NOK" + }, + "adId": "adn-id-1559784094", + "creativeWidth": "980", + "creativeHeight": "240", + "creativeId": "jn9hpzvlsf8cpdmm", + "lineItemId": "q7y9qm5b0xt9htrv", + "advertiser": { + "name": "Name" + } + } + ] + } + ] + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [ + { + "bid": { + "id": "adn-id-1559784094", + "impid": "test-imp-id", + "price": 20000, + "adm": "", + "adid": "adn-id-1559784094", + "adomain": [ + "google.com" + ], + "cid": "q7y9qm5b0xt9htrv", + "crid": "jn9hpzvlsf8cpdmm", + "w": 980, + "h": 240, + "ext": { + "dsa": { + "paid": "Name", + "behalf": "Name", + "adrender": 0 + } + } + }, + "type": "banner" + + } + ], + "currency": "NOK" + } + ] +} \ No newline at end of file diff --git a/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-pubrender-zero copy.json b/adapters/adnuntius/adnuntiustest/supplemental/check-dsa-pubrender-zero.json similarity index 100% rename from adapters/adnuntius/adnuntiustest/supplemental/check-dsa-pubrender-zero copy.json rename to adapters/adnuntius/adnuntiustest/supplemental/check-dsa-pubrender-zero.json