File tree Expand file tree Collapse file tree 5 files changed +11
-1
lines changed
shadow/npm/arborist/lib/arborist Expand file tree Collapse file tree 5 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -119,9 +119,11 @@ export class SafeArborist extends Arborist {
119119 options [ 'yes' ] ||
120120 acceptAllRisks
121121 ? {
122+ actions : [ 'error' ] ,
122123 blocked : true ,
123124 critical : false ,
124125 cve : false ,
126+ existing : true ,
125127 unfixable : false
126128 }
127129 : {
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import constants from '../../constants'
33import type { Remap } from '@socketsecurity/registry/lib/objects'
44import type { components , operations } from '@socketsecurity/sdk/types/api'
55
6+ export type ALERT_ACTION = 'error' | 'monitor' | 'warn' | 'ignore'
7+
68export type ALERT_TYPE = keyof NonNullable <
79 operations [ 'getOrgSecurityPolicy' ] [ 'responses' ] [ '200' ] [ 'content' ] [ 'application/json' ] [ 'securityPolicyRules' ]
810>
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ export async function getAlertsMapFromArborist(
207207
208208 const include = {
209209 __proto__ : null ,
210+ actions : undefined ,
210211 blocked : true ,
211212 critical : true ,
212213 cve : true ,
@@ -262,7 +263,8 @@ export async function getAlertsMapFromArborist(
262263 {
263264 alerts : 'true' ,
264265 compact : 'true' ,
265- fixable : include . unfixable ? 'false' : 'true'
266+ ...( include . actions ? { actions : include . actions . join ( ',' ) } : { } ) ,
267+ ...( include . unfixable ? { } : { fixable : 'true' } )
266268 } ,
267269 {
268270 components : pkgIds . map ( id => ( { purl : `pkg:npm/${ id } ` } ) )
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export async function getAlertsMapFromPnpmLockfile(
2828
2929 const include = {
3030 __proto__ : null ,
31+ actions : undefined ,
3132 blocked : true ,
3233 critical : true ,
3334 cve : true ,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import constants from '../constants'
1717import { findSocketYmlSync } from './config'
1818
1919import type {
20+ ALERT_ACTION ,
2021 ALERT_TYPE ,
2122 CompactSocketArtifact ,
2223 CompactSocketArtifactAlert
@@ -159,6 +160,7 @@ function getSeverityLabel(severity: `${ALERT_SEVERITY}`): string {
159160}
160161
161162export type AlertIncludeFilter = {
163+ actions ?: ALERT_ACTION [ ] | undefined
162164 blocked ?: boolean | undefined
163165 critical ?: boolean | undefined
164166 cve ?: boolean | undefined
@@ -194,6 +196,7 @@ export async function addArtifactToAlertsMap<T extends AlertsByPkgId>(
194196
195197 const include = {
196198 __proto__ : null ,
199+ actions : undefined ,
197200 blocked : true ,
198201 critical : true ,
199202 cve : true ,
You can’t perform that action at this time.
0 commit comments