mobbdev 1.2.27 → 1.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7347,8 +7347,8 @@ var openRedaction = new OpenRedaction({
7347
7347
  "MONERO_ADDRESS",
7348
7348
  "RIPPLE_ADDRESS",
7349
7349
  // Medical Data (removed PRESCRIPTION_NUMBER - too broad, matches words containing "ription")
7350
+ // Removed MEDICAL_RECORD_NUMBER - too broad, "MR" prefix matches "Merge Request" in SCM contexts (e.g. "MR branches" → "MR br****es")
7350
7351
  "NHS_NUMBER",
7351
- "MEDICAL_RECORD_NUMBER",
7352
7352
  "AUSTRALIAN_MEDICARE",
7353
7353
  "HEALTH_PLAN_NUMBER",
7354
7354
  "PATIENT_ID",
@@ -7392,10 +7392,10 @@ var openRedaction = new OpenRedaction({
7392
7392
  "DOCKER_AUTH",
7393
7393
  "KUBERNETES_SECRET",
7394
7394
  // Government & Legal
7395
+ // Removed CLIENT_ID - too broad, "client" is ubiquitous in code (npm packages like @scope/client-*, class names like ClientSdkOptions)
7395
7396
  "POLICE_REPORT_NUMBER",
7396
7397
  "IMMIGRATION_NUMBER",
7397
- "COURT_REPORTER_LICENSE",
7398
- "CLIENT_ID"
7398
+ "COURT_REPORTER_LICENSE"
7399
7399
  ]
7400
7400
  });
7401
7401
  function maskString(str, showStart = 2, showEnd = 2) {
@@ -7418,6 +7418,15 @@ async function sanitizeDataWithCounts(obj) {
7418
7418
  ...piiDetections.low
7419
7419
  ];
7420
7420
  for (const detection of allDetections) {
7421
+ if (detection.type === "CREDIT_CARD") {
7422
+ const start = detection.position[0];
7423
+ const end = detection.position[1];
7424
+ const charBefore = (start > 0 ? str[start - 1] : "") ?? "";
7425
+ const charAfter = str[end] ?? "";
7426
+ if (charBefore === "." || charBefore >= "0" && charBefore <= "9" || charAfter >= "0" && charAfter <= "9") {
7427
+ continue;
7428
+ }
7429
+ }
7421
7430
  counts.detections.total++;
7422
7431
  if (detection.severity === "high") counts.detections.high++;
7423
7432
  else if (detection.severity === "medium") counts.detections.medium++;
package/dist/index.mjs CHANGED
@@ -6244,6 +6244,23 @@ function parseLinearTicket(url, name) {
6244
6244
  const title = titleSlug.replace(/-/g, " ");
6245
6245
  return { name, title, url };
6246
6246
  }
6247
+ function isLinearBotComment(comment) {
6248
+ if (!comment.author) return false;
6249
+ const login = comment.author.login.toLowerCase();
6250
+ if (login === "linear[bot]" || login === "linear") return true;
6251
+ if (comment.author.type === "Bot" && login.includes("linear")) return true;
6252
+ return false;
6253
+ }
6254
+ function extractLinearTicketsFromComments(comments) {
6255
+ const tickets = [];
6256
+ const seen = /* @__PURE__ */ new Set();
6257
+ for (const comment of comments) {
6258
+ if (isLinearBotComment(comment)) {
6259
+ tickets.push(...extractLinearTicketsFromBody(comment.body || "", seen));
6260
+ }
6261
+ }
6262
+ return tickets;
6263
+ }
6247
6264
  var userNamePattern = /^(https?:\/\/)([^@]+@)?([^/]+\/.+)$/;
6248
6265
  var sshPattern = /^git@([\w.-]+):([\w./-]+)$/;
6249
6266
  function normalizeUrl(repoUrl) {
@@ -7127,11 +7144,11 @@ var SCMLib = class {
7127
7144
  }
7128
7145
  /**
7129
7146
  * Extract Linear ticket links from PR/MR comments.
7130
- * Default implementation returns empty array - subclasses can override.
7147
+ * Uses shared isLinearBotComment() for unified bot detection across all providers.
7131
7148
  * Public so it can be reused by backend services.
7132
7149
  */
7133
- extractLinearTicketsFromComments(_comments) {
7134
- return [];
7150
+ extractLinearTicketsFromComments(comments) {
7151
+ return extractLinearTicketsFromComments(comments);
7135
7152
  }
7136
7153
  _validateAccessTokenAndUrl() {
7137
7154
  this._validateAccessToken();
@@ -8832,7 +8849,7 @@ function determinePrStatus(state, isDraft) {
8832
8849
  return isDraft ? "DRAFT" /* Draft */ : "ACTIVE" /* Active */;
8833
8850
  }
8834
8851
  }
8835
- var GithubSCMLib = class _GithubSCMLib extends SCMLib {
8852
+ var GithubSCMLib = class extends SCMLib {
8836
8853
  // we don't always need a url, what's important is that we have an access token
8837
8854
  constructor(url, accessToken, scmOrg) {
8838
8855
  super(url, accessToken, scmOrg);
@@ -9304,27 +9321,6 @@ var GithubSCMLib = class _GithubSCMLib extends SCMLib {
9304
9321
  commentIds
9305
9322
  };
9306
9323
  }
9307
- /**
9308
- * Extract Linear ticket links from pre-fetched comments (pure function, no API calls)
9309
- * Instance method that overrides base class - can also be called statically for backwards compatibility.
9310
- */
9311
- extractLinearTicketsFromComments(comments) {
9312
- return _GithubSCMLib._extractLinearTicketsFromCommentsImpl(comments);
9313
- }
9314
- /**
9315
- * Static implementation for backwards compatibility and reuse.
9316
- * Called by both the instance method and direct static calls.
9317
- */
9318
- static _extractLinearTicketsFromCommentsImpl(comments) {
9319
- const tickets = [];
9320
- const seen = /* @__PURE__ */ new Set();
9321
- for (const comment of comments) {
9322
- if (comment.author?.login === "linear[bot]" || comment.author?.type === "Bot") {
9323
- tickets.push(...extractLinearTicketsFromBody(comment.body || "", seen));
9324
- }
9325
- }
9326
- return tickets;
9327
- }
9328
9324
  };
9329
9325
 
9330
9326
  // src/features/analysis/scm/gitlab/gitlab.ts
@@ -9814,7 +9810,7 @@ async function getGitlabMrDataBatch({
9814
9810
  const comments = notes.map((note) => ({
9815
9811
  author: note.author ? {
9816
9812
  login: note.author.username,
9817
- type: note.author.username.endsWith("[bot]") || note.author.username.toLowerCase() === "linear" ? "Bot" : "User"
9813
+ type: note.author.username.endsWith("[bot]") ? "Bot" : "User"
9818
9814
  } : null,
9819
9815
  body: note.body
9820
9816
  }));
@@ -10443,23 +10439,6 @@ var GitlabSCMLib = class extends SCMLib {
10443
10439
  accessToken: this.accessToken
10444
10440
  });
10445
10441
  }
10446
- /**
10447
- * Extract Linear ticket links from pre-fetched comments (pure function, no API calls).
10448
- * Linear bot uses the same comment format on GitLab as on GitHub.
10449
- * Bot username may be 'linear' or 'linear[bot]' on GitLab.
10450
- */
10451
- extractLinearTicketsFromComments(comments) {
10452
- const tickets = [];
10453
- const seen = /* @__PURE__ */ new Set();
10454
- for (const comment of comments) {
10455
- const authorLogin = comment.author?.login?.toLowerCase() || "";
10456
- const isLinearBot = authorLogin === "linear" || authorLogin === "linear[bot]" || comment.author?.type === "Bot" && authorLogin.includes("linear");
10457
- if (isLinearBot) {
10458
- tickets.push(...extractLinearTicketsFromBody(comment.body || "", seen));
10459
- }
10460
- }
10461
- return tickets;
10462
- }
10463
10442
  };
10464
10443
 
10465
10444
  // src/features/analysis/scm/scmFactory.ts
@@ -15050,8 +15029,8 @@ var openRedaction = new OpenRedaction({
15050
15029
  "MONERO_ADDRESS",
15051
15030
  "RIPPLE_ADDRESS",
15052
15031
  // Medical Data (removed PRESCRIPTION_NUMBER - too broad, matches words containing "ription")
15032
+ // Removed MEDICAL_RECORD_NUMBER - too broad, "MR" prefix matches "Merge Request" in SCM contexts (e.g. "MR branches" → "MR br****es")
15053
15033
  "NHS_NUMBER",
15054
- "MEDICAL_RECORD_NUMBER",
15055
15034
  "AUSTRALIAN_MEDICARE",
15056
15035
  "HEALTH_PLAN_NUMBER",
15057
15036
  "PATIENT_ID",
@@ -15095,10 +15074,10 @@ var openRedaction = new OpenRedaction({
15095
15074
  "DOCKER_AUTH",
15096
15075
  "KUBERNETES_SECRET",
15097
15076
  // Government & Legal
15077
+ // Removed CLIENT_ID - too broad, "client" is ubiquitous in code (npm packages like @scope/client-*, class names like ClientSdkOptions)
15098
15078
  "POLICE_REPORT_NUMBER",
15099
15079
  "IMMIGRATION_NUMBER",
15100
- "COURT_REPORTER_LICENSE",
15101
- "CLIENT_ID"
15080
+ "COURT_REPORTER_LICENSE"
15102
15081
  ]
15103
15082
  });
15104
15083
  function maskString(str, showStart = 2, showEnd = 2) {
@@ -15121,6 +15100,15 @@ async function sanitizeDataWithCounts(obj) {
15121
15100
  ...piiDetections.low
15122
15101
  ];
15123
15102
  for (const detection of allDetections) {
15103
+ if (detection.type === "CREDIT_CARD") {
15104
+ const start = detection.position[0];
15105
+ const end = detection.position[1];
15106
+ const charBefore = (start > 0 ? str[start - 1] : "") ?? "";
15107
+ const charAfter = str[end] ?? "";
15108
+ if (charBefore === "." || charBefore >= "0" && charBefore <= "9" || charAfter >= "0" && charAfter <= "9") {
15109
+ continue;
15110
+ }
15111
+ }
15124
15112
  counts.detections.total++;
15125
15113
  if (detection.severity === "high") counts.detections.high++;
15126
15114
  else if (detection.severity === "medium") counts.detections.medium++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobbdev",
3
- "version": "1.2.27",
3
+ "version": "1.2.28",
4
4
  "description": "Automated secure code remediation tool",
5
5
  "repository": "git+https://github.com/mobb-dev/bugsy.git",
6
6
  "main": "dist/index.mjs",