Files
klz-cables.com/.pnpm-store/v10/files/b1/663b24e966cfc49b8ab638ee818bb56235cfdc4d97770f802c23179ce83b006a19652a82f3c31481dd269661840252fc8998e50205acdbef21779f4c6ef1f4
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

52 lines
1.4 KiB
Plaintext

import { CLIENT_ADDRESS_ATTRIBUTE, CLIENT_PORT_ATTRIBUTE, MCP_RESOURCE_URI_ATTRIBUTE } from './attributes.js';
/**
* Network PII attributes that should be removed when sendDefaultPii is false
* @internal
*/
const NETWORK_PII_ATTRIBUTES = new Set([CLIENT_ADDRESS_ATTRIBUTE, CLIENT_PORT_ATTRIBUTE, MCP_RESOURCE_URI_ATTRIBUTE]);
/**
* Checks if an attribute key should be considered network PII.
*
* Returns true for:
* - client.address (IP address)
* - client.port (port number)
* - mcp.resource.uri (potentially sensitive URIs)
*
* @param key - Attribute key to evaluate
* @returns true if the attribute should be filtered out (is network PII), false if it should be preserved
* @internal
*/
function isNetworkPiiAttribute(key) {
return NETWORK_PII_ATTRIBUTES.has(key);
}
/**
* Removes network PII attributes from span data when sendDefaultPii is false
* @param spanData - Raw span attributes
* @param sendDefaultPii - Whether to include PII data
* @returns Filtered span attributes
*/
function filterMcpPiiFromSpanData(
spanData,
sendDefaultPii,
) {
if (sendDefaultPii) {
return spanData ;
}
return Object.entries(spanData).reduce(
(acc, [key, value]) => {
if (!isNetworkPiiAttribute(key)) {
acc[key] = value ;
}
return acc;
},
{} ,
);
}
export { filterMcpPiiFromSpanData };
//# sourceMappingURL=piiFiltering.js.map