File tree Expand file tree Collapse file tree 2 files changed +2
-51
lines changed
Expand file tree Collapse file tree 2 files changed +2
-51
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,11 @@ import {
44 extractTier1ReachabilityScanId ,
55 spawnCoana ,
66} from '../../utils/coana.mts'
7- import { convertToCoanaEcosystems } from '../../utils/ecosystem.mts'
87import { setupSdk } from '../../utils/sdk.mts'
98
109import type { CResult } from '../../types.mts'
11- import type { PURL_Type } from '../../utils/ecosystem.mts'
1210import type { Spinner } from '@socketsecurity/registry/lib/spinner'
11+ import type { PURL_Type } from '../../utils/ecosystem.mts'
1312
1413export type ReachabilityOptions = {
1514 reachDisableAnalytics : boolean
@@ -141,10 +140,7 @@ export async function performReachabilityAnalysis(
141140 : [ ] ) ,
142141 // empty reachEcosystems implies scan all ecosystems
143142 ...( reachabilityOptions . reachEcosystems . length
144- ? [
145- '--ecosystems' ,
146- ...convertToCoanaEcosystems ( reachabilityOptions . reachEcosystems ) ,
147- ]
143+ ? [ '--purl-types' , ...reachabilityOptions . reachEcosystems ]
148144 : [ ] ) ,
149145 ...( reachabilityOptions . reachExcludePaths . length
150146 ? [ '--exclude-dirs' , reachabilityOptions . reachExcludePaths . join ( ' ' ) ]
Original file line number Diff line number Diff line change @@ -55,53 +55,8 @@ export type _Check_ALL_ECOSYSTEMS_has_all_purl_types =
5555export type _Check_ALL_ECOSYSTEMS_has_no_extras =
5656 ExpectNever < ExtraInAllEcosystems >
5757
58- const COANA_SUPPORTED_LIST = [
59- 'composer' ,
60- 'hex' ,
61- 'github' ,
62- 'golang' ,
63- 'maven' ,
64- 'npm' ,
65- 'nuget' ,
66- 'pypi' ,
67- 'pub' ,
68- 'gem' ,
69- 'cargo' ,
70- 'swift' ,
71- ] as const satisfies readonly PURL_Type [ ]
72-
7358export const ALL_SUPPORTED_ECOSYSTEMS = new Set < string > ( ALL_ECOSYSTEMS )
7459
75- export const COANA_SUPPORTED_ECOSYSTEMS = new Set < string > ( COANA_SUPPORTED_LIST )
76-
77- /**
78- * Ecosystems/Purl types are slightly different in Coana. This function converts
79- * the PURL_Type[] to a string of Coana compatible ecosystem names. Ecosystems that
80- * are not supported by Coana are ignored.
81- */
82- export function convertToCoanaEcosystems ( ecosystems : PURL_Type [ ] ) : string [ ] {
83- return ecosystems
84- . filter ( ecosystem => COANA_SUPPORTED_ECOSYSTEMS . has ( ecosystem as PURL_Type ) )
85- . map ( ecosystem => {
86- switch ( ecosystem ) {
87- case 'cargo' :
88- return 'RUST'
89- case 'gem' :
90- return 'RUBYGEMS'
91- case 'github' :
92- return 'ACTIONS'
93- case 'golang' :
94- return 'GO'
95- case 'hex' :
96- return 'ERLANG'
97- case 'pypi' :
98- return 'PIP'
99- default :
100- return ecosystem . toUpperCase ( )
101- }
102- } )
103- }
104-
10560export function getEcosystemChoicesForMeow ( ) : string [ ] {
10661 return [ ...ALL_ECOSYSTEMS ]
10762}
You can’t perform that action at this time.
0 commit comments