Files
klz-cables.com/.pnpm-store/v10/files/48/390c7ea98bf6bb252f4a27a3deab70bdb1bce7eca30a6f276bea6e23d94bc463a0ff22ff46c477028bc601178de4af54b7e3eb1be2e0e9fb20a6e82bc16cae
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

54 lines
1.4 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const attributes = require('./attributes.js');
/**
* Network PII attributes that should be removed when sendDefaultPii is false
* @internal
*/
const NETWORK_PII_ATTRIBUTES = new Set([attributes.CLIENT_ADDRESS_ATTRIBUTE, attributes.CLIENT_PORT_ATTRIBUTE, attributes.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;
},
{} ,
);
}
exports.filterMcpPiiFromSpanData = filterMcpPiiFromSpanData;
//# sourceMappingURL=piiFiltering.js.map