mobbdev 0.0.180 → 0.0.182

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.
Files changed (2) hide show
  1. package/dist/index.mjs +31 -10
  2. package/package.json +8 -8
package/dist/index.mjs CHANGED
@@ -1980,6 +1980,15 @@ var pt = {
1980
1980
  }
1981
1981
  };
1982
1982
 
1983
+ // src/features/analysis/scm/shared/src/storedQuestionData/csharp/sqlInjection.ts
1984
+ var sqlInjection2 = {
1985
+ databaseProvider: {
1986
+ content: () => "Select the database provider",
1987
+ description: () => "",
1988
+ guidance: () => ""
1989
+ }
1990
+ };
1991
+
1983
1992
  // src/features/analysis/scm/shared/src/storedQuestionData/csharp/ssrf.ts
1984
1993
  var ssrf2 = {
1985
1994
  domainsAllowlist: {
@@ -2124,7 +2133,8 @@ var vulnerabilities7 = {
2124
2133
  ["INSECURE_BINDER_CONFIGURATION" /* InsecureBinderConfiguration */]: insecureBinderConfiguration,
2125
2134
  ["VALUE_SHADOWING" /* ValueShadowing */]: valueShadowing,
2126
2135
  ["INSECURE_RANDOMNESS" /* InsecureRandomness */]: insecureRandomness,
2127
- ["INSUFFICIENT_LOGGING" /* InsufficientLogging */]: insufficientLogging
2136
+ ["INSUFFICIENT_LOGGING" /* InsufficientLogging */]: insufficientLogging,
2137
+ ["SQL_Injection" /* SqlInjection */]: sqlInjection2
2128
2138
  };
2129
2139
  var csharp_default2 = vulnerabilities7;
2130
2140
 
@@ -2380,7 +2390,7 @@ var typeToSetMethod = {
2380
2390
  date: "setDate",
2381
2391
  string: "setString"
2382
2392
  };
2383
- var sqlInjection2 = {
2393
+ var sqlInjection3 = {
2384
2394
  parameterType: {
2385
2395
  content: ({ tainted_term }) => `What is the SQL Data Type of the \`${tainted_term}\` parameter?`,
2386
2396
  description: () => "In order to make sure the statement is built correctly, we must ensure we use the same type that is defined for this parameter in the SQL table. If you are unsure of this type, please consult with your team.",
@@ -2563,7 +2573,7 @@ var xxe2 = {
2563
2573
 
2564
2574
  // src/features/analysis/scm/shared/src/storedQuestionData/java/index.ts
2565
2575
  var vulnerabilities8 = {
2566
- ["SQL_Injection" /* SqlInjection */]: sqlInjection2,
2576
+ ["SQL_Injection" /* SqlInjection */]: sqlInjection3,
2567
2577
  ["CMDi_relative_path_command" /* CmDiRelativePathCommand */]: relativePathCommand,
2568
2578
  ["CMDi" /* CmDi */]: commandInjection,
2569
2579
  ["CONFUSING_NAMING" /* ConfusingNaming */]: confusingNaming,
@@ -4954,9 +4964,6 @@ var AdoSCMLib = class extends SCMLib {
4954
4964
  repoUrl: this.url
4955
4965
  });
4956
4966
  }
4957
- async getUsername() {
4958
- throw new Error("getUsername() is not relevant for ADO");
4959
- }
4960
4967
  async getSubmitRequestStatus(scmSubmitRequestId) {
4961
4968
  this._validateAccessTokenAndUrl();
4962
4969
  const adoSdk = await this.getAdoSdk();
@@ -5603,6 +5610,9 @@ var AdoAuthResultZ = z16.object({
5603
5610
  token_type: z16.string().min(1),
5604
5611
  refresh_token: z16.string().min(1)
5605
5612
  });
5613
+ var AdoAuthResultWithOrgsZ = AdoAuthResultZ.extend({
5614
+ scmOrgs: z16.array(z16.string())
5615
+ });
5606
5616
  var profileZ = z16.object({
5607
5617
  displayName: z16.string(),
5608
5618
  publicAlias: z16.string().min(1),
@@ -5667,6 +5677,17 @@ function parseAdoOwnerAndRepo(adoUrl) {
5667
5677
  origin: `${protocol}//${hostname}`
5668
5678
  };
5669
5679
  }
5680
+ function isValidAdoRepo(url) {
5681
+ if (!url) {
5682
+ return false;
5683
+ }
5684
+ try {
5685
+ const parsed = parseAdoOwnerAndRepo(url);
5686
+ return Boolean(parsed.repo && parsed.projectName);
5687
+ } catch (e) {
5688
+ return false;
5689
+ }
5690
+ }
5670
5691
  async function getAdoConnectData({
5671
5692
  url,
5672
5693
  tokenOrg,
@@ -5688,7 +5709,7 @@ async function getAdoConnectData({
5688
5709
  }
5689
5710
  if (!tokenOrg) {
5690
5711
  if (adoTokenInfo.type === "OAUTH" /* OAUTH */) {
5691
- const [org] = await _getOrgsForOauthToken({
5712
+ const [org] = await getOrgsForOauthToken({
5692
5713
  oauthToken: adoTokenInfo.accessToken
5693
5714
  });
5694
5715
  return {
@@ -5795,7 +5816,7 @@ async function adoValidateParams({
5795
5816
  await getAdoClientParams({ url, accessToken, tokenOrg })
5796
5817
  );
5797
5818
  await api2.connect();
5798
- if (url) {
5819
+ if (isValidAdoRepo(url)) {
5799
5820
  const git = await api2.getGitApi();
5800
5821
  await validateAdoRepo({ git, repoUrl: url });
5801
5822
  }
@@ -5813,7 +5834,7 @@ async function adoValidateParams({
5813
5834
  throw e;
5814
5835
  }
5815
5836
  }
5816
- async function _getOrgsForOauthToken({
5837
+ async function getOrgsForOauthToken({
5817
5838
  oauthToken
5818
5839
  }) {
5819
5840
  const profileRes = await fetch(
@@ -6087,7 +6108,7 @@ async function getAdoRepoList({
6087
6108
  return [];
6088
6109
  }
6089
6110
  if (adoTokenInfo.type === "OAUTH" /* OAUTH */) {
6090
- orgs = await _getOrgsForOauthToken({ oauthToken: accessToken });
6111
+ orgs = await getOrgsForOauthToken({ oauthToken: accessToken });
6091
6112
  }
6092
6113
  if (orgs.length === 0 && !orgName) {
6093
6114
  throw new Error(`no orgs for ADO`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobbdev",
3
- "version": "0.0.180",
3
+ "version": "0.0.182",
4
4
  "description": "Automated secure code remediation tool",
5
5
  "repository": "git+https://github.com/mobb-dev/bugsy.git",
6
6
  "main": "dist/index.js",
@@ -61,11 +61,11 @@
61
61
  "parse-diff": "0.11.1",
62
62
  "semver": "7.6.3",
63
63
  "simple-git": "3.27.0",
64
- "snyk": "1.1293.1",
64
+ "snyk": "1.1294.0",
65
65
  "supports-color": "9.4.0",
66
66
  "tar": "6.2.1",
67
67
  "tmp": "0.2.3",
68
- "undici": "6.20.0",
68
+ "undici": "6.20.1",
69
69
  "uuid": "10.0.0",
70
70
  "ws": "8.18.0",
71
71
  "yargs": "17.7.2",
@@ -73,9 +73,9 @@
73
73
  },
74
74
  "devDependencies": {
75
75
  "@graphql-codegen/cli": "5.0.3",
76
- "@graphql-codegen/typescript": "4.1.0",
76
+ "@graphql-codegen/typescript": "4.1.1",
77
77
  "@graphql-codegen/typescript-graphql-request": "6.2.0",
78
- "@graphql-codegen/typescript-operations": "4.3.0",
78
+ "@graphql-codegen/typescript-operations": "4.3.1",
79
79
  "@octokit/request-error": "3.0.3",
80
80
  "@octokit/types": "13.6.1",
81
81
  "@types/adm-zip": "0.5.5",
@@ -87,11 +87,11 @@
87
87
  "@types/tar": "6.1.13",
88
88
  "@types/tmp": "0.2.6",
89
89
  "@types/uuid": "10.0.0",
90
- "@types/ws": "8.5.12",
90
+ "@types/ws": "8.5.13",
91
91
  "@types/yargs": "17.0.33",
92
92
  "@typescript-eslint/eslint-plugin": "7.17.0",
93
93
  "@typescript-eslint/parser": "7.17.0",
94
- "@vitest/coverage-istanbul": "2.1.2",
94
+ "@vitest/coverage-istanbul": "2.1.4",
95
95
  "@vitest/ui": "^2.1.2",
96
96
  "eslint": "8.57.0",
97
97
  "eslint-plugin-import": "2.31.0",
@@ -100,7 +100,7 @@
100
100
  "prettier": "3.3.3",
101
101
  "tsup": "7.2.0",
102
102
  "typescript": "4.9.5",
103
- "vitest": "2.1.2"
103
+ "vitest": "2.1.4"
104
104
  },
105
105
  "engines": {
106
106
  "node": ">=18.18.0"