Skip to content

Commit

Permalink
internal/osv,static/frontend/vuln: add a chip for standard library vulns
Browse files Browse the repository at this point in the history
Change-Id: I0cb26136ddd58afbb53312dbd93f3ca1a5b8388f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/581176
Run-TryBot: Tatiana Bradley <[email protected]>
kokoro-CI: kokoro <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Damien Neil <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
tatianab committed Apr 24, 2024
1 parent 82c4442 commit 60fcee7
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/osv/affected.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@ func (e Entry) AffectedModulesAndPackages() []string {
}
return affected
}

func (e *Entry) AffectsStandardLibrary() bool {
for _, a := range e.Affected {
m := a.Module.Path
if m == GoStdModulePath || m == GoCmdModulePath {
return true
}
}
return false
}
3 changes: 3 additions & 0 deletions static/frontend/vuln/vuln.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,7 @@
{{if .Withdrawn}}
<span class="go-Chip go-Chip--subtle">withdrawn</span>
{{end}}
{{if .AffectsStandardLibrary}}
<span class="go-Chip go-Chip-inverted">standard library</span>
{{end}}
{{end}}
Binary file modified tests/screentest/testdata/ci/vuln-540x1080.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln-entry-540x1080.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln-entry.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln-list-540x1080.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln-list.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/screentest/testdata/ci/vuln.a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 60fcee7

Please sign in to comment.