Skip to content

Commit

Permalink
Merkle endpoint configurable (#7400)
Browse files Browse the repository at this point in the history
Co-authored-by: skocheri <skocheri@rubiconproject.com>
  • Loading branch information
SKOCHERI and skocheri authored Sep 10, 2021
1 parent 6b1d704 commit 2b92153
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions integrationExamples/gpt/userId_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
{
"name": "merkleId",
"params": {
"endpoint": "https://test_endpoint/",
"vendor": "sdfg",
"sv_cid": "dfg",
"sv_pubid": "xcv",
Expand Down
8 changes: 6 additions & 2 deletions modules/merkleIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {submodule} from '../src/hook.js'
import {getStorageManager} from '../src/storageManager.js';

const MODULE_NAME = 'merkleId';
const ID_URL = 'https://id2.sv.rkdms.com/identity/';
const DEFAULT_REFRESH = 7 * 3600;
const SESSION_COOKIE_NAME = '_svsid';

Expand Down Expand Up @@ -42,7 +41,7 @@ function setSession(storage, response) {

function constructUrl(configParams) {
const session = getSession(configParams);
let url = ID_URL + `?vendor=${configParams.vendor}&sv_cid=${configParams.sv_cid}&sv_domain=${configParams.sv_domain}&sv_pubid=${configParams.sv_pubid}`;
let url = configParams.endpoint + `?vendor=${configParams.vendor}&sv_cid=${configParams.sv_cid}&sv_domain=${configParams.sv_domain}&sv_pubid=${configParams.sv_pubid}`;
if (session) {
url = `${url}&sv_session=${session}`;
}
Expand Down Expand Up @@ -126,6 +125,11 @@ export const merkleIdSubmodule = {
utils.logError('User ID - merkleId submodule requires a valid sv_pubid string to be defined');
return;
}

if (typeof configParams.endpoint !== 'string') {
utils.logError('User ID - merkleId submodule requires a valid endpoint string to be defined');
return;
}
if (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) {
utils.logError('User ID - merkleId submodule does not currently handle consent strings');
return;
Expand Down

0 comments on commit 2b92153

Please sign in to comment.