Skip to content

Commit

Permalink
Remove TCF1 support (#1129)
Browse files Browse the repository at this point in the history
  • Loading branch information
BraslavskiyAndrey authored Jun 25, 2021
1 parent 36836dd commit 04f7a0f
Show file tree
Hide file tree
Showing 29 changed files with 444 additions and 1,527 deletions.
2 changes: 1 addition & 1 deletion docs/bidders/appnexus.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The AppNexus endpoint expects `imp.displaymanagerver` to be populated for mobile
requests, however not all SDKs will populate this field. If the `imp.displaymanagerver` field
is not supplied for an `imp`, but `request.app.ext.prebid.source`
and `request.app.ext.prebid.version` are supplied, the adapter will fill in a value for
`diplaymanagerver`. It will concatonate the two `app` fields as `<source>-<version>` to fill in
`diplaymanagerver`. It will concatenate the two `app` fields as `<source>-<version>` to fill in
the empty `displaymanagerver` before sending the request to AppNexus.

## Test Request
Expand Down
10 changes: 5 additions & 5 deletions docs/config-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,11 @@ If not defined in config all other Health Checkers would be disabled and endpoin
- `gdpr.special-features.sfN.vendor-exceptions[]` - bidder names that will be treated opposite to `sfN.enforce` value.
- `gdpr.purpose-one-treatment-interpretation` - option that allows to skip the Purpose one enforcement workflow.
- `gdpr.vendorlist.default-timeout-ms` - default operation timeout for obtaining new vendor list.
- `gdpr.vendorlist.vN.http-endpoint-template` - template string for vendor list url, where `{VERSION}` is used as version number placeholder.
- `gdpr.vendorlist.vN.refresh-missing-list-period-ms` - time to wait between attempts to fetch vendor list version that previously was reported to be missing by origin. Default `3600000` (one hour).
- `gdpr.vendorlist.vN.fallback-vendor-list-path` - location on the file system of the fallback vendor list that will be used in place of missing vendor list versions. Optional.
- `gdpr.vendorlist.vN.deprecated` - Flag to show is this vendor list is deprecated or not.
- `gdpr.vendorlist.vN.cache-dir` - directory for local storage cache for vendor list. Should be with `WRITE` permissions for user application run from.
- `gdpr.vendorlist.v2.http-endpoint-template` - template string for vendor list url version 2.
- `gdpr.vendorlist.v2.refresh-missing-list-period-ms` - time to wait between attempts to fetch vendor list version that previously was reported to be missing by origin. Default `3600000` (one hour).
- `gdpr.vendorlist.v2.fallback-vendor-list-path` - location on the file system of the fallback vendor list that will be used in place of missing vendor list versions. Optional.
- `gdpr.vendorlist.v2.deprecated` - Flag to show is this vendor list is deprecated or not.
- `gdpr.vendorlist.v2.cache-dir` - directory for local storage cache for vendor list. Should be with `WRITE` permissions for user application run from.

## CCPA
- `ccpa.enforce` - if equals to `true` enforces to check ccpa policy, otherwise ignore ccpa verification.
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,12 @@
<version>${wiremock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.iabtcf</groupId>
<artifactId>iabtcf-encoder</artifactId>
<version>${iabtcf.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
Expand Down
2 changes: 0 additions & 2 deletions sample/prebid-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,5 @@ settings:
stored-responses-dir:
gdpr:
vendorlist:
v1:
cache-dir: /var/tmp/vendor1
v2:
cache-dir: /var/tmp/vendor2
7 changes: 3 additions & 4 deletions src/main/java/org/prebid/server/metric/Metrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@ public void updatePrivacyTcfInvalidMetric() {
}

public void updatePrivacyTcfRequestsMetric(int version) {
final UpdatableMetrics versionMetrics = version == 2 ? privacy().tcf().v2() : privacy().tcf().v1();
final UpdatableMetrics versionMetrics = privacy().tcf().fromVersion(version);
versionMetrics.incCounter(MetricName.requests);
}

public void updatePrivacyTcfGeoMetric(int version, Boolean inEea) {
final UpdatableMetrics versionMetrics = version == 2 ? privacy().tcf().v2() : privacy().tcf().v1();
final UpdatableMetrics versionMetrics = privacy().tcf().fromVersion(version);

final MetricName metricName = inEea == null
? MetricName.unknown_geo
Expand All @@ -405,8 +405,7 @@ public void updatePrivacyTcfVendorListFallbackMetric(int version) {

private void updatePrivacyTcfVendorListMetric(int version, MetricName metricName) {
final TcfMetrics tcfMetrics = privacy().tcf();
final TcfMetrics.TcfVersionMetrics tcfVersionMetrics = version == 2 ? tcfMetrics.v2() : tcfMetrics.v1();
tcfVersionMetrics.vendorList().incCounter(metricName);
tcfMetrics.fromVersion(version).vendorList().incCounter(metricName);
}

public void updateConnectionAcceptErrors() {
Expand Down
19 changes: 13 additions & 6 deletions src/main/java/org/prebid/server/metric/TcfMetrics.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.prebid.server.metric;

import com.codahale.metrics.MetricRegistry;
import org.prebid.server.exception.PreBidException;

import java.util.Objects;
import java.util.function.Function;
Expand All @@ -10,6 +11,9 @@
*/
class TcfMetrics extends UpdatableMetrics {

private static final int TCF_V1_VERSION = 1;
private static final int TCF_V2_VERSION = 2;

private final TcfVersionMetrics tcfVersion1Metrics;
private final TcfVersionMetrics tcfVersion2Metrics;

Expand All @@ -23,12 +27,15 @@ class TcfMetrics extends UpdatableMetrics {
tcfVersion2Metrics = new TcfVersionMetrics(metricRegistry, counterType, createTcfPrefix(prefix), "v2");
}

TcfVersionMetrics v1() {
return tcfVersion1Metrics;
}

TcfVersionMetrics v2() {
return tcfVersion2Metrics;
TcfVersionMetrics fromVersion(int version) {
switch (version) {
case TCF_V1_VERSION:
return tcfVersion1Metrics;
case TCF_V2_VERSION:
return tcfVersion2Metrics;
default:
throw new PreBidException(String.format("Unknown tcf version %s", version));
}
}

private static String createTcfPrefix(String prefix) {
Expand Down
181 changes: 0 additions & 181 deletions src/main/java/org/prebid/server/privacy/gdpr/GdprService.java

This file was deleted.

Loading

0 comments on commit 04f7a0f

Please sign in to comment.