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

Merkle Id System: configurable endpoint #7400

Merged
merged 1 commit into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
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 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