-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Default account DSA support (#2955)
- Loading branch information
Showing
34 changed files
with
1,055 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/org/prebid/server/settings/model/AccountDsaConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.prebid.server.settings.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Value; | ||
|
||
@Value(staticConstructor = "of") | ||
public class AccountDsaConfig { | ||
|
||
@JsonProperty("default") | ||
DefaultDsa defaultDsa; | ||
|
||
@JsonProperty("gdpr-only") | ||
Boolean gdprOnly; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/org/prebid/server/settings/model/DefaultDsa.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.prebid.server.settings.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Value; | ||
|
||
import java.util.List; | ||
|
||
@Value(staticConstructor = "of") | ||
public class DefaultDsa { | ||
|
||
@JsonProperty("dsarequired") | ||
Integer dsaRequired; | ||
|
||
@JsonProperty("pubrender") | ||
Integer pubRender; | ||
|
||
@JsonProperty("datatopub") | ||
Integer dataToPub; | ||
|
||
List<DsaTransparency> transparency; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/org/prebid/server/settings/model/DsaTransparency.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.prebid.server.settings.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Value; | ||
|
||
import java.util.List; | ||
|
||
@Value(staticConstructor = "of") | ||
public class DsaTransparency { | ||
|
||
String domain; | ||
|
||
@JsonProperty("dsaparams") | ||
List<Integer> dsaParams; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/test/groovy/org/prebid/server/functional/model/config/AccountDsaConfig.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.prebid.server.functional.model.config | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import com.fasterxml.jackson.databind.PropertyNamingStrategies | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming | ||
import groovy.transform.ToString | ||
import org.prebid.server.functional.model.request.auction.Dsa | ||
|
||
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy) | ||
@ToString(includeNames = true, ignoreNulls = true) | ||
class AccountDsaConfig { | ||
|
||
@JsonProperty("default") | ||
Dsa defaultDsa | ||
Boolean gdprOnly | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/test/groovy/org/prebid/server/functional/model/request/auction/Dsa.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.prebid.server.functional.model.request.auction | ||
|
||
import com.fasterxml.jackson.databind.PropertyNamingStrategies | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming | ||
import groovy.transform.EqualsAndHashCode | ||
import groovy.transform.ToString | ||
import org.prebid.server.functional.util.PBSUtils | ||
|
||
@JsonNaming(PropertyNamingStrategies.LowerCaseStrategy) | ||
@EqualsAndHashCode | ||
@ToString(includeNames = true, ignoreNulls = true) | ||
class Dsa { | ||
|
||
DsaRequired dsaRequired | ||
DsaPubRender pubRender | ||
DsaDataToPub dataToPub | ||
List<DsaTransparency> transparency | ||
|
||
static Dsa getDefaultDsa(DsaRequired dsaRequired = PBSUtils.getRandomEnum(DsaRequired)) { | ||
new Dsa(dsaRequired: dsaRequired, | ||
pubRender: PBSUtils.getRandomEnum(DsaPubRender), | ||
dataToPub: PBSUtils.getRandomEnum(DsaDataToPub), | ||
transparency: [DsaTransparency.defaultDsaTransparency]) | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/test/groovy/org/prebid/server/functional/model/request/auction/DsaDataToPub.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.prebid.server.functional.model.request.auction | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue | ||
import groovy.transform.ToString | ||
|
||
@ToString(includeNames = true, ignoreNulls = true) | ||
enum DsaDataToPub { | ||
|
||
DO_NOT_SEND_TRANSPARENCY(0), | ||
OPTIONAL_TO_SEND(1), | ||
SEND_TRANSPARENCY(2) | ||
|
||
@JsonValue | ||
final int value | ||
|
||
private DsaDataToPub(int value) { | ||
this.value = value | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/test/groovy/org/prebid/server/functional/model/request/auction/DsaPubRender.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.prebid.server.functional.model.request.auction | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue | ||
import groovy.transform.ToString | ||
|
||
@ToString(includeNames = true, ignoreNulls = true) | ||
enum DsaPubRender { | ||
|
||
PUB_CANT_RENDER(0), | ||
PUB_MIGHT_RENDER(1), | ||
PUB_WILL_RENDER(2) | ||
|
||
@JsonValue | ||
final int value | ||
|
||
private DsaPubRender(int value) { | ||
this.value = value | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/test/groovy/org/prebid/server/functional/model/request/auction/DsaRequired.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.prebid.server.functional.model.request.auction | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue | ||
import groovy.transform.ToString | ||
|
||
@ToString(includeNames = true, ignoreNulls = true) | ||
enum DsaRequired { | ||
|
||
NOT_REQUIRED(0), | ||
SUPPORTED(1), | ||
REQUIRED(2), | ||
REQUIRED_PUBLISHER_IS_ONLINE_PLATFORM(3) | ||
|
||
@JsonValue | ||
final int value | ||
|
||
private DsaRequired(int value) { | ||
this.value = value | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...est/groovy/org/prebid/server/functional/model/request/auction/DsaTransparencyParam.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.prebid.server.functional.model.request.auction | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue | ||
import groovy.transform.ToString | ||
|
||
@ToString(includeNames = true, ignoreNulls = true) | ||
enum DsaTransparencyParam { | ||
|
||
PROFILING(1), | ||
BASIC_ADVERTISING(2), | ||
PRECISE_GEO(3) | ||
|
||
@JsonValue | ||
final int value | ||
|
||
private DsaTransparencyParam(int value) { | ||
this.value = value | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +0,0 @@ | ||
package org.prebid.server.functional.model.request.auction | ||
|
||
import com.fasterxml.jackson.databind.PropertyNamingStrategies | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming | ||
import groovy.transform.ToString | ||
import org.prebid.server.functional.util.PBSUtils | ||
|
||
@JsonNaming(PropertyNamingStrategies.LowerCaseStrategy) | ||
@ToString(includeNames = true, ignoreNulls = true) | ||
class RegsDsa { | ||
|
||
Integer dsaRequired | ||
Integer pubRender | ||
Integer dataToPub | ||
List<DsaTransparency> transparency | ||
|
||
static RegsDsa getDefaultRegsDsa(ReqsDsaRequiredType required) { | ||
new RegsDsa( | ||
dsaRequired: required.value, | ||
pubRender: PBSUtils.getRandomNumber(0, 2), | ||
dataToPub: PBSUtils.getRandomNumber(0, 2), | ||
transparency: [DsaTransparency.defaultRegsDsaTransparency] | ||
) | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,5 @@ class RegsExt { | |
Integer gdpr | ||
String usPrivacy | ||
String gpc | ||
RegsDsa dsa | ||
|
||
Dsa dsa | ||
} |
15 changes: 0 additions & 15 deletions
15
...test/groovy/org/prebid/server/functional/model/request/auction/ReqsDsaRequiredType.groovy
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,5 @@ class BidExt { | |
Prebid prebid | ||
BigDecimal origbidcpm | ||
Currency origbidcur | ||
BidExtDsa dsa | ||
|
||
Dsa dsa | ||
} |
Oops, something went wrong.