File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 55 spawnCoana ,
66} from '../../utils/coana.mts'
77import { setupSdk } from '../../utils/sdk.mts'
8+ import { fetchOrganization } from '../organization/fetch-organization-list.mts'
89
910import type { CResult } from '../../types.mts'
1011import type { PURL_Type } from '../../utils/ecosystem.mts'
@@ -47,6 +48,30 @@ export async function performReachabilityAnalysis(
4748 spinner,
4849 uploadManifests = true ,
4950 } = { __proto__ : null , ...options } as ReachabilityAnalysisOptions
51+
52+ // Check if user has enterprise plan for reachability analysis
53+ const orgsCResult = await fetchOrganization ( )
54+ if ( ! orgsCResult . ok ) {
55+ return {
56+ ok : false ,
57+ message : 'Unable to verify plan permissions' ,
58+ cause :
59+ 'Failed to fetch organization information to verify enterprise plan access' ,
60+ }
61+ }
62+
63+ const organizations = Object . values ( orgsCResult . data . organizations )
64+ const hasEnterprisePlan = organizations . some ( org => org . plan === 'enterprise' )
65+
66+ if ( ! hasEnterprisePlan ) {
67+ return {
68+ ok : false ,
69+ message : 'Tier 1 Reachability analysis requires an enterprise plan' ,
70+ cause :
71+ 'This feature is only available for organizations with an enterprise plan. Please visit https://socket.dev/pricing to upgrade your plan.' ,
72+ }
73+ }
74+
5075 let tarHash : string | undefined
5176
5277 if ( uploadManifests && orgSlug && packagePaths ) {
You can’t perform that action at this time.
0 commit comments