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

symitriDapRtdProvider : Hash user identity before using it #12129

Merged

Conversation

mp4symitri
Copy link
Contributor

@mp4symitri mp4symitri commented Aug 15, 2024

Type of change

  • Feature

Description of change

Added custom sha256 function to synchronously hash user identity as asynchronous hashing function can't be called from synchronous code.
Added code to ensure user identity is hashed before using it.
Updated test cases to test user identifier and hashing algorithm.

Other information

@mp4symitri mp4symitri changed the title Symitri DAP RTD adapter : Hash user identity before using it symitriDapRtdProvider : Hash user identity before using it Aug 15, 2024
*
*/

generateHash: function(message) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not use browser built in function or hashes already committed to other parts of the project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@patmmccann, Browser's built in function uses SubtleCrypto interface that provides crypto.subtle.digest to generate digest. However this digest function is an asynchronous function whereas we want to generate this hash from a synchronous code.
We do use SubtleCrypto for calculating entropy asynchronously but here we needed a synchronous version.

Copy link
Contributor

Choose a reason for hiding this comment

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

@patmmccann should this be called from a async call instead?

Are there any other concerns that we need to consider?

Copy link

Tread carefully! This PR adds 3 linter errors (possibly disabled through directives):

  • modules/symitriDapRtdProvider.js (+3 errors)

@jpalladino84 jpalladino84 force-pushed the symitriDapRtdModule-use-hashed-identity branch from 3a58ba9 to e503ca7 Compare August 26, 2024 15:12
Copy link

Tread carefully! This PR adds 3 linter errors (possibly disabled through directives):

  • modules/symitriDapRtdProvider.js (+3 errors)

@jpalladino84 jpalladino84 force-pushed the symitriDapRtdModule-use-hashed-identity branch from e503ca7 to 702da0d Compare August 26, 2024 15:14
Copy link

Tread carefully! This PR adds 2 linter errors (possibly disabled through directives):

  • modules/symitriDapRtdProvider.js (+2 errors)

@jpalladino84 jpalladino84 force-pushed the symitriDapRtdModule-use-hashed-identity branch from de99619 to 3674b47 Compare August 26, 2024 18:52
enable_download : true
vendor_specific: true
sidebarType : 1
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be in our docs repo as it is labels for our static site generator -> https://github.com/prebid/prebid.github.io. The markdown file here does not connect at all to our docs site and just lives in the PBjs project as reference

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the reminder @ChrisHuie! I will get this opened in a PR against the document repo ASAP!

@jpalladino84
Copy link
Contributor

Hi @ncolletti

Thanks to @ChrisHuie the build is passing and I update the documentation on prebid.github.io .

Let me know if you have any questions or concerns!

@ChrisHuie ChrisHuie merged commit 25667cd into prebid:master Sep 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants