Skip to content
Closed
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
4 changes: 4 additions & 0 deletions modules/liveIntentIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ export const liveIntentIdSubmodule = {
result.index = { 'id': value.index }
}

if (value.sovrn) {
result.sovrn = { 'id': value.sovrn }
}

return result
}

Expand Down
14 changes: 14 additions & 0 deletions modules/userId/eids.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,20 @@ export const USER_IDS_CONFIG = {
}
},

// sovrn
'sovrn': {
source: 'liveintent.sovrn.com',
atype: 3,
getValue: function(data) {
return data.id;
},
getUidExt: function(data) {
if (data.ext) {
return data.ext;
}
}
},

// britepoolId
'britepoolid': {
source: 'britepool.com',
Expand Down
8 changes: 8 additions & 0 deletions modules/userId/eids.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ userIdAsEids = [
}]
},

{
source: 'liveintent.sovrn.com'',
uids: [{
id: 'some-random-id-value',
atype: 3
}]
},

{
source: 'media.net',
uids: [{
Expand Down
35 changes: 34 additions & 1 deletion test/spec/modules/eids_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe('eids array generation for known sub-modules', function() {
});
});

it('magnite with ext', function() {
it('index with ext', function() {
const userId = {
index: {'id': 'sample_id', 'ext': {'provider': 'some.provider.com'}}
};
Expand All @@ -264,6 +264,39 @@ describe('eids array generation for known sub-modules', function() {
});
});

it('sovrn', function() {
const userId = {
sovrn: {'id': 'sample_id'}
};
const newEids = createEidsArray(userId);
expect(newEids.length).to.equal(1);
expect(newEids[0]).to.deep.equal({
source: 'liveintent.sovrn.com',
uids: [{
id: 'sample_id',
atype: 3
}]
});
});

it('sovrn with ext', function() {
const userId = {
sovrn: {'id': 'sample_id', 'ext': {'provider': 'some.provider.com'}}
};
const newEids = createEidsArray(userId);
expect(newEids.length).to.equal(1);
expect(newEids[0]).to.deep.equal({
source: 'liveintent.sovrn.com',
uids: [{
id: 'sample_id',
atype: 3,
ext: {
provider: 'some.provider.com'
}
}]
});
});

it('britepoolId', function() {
const userId = {
britepoolid: 'some-random-id-value'
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/liveIntentIdMinimalSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ describe('LiveIntentMinimalId', function() {
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'index': 'bar'}, 'index': {'id': 'bar'}});
});

it('should decode a sovrn id to a seperate object when present', function() {
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', sovrn: 'bar' });
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'sovrn': 'bar'}, 'sovrn': {'id': 'bar'}});
});

it('should allow disabling nonId resolution', function() {
let callBackSpy = sinon.spy();
let submoduleCallback = liveIntentIdSubmodule.getId({ params: {
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/liveIntentIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ describe('LiveIntentId', function() {
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'medianet': 'bar'}, 'medianet': {'id': 'bar'}});
});

it('should decode a sovrn id to a seperate object when present', function() {
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', sovrn: 'bar' });
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'sovrn': 'bar'}, 'sovrn': {'id': 'bar'}});
});

it('should decode a magnite id to a seperate object when present', function() {
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', magnite: 'bar' });
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar'}});
Expand Down