Skip to content

Commit 4bad7b9

Browse files
authored
Remove the Snyk vulnerabilities widget (#211)
The Snyk widget service (snyk-widget.herokuapp.com) has been returning errors for all libraries for around a year (see #170), with no plan to restore the data source. Remove it entirely: the get_vulns util, the shield in library_hero, and the snyk config, so its dead requests can no longer hang or clutter library pages.
1 parent 3fbc6cd commit 4bad7b9

4 files changed

Lines changed: 1 addition & 39 deletions

File tree

components/library/library_hero.vue

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
package
2525
</a>
2626
</p>
27-
<p v-if="vulns">
28-
<a :href="vulns.url">
29-
<ShieldAlt class="icon" aria-label="Snyk"></ShieldAlt>
30-
{{ vulns.vulns }} known vulnerabilities
31-
</a>
32-
</p>
3327
</div>
3428

3529
<div class="row">
@@ -62,38 +56,18 @@
6256
import Star from '@fortawesome/fontawesome-free/svgs/solid/star.svg?inline';
6357
import GitHub from '@fortawesome/fontawesome-free/svgs/brands/github.svg?inline';
6458
import Npm from '@fortawesome/fontawesome-free/svgs/brands/npm.svg?inline';
65-
import ShieldAlt from '@fortawesome/fontawesome-free/svgs/solid/shield-alt.svg?inline';
6659
import formatUnits from '../../util/format_units';
6760
import utm from '../../util/utm';
68-
import getVulns from '../../util/get_vulns';
6961
7062
export default {
7163
name: 'LibraryHero',
7264
components: {
7365
Star,
7466
GitHub,
7567
Npm,
76-
ShieldAlt,
7768
},
7869
props: {
7970
library: Object,
80-
version: String,
81-
},
82-
data () {
83-
return {
84-
vulns: null,
85-
};
86-
},
87-
watch: {
88-
version: {
89-
immediate: true,
90-
async handler () {
91-
this.$data.vulns = await getVulns(this.$props.library, this.$props.version).catch(() => {});
92-
},
93-
},
94-
},
95-
async created () {
96-
this.$data.vulns = await getVulns(this.$props.library, this.$props.version).catch(() => {});
9771
},
9872
methods: {
9973
formatUnits,

data/config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
export const baseApi = process.env.API_BASE || 'https://api.cdnjs.com';
2-
export const snykApi = 'https://snyk-widget.herokuapp.com';
3-
export const snykKey = 'VRHr?YP_Gb7d9LFh$ugktZHUe+gGBp#LGG3*bDLt';

pages/libraries/_library/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div v-if="!ready" class="content library-hero">
66
<h1>{{ message }}</h1>
77
</div>
8-
<LibraryHero v-else :library="library" :version="version"></LibraryHero>
8+
<LibraryHero v-else :library="library"></LibraryHero>
99
</header>
1010
<div v-if="!ready" class="content">
1111
</div>

util/get_vulns.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)