Skip to content

Commit 7425fb5

Browse files
authored
replace cargo audit with cargo deny (#404)
1 parent 572a1f5 commit 7425fb5

File tree

2 files changed

+119
-12
lines changed

2 files changed

+119
-12
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,10 @@ jobs:
200200
toolchain: stable
201201
- run: cd refinery && cargo rustdoc --all-features -- -D rustdoc::broken_intra_doc_links
202202

203-
audit:
204-
name: cargo-audit
203+
cargo-deny:
205204
runs-on: ubuntu-latest
206205
steps:
207-
- name: Checkout
208-
uses: actions/checkout@v1
209-
210-
- name: Install Rust
211-
# actions-rs/audit seems to be unmaintained and it's output doesn't give interverted tree dependencies
212-
uses: actions-rs/toolchain@v1
213-
with:
214-
toolchain: stable
215-
- run: cargo install cargo-audit
216-
- run: cargo audit
206+
- uses: actions/checkout@v5
207+
- uses: EmbarkStudios/cargo-deny-action@v2
208+
with:
209+
command: check advisories bans licenses sources

deny.toml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# This section is considered when running `cargo deny check advisories`
2+
# More documentation for the advisories section can be found here:
3+
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
4+
[advisories]
5+
# Version of the advisory config. See https://github.com/EmbarkStudios/cargo-deny/pull/611
6+
version = 2
7+
# The path where the advisory database is cloned/fetched into
8+
db-path = "~/cargo/advisory-db"
9+
# The url of the advisory database to use
10+
db-urls = ["https://github.com/rustsec/advisory-db"]
11+
# The lint level for crates that have been yanked from their source registry
12+
yanked = "warn"
13+
# A list of advisory IDs to ignore. Note that ignored advisories will still
14+
# output a note when they are encountered.
15+
ignore = []
16+
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
17+
# lower than the range specified will be ignored. Note that ignored advisories
18+
# will still output a note when they are encountered.
19+
# * None - CVSS Score 0.0
20+
# * Low - CVSS Score 0.1 - 3.9
21+
# * Medium - CVSS Score 4.0 - 6.9
22+
# * High - CVSS Score 7.0 - 8.9
23+
# * Critical - CVSS Score 9.0 - 10.0
24+
#severity-threshold =
25+
26+
# This section is considered when running `cargo deny check licenses`
27+
# More documentation for the licenses section can be found here:
28+
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
29+
[licenses]
30+
# Version of the license config. See https://github.com/EmbarkStudios/cargo-deny/pull/611
31+
version = 2
32+
# List of explicitly allowed licenses
33+
# See https://spdx.org/licenses/ for list of possible licenses
34+
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
35+
allow = [
36+
"Apache-2.0 WITH LLVM-exception",
37+
"Apache-2.0",
38+
"BSD-2-Clause",
39+
"BSD-3-Clause",
40+
"MIT",
41+
"Unlicense",
42+
"Unicode-3.0",
43+
"Zlib",
44+
]
45+
# The confidence threshold for detecting a license from license text.
46+
# The higher the value, the more closely the license text must be to the
47+
# canonical license text of a valid SPDX license file.
48+
# [possible values: any between 0.0 and 1.0].
49+
confidence-threshold = 0.8
50+
# Allow 1 or more licenses on a per-crate basis, so that particular licenses
51+
# aren't accepted for every possible crate as with the normal allow list
52+
exceptions = []
53+
54+
# Some crates don't have (easily) machine readable licensing information,
55+
# adding a clarification entry for it allows you to manually specify the
56+
# licensing information
57+
[[licenses.clarify]]
58+
name = "ring"
59+
expression = "ISC AND MIT AND OpenSSL"
60+
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]
61+
62+
[licenses.private]
63+
# If true, ignores workspace crates that aren't published, or are only
64+
# published to private registries
65+
ignore = false
66+
# One or more private registries that you might publish crates to, if a crate
67+
# is only published to private registries, and ignore is true, the crate will
68+
# not have its license(s) checked
69+
#registries = [
70+
#]
71+
72+
# This section is considered when running `cargo deny check bans`.
73+
# More documentation about the 'bans' section can be found here:
74+
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
75+
[bans]
76+
# Lint level for when multiple versions of the same crate are detected
77+
multiple-versions = "warn"
78+
# The graph highlighting used when creating dotgraphs for crates
79+
# with multiple versions
80+
# * lowest-version - The path to the lowest versioned duplicate is highlighted
81+
# * simplest-path - The path to the version with the fewest edges is highlighted
82+
# * all - Both lowest-version and simplest-path are used
83+
highlight = "all"
84+
# List of crates that are allowed. Use with care!
85+
#allow = [
86+
#]
87+
# List of crates to deny
88+
#deny = [
89+
#]
90+
# Certain crates/versions that will be skipped when doing duplicate detection.
91+
#skip = [
92+
#]
93+
# Similarly to `skip` allows you to skip certain crates during duplicate
94+
# detection. Unlike skip, it also includes the entire tree of transitive
95+
# dependencies starting at the specified crate, up to a certain depth, which is
96+
# by default infinite
97+
#skip-tree = [
98+
#]
99+
100+
# This section is considered when running `cargo deny check sources`.
101+
# More documentation about the 'sources' section can be found here:
102+
# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html
103+
[sources]
104+
# Lint level for what to happen when a crate from a crate registry that is not
105+
# in the allow list is encountered
106+
unknown-registry = "deny"
107+
# Lint level for what to happen when a crate from a git repository that is not
108+
# in the allow list is encountered
109+
unknown-git = "deny"
110+
# List of URLs for allowed crate registries. Defaults to the crates.io index
111+
# if not specified. If it is specified but empty, no registries are allowed.
112+
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
113+
# List of URLs for allowed Git repositories
114+
allow-git = ["https://github.com/jxs/barrel"]

0 commit comments

Comments
 (0)