Rocky_Mountain_Vending/.pnpm-store/v10/files/bf/ef91e4e1a3a60d0ae6510bfc5599d8c9ec528f7b4d0f72eff8bc3f313d53788c957c653c8248f4c6b8980138df54b4d212a312bce86218f484ba27d6e2c4d9
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

38 lines
No EOL
1.7 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getClientAttributes = void 0;
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
function getClientAttributes(diag, options) {
var _a, _b;
return {
[semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_REDIS,
[semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: (_a = options === null || options === void 0 ? void 0 : options.socket) === null || _a === void 0 ? void 0 : _a.host,
[semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: (_b = options === null || options === void 0 ? void 0 : options.socket) === null || _b === void 0 ? void 0 : _b.port,
[semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: removeCredentialsFromDBConnectionStringAttribute(diag, options === null || options === void 0 ? void 0 : options.url),
};
}
exports.getClientAttributes = getClientAttributes;
/**
* removeCredentialsFromDBConnectionStringAttribute removes basic auth from url and user_pwd from query string
*
* Examples:
* redis://user:pass@localhost:6379/mydb => redis://localhost:6379/mydb
* redis://localhost:6379?db=mydb&user_pwd=pass => redis://localhost:6379?db=mydb
*/
function removeCredentialsFromDBConnectionStringAttribute(diag, url) {
if (typeof url !== 'string' || !url) {
return;
}
try {
const u = new URL(url);
u.searchParams.delete('user_pwd');
u.username = '';
u.password = '';
return u.href;
}
catch (err) {
diag.error('failed to sanitize redis connection url', err);
}
return;
}
//# sourceMappingURL=utils.js.map