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

initial commit for activity control changes #496

Open
wants to merge 2 commits into
base: openwrap_8_2_0_20230706114031
Choose a base branch
from
Open
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src_new/adapters/prebid.js
Original file line number Diff line number Diff line change
@@ -846,6 +846,7 @@ function assignCcpaConfigIfRequired(prebidConfig){
cmpApi: CONFIG.getCCPACmpApi(),
timeout: CONFIG.getCCPATimeout(),
};
COMMON_CONFIG.assignAllowActivitiesConfig(prebidConfig);
}
}

24 changes: 23 additions & 1 deletion src_new/common.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
var config = require("./conf.js");
var CONSTANTS = require("./constants.js");
var refThis = this;

exports.getGdprActionTimeout = function() {
var gdprActionTimeout = config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.GDPR_ACTION_TIMEOUT];
return gdprActionTimeout ? window.parseInt(gdprActionTimeout) : 0;
};
};

exports.isCCPAConsentDenied = function() {
var retValue = true;
var consentStr = window.consentData || "";
if (consentStr === undefined || consentStr.length === 0 || consentStr === '1---' || consentStr === '1NNN' || consentStr === '1YNN')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
if (consentStr === undefined || consentStr.length === 0 || consentStr === '1---' || consentStr === '1NNN' || consentStr === '1YNN')
if (consentStr === undefined || consentStr.length === 0 || consentStr === "1---" || consentStr === '1NNN' || consentStr === '1YNN')

retValue = true;
else if (consentStr === '1YYY' || consentStr === '1YYN')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
else if (consentStr === '1YYY' || consentStr === '1YYN')
else if (consentStr === "1YYY" || consentStr === '1YYN')

retValue = false;
return retValue;
}

exports.assignAllowActivitiesConfig = function(configs) {
configs.allowActivities = {
enrichEids: {
rules: [{
condition: refThis.isCCPAConsentDenied,
allow: false
}]
}
}
}
1 change: 1 addition & 0 deletions src_new/controllers/idhub.js
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ refThis.setConfig = function(){
}

if (CONFIG.getCCPA()) {
COMMON_CONFIG.assignAllowActivitiesConfig(prebidConfig);
if(!prebidConfig["consentManagement"]){
prebidConfig["consentManagement"] = {};
}