File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -329,12 +329,10 @@ func (r *summaryReporter) renderRemediationAdvice() {
329329 break
330330 }
331331
332- insight := utils .SafelyGetValue (sp .pkg .Insights )
333-
334332 tbl .AppendRow (table.Row {
335333 string (sp .pkg .Ecosystem ),
336334 r .packageNameForRemediationAdvice (sp .pkg ),
337- utils . SafelyGetValue ( insight . PackageCurrentVersion ),
335+ r . packageUpdateVersionForRemediationAdvice ( sp . pkg ),
338336 sp .score ,
339337 })
340338
@@ -368,6 +366,22 @@ func (r *summaryReporter) packageNameForRemediationAdvice(pkg *models.Package) s
368366 pkg .PackageDetails .Version )
369367}
370368
369+ func (r * summaryReporter ) packageUpdateVersionForRemediationAdvice (pkg * models.Package ) string {
370+ insight := utils .SafelyGetValue (pkg .Insights )
371+ insightsCurrentVersion := utils .SafelyGetValue (insight .PackageCurrentVersion )
372+
373+ if insightsCurrentVersion == "" {
374+ return "Not Available"
375+ }
376+
377+ sver , _ := semver .Diff (pkg .PackageDetails .Version , insightsCurrentVersion )
378+ if sver .IsNone () {
379+ return "-"
380+ }
381+
382+ return insightsCurrentVersion
383+ }
384+
371385func (r * summaryReporter ) vulnSummaryStatement () string {
372386 return fmt .Sprintf ("%d critical, %d high and %d other vulnerabilities were identified" ,
373387 r .summary .vulns .critical , r .summary .vulns .high ,
Original file line number Diff line number Diff line change @@ -154,9 +154,14 @@ func listParsersCommand() *cobra.Command {
154154
155155func startScan () {
156156 if ! disableAuthVerifyBeforeScan {
157- failOnError ( "auth/verify" , auth .Verify (& auth.VerifyConfig {
157+ err := auth .Verify (& auth.VerifyConfig {
158158 ControlPlaneApiUrl : auth .DefaultControlPlaneApiUrl (),
159- }))
159+ })
160+
161+ if err != nil {
162+ failOnError ("auth/verify" , fmt .Errorf ("failed to verify auth token: %v. " +
163+ "You may want to setup community mode using: vet auth configure --community" , err ))
164+ }
160165 }
161166
162167 if auth .CommunityMode () {
You can’t perform that action at this time.
0 commit comments