-
Notifications
You must be signed in to change notification settings - Fork 113
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
fix: encode &, < and > to html counterparts in adobe analytics #2854
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the WalkthroughThe changes involve enhancing security and data clarity in an Adobe Analytics integration. A new utility function Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- src/v0/destinations/adobe_analytics/transform.js (3 hunks)
- src/v0/destinations/adobe_analytics/utils.js (3 hunks)
- test/integrations/destinations/adobe_analytics/processor/data.ts (23 hunks)
Additional comments: 15
src/v0/destinations/adobe_analytics/transform.js (4)
27-30: The import of the
escapeToHTML
function is correct and follows the established pattern of importing utility functions from./utils
.77-81: The application of
escapeToHTML
topayload.linkURL
is a good security practice to prevent XSS vulnerabilities by escaping HTML special characters.99-103: The application of
escapeToHTML
topayload.pageUrl
is a good security practice to prevent XSS vulnerabilities by escaping HTML special characters.104-105: Consider whether
payload.pageName
should also be escaped usingescapeToHTML
if it can contain user input or other data that might be at risk for XSS.src/v0/destinations/adobe_analytics/utils.js (3)
85-94: The
escapeToHTML
function correctly replaces special characters with their HTML entities to prevent XSS vulnerabilities.109-122: The
rudderPropToDestMap
function correctly usesescapeToHTML
to escape values before adding them to the payload.219-223: The
module.exports
is correctly updated to include theescapeToHTML
function.test/integrations/destinations/adobe_analytics/processor/data.ts (8)
2873-2879: The
description
field in the test data has been updated to include specific event types within square brackets, which improves clarity and can be useful for filtering and analysis purposes.2873-2879: The addition of query parameters to URLs in the test data and XML payload ensures consistency and can be important for tracking and analytics.
2873-2879: The update to the
library
object to include "" in thename
field is a specific change that should be verified to ensure it aligns with the intended use and does not affect any existing functionality that relies on thelibrary.name
value.2873-2879: The addition of a new value for the
video
key in theproperties
object within the test data is a change that should be verified to ensure it is being handled correctly wherever this data is processed or utilized.2873-2879: The changes made in the test data should be reflected in the corresponding documentation, if any, to ensure that the documentation stays up to date with the codebase.
2873-2879: It's important to verify that the updated test data aligns with the actual data structure expected by the Adobe Analytics destination, including the correct use of eVars, props, and events.
2873-2879: Ensure that the updated test data, including the new event types and query parameters, does not introduce any breaking changes to existing integrations or data processing pipelines.
2873-2879: The changes to the test data should be tested thoroughly to confirm that they produce the expected results when processed by the Adobe Analytics destination and that they do not introduce any regressions.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #2854 +/- ##
========================================
Coverage 87.16% 87.17%
========================================
Files 772 772
Lines 28788 28796 +8
Branches 6764 6767 +3
========================================
+ Hits 25094 25103 +9
+ Misses 3351 3350 -1
Partials 343 343 ☔ View full report in Codecov by Sentry. |
Kudos, SonarCloud Quality Gate passed! |
* fix: encode &, < and > to html counterparts in adobe * fix: use encodeurl on url valuez
What are the changes introduced in this PR?
Resolves INT-1042
Please explain the objectives of your changes below
There was a discrepancy informed regarding handling of url values in the XML sent to Adobe. The url values need to be properly encoded and escaped as per the doc here.
Type of change
If the pull request is a bug-fix, enhancement or a refactor, please fill in the details on the changes made.
bug-fix
Existing capabilities/behavior
URLs were being passed unencoded.
New capabilities/behavior
&, < and > are now encoded to their respective html counterparts and url values are properly encoded.
If the pull request is a new feature,
Any technical or performance related pointers to consider with the change?
Some values, if being rejected or discarded by Adobe till now will be accepted going ahead.
Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
N/A
If the PR has changes in more than 10 files, please mention why the changes were not split into multiple PRs.
N/A
If multiple linear tasks are associated with the PR changes, please elaborate on the reason:
N/A
Developer checklist
No breaking changes are being introduced.
Are all related docs linked with the PR?
Are all changes manually tested?
Does this change require any documentation changes?
Are relevant unit and component test-cases added?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.
Summary by CodeRabbit
New Features
Bug Fixes
Tests