-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #345 from maybellineboon/private-aggregation-cloud…
…-update Private aggregation cloud update -> please run test in Dev Environment
- Loading branch information
Showing
14 changed files
with
70 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
let dsp = document.currentScript.getAttribute('dsp'); | ||
let bucket = document.currentScript.getAttribute('bucket'); | ||
let cloudEnv = document.currentScript.getAttribute('cloudenv'); | ||
window.addEventListener('load', (event) => { | ||
let iframeAws = document.createElement('iframe'); | ||
let iframeGcp = document.createElement('iframe'); | ||
// let dsp = document.currentScript.getAttribute('dsp'); | ||
iframeAws.src = `https://${dsp}/private-aggregation-aws`; | ||
iframeGcp.src = `https://${dsp}/private-aggregation-gcp`; | ||
document.body.appendChild(iframeAws); | ||
document.body.appendChild(iframeGcp); | ||
if (cloudEnv == 'aws' || cloudEnv == 'gcp') { | ||
let iframe = document.createElement('iframe'); | ||
iframe.src = `https://${dsp}/private-aggregation?bucket=${bucket}&cloudEnv=${cloudEnv}`; | ||
document.body.appendChild(iframe); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
services/dsp/src/public/js/private-aggregation-worklet-aws.js
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
services/dsp/src/public/js/private-aggregation-worklet-gcp.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class TestPrivateAggregation { | ||
async run(data) { | ||
let cloudEnv = await sharedStorage.get('cloudenv'); | ||
console.log(`Enabling ${cloudEnv} Private Aggregation Debug Mode`); | ||
privateAggregation.enableDebugMode({debugKey: 1234n}); | ||
let bucketKey = await sharedStorage.get('bucket'); | ||
if (bucketKey === 'undefined') { | ||
console.log( | ||
'No bucket key found for client. Adding default bucketKey 1234567890.', | ||
); | ||
bucketKey = '1234567890'; | ||
sharedStorage.set('bucketKey', bucketKey); | ||
} else { | ||
console.log(`Bucket Key found: ${bucketKey}`); | ||
} | ||
function convertToBucket(bucketId) { | ||
return BigInt(bucketId); | ||
} | ||
const bucket = convertToBucket(bucketKey); | ||
const value = 128; | ||
privateAggregation.contributeToHistogram({bucket, value}); | ||
sharedStorage.clear(); | ||
} | ||
} | ||
|
||
register('test-private-aggregation', TestPrivateAggregation); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
let bucket = document.currentScript.getAttribute('bucket'); | ||
let cloudEnv = document.currentScript.getAttribute('cloudenv'); | ||
|
||
sharedStorage.set('bucket', `${bucket}`); | ||
sharedStorage.set('cloudenv', `${cloudEnv}`); | ||
console.log( | ||
`https://publickeyservice.msmt.${cloudEnv}.privacysandboxservices.com`, | ||
); | ||
|
||
async function runPrivateAggregation() { | ||
const privateAggCloud = { | ||
'privateAggregationConfig': { | ||
'aggregationCoordinatorOrigin': `https://publickeyservice.msmt.${cloudEnv}.privacysandboxservices.com`, | ||
}, | ||
}; | ||
await window.sharedStorage.worklet.addModule( | ||
'js/private-aggregation-worklet.js', | ||
); | ||
await window.sharedStorage.run('test-private-aggregation', privateAggCloud); | ||
} | ||
|
||
runPrivateAggregation(); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<html> | ||
<header> | ||
<script src="/js/private-aggregation.js"></script> | ||
<script src="/js/private-aggregation.js" bucket="<%= `${bucket}` %>" cloudenv="<%= `${cloudEnv}` %>"></script> | ||
</header> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters