Skip to content

Commit 3a0415a

Browse files
committed
chore(deps): Add deny.yaml and a cargo deny CI job to check dependencies for vulnerabilities
Signed-off-by: Joshua Potts <[email protected]>
1 parent 9ba488c commit 3a0415a

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

.github/workflows/sqlx.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ on:
88
- '*-dev'
99

1010
jobs:
11+
deny:
12+
name: Cargo Deny
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: EmbarkStudios/cargo-deny-action@v1
17+
1118
format:
1219
name: Format
1320
runs-on: ubuntu-20.04

deny.toml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
[advisories]
2+
ignore = [
3+
# No upgrade available for rsa 0.9.4, a direct dependency of sqlx-mysql
4+
"RUSTSEC-2023-0071",
5+
]
6+
version = 2
7+
8+
[licenses]
9+
allow = [
10+
"Apache-2.0",
11+
"BSD-2-Clause",
12+
"BSD-3-Clause",
13+
"ISC",
14+
"MIT",
15+
"MPL-2.0",
16+
"OpenSSL",
17+
"Unicode-DFS-2016",
18+
"Zlib",
19+
]
20+
confidence-threshold = 0.9
21+
version = 2
22+
23+
[[licenses.clarify]]
24+
name = "ring"
25+
expression = "MIT AND ISC AND OpenSSL"
26+
license-files = [
27+
{ path = "LICENSE", hash = 0xbd0eed23 }
28+
]
29+
30+
[bans]
31+
allow = []
32+
deny = []
33+
multiple-versions = "deny"
34+
skip = [
35+
# async-std 1.12 uses two versions - this older version directly, and a newer verison transitively.
36+
{ name = "async-channel", version = "=1.9.0" },
37+
# async-global-executor transitively depends on two different versions of this crate
38+
{ name = "event-listener", version = "^4.0.0" },
39+
# async-global-executor transitively depends on two different versions of this crate
40+
{ name = "event-listener-strategy", version = "=0.4.0" },
41+
# criterion 0.5.1 uses this older version of itertools
42+
# Note that cargo deny will warn about this being unmatched with the --all-features flag set
43+
{ name = "itertools", version = "=0.10.5" },
44+
# mac_address 1.1.5, an optional feature of sqlx-core, this older version as a direct dependency
45+
{ name = "nix", version = "=0.23.2" },
46+
# native-tls 0.2.11 has this older version as a transitive dependency
47+
{ name = "spin", version = "=0.5.2" },
48+
# syn 2.0 has not been adopted by many crates using syn 1.x due to difficult breaking changes
49+
{ name = "syn", version = "<2" },
50+
]
51+
skip-tree = [
52+
# async-std 1.12 uses two versions - this older version directly, and a newer verison transitively.
53+
{ name = "async-io", version = "=1.13.0" },
54+
]
55+
56+
# Warn, rather than deny, due to sqlx crates not referencing each other by a specific version
57+
wildcards = "warn"
58+
59+
[sources]
60+
allow-git = []
61+
allow-registry = [
62+
"https://github.com/rust-lang/crates.io-index"
63+
]
64+
unknown-git = "deny"
65+
unknown-registry = "deny"
66+
67+
[sources.allow-org]
68+
bitbucket = []
69+
github = []
70+
gitlab = []

sqlx-test/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "sqlx-test"
33
version = "0.1.0"
44
edition = "2021"
5+
license = "MIT OR Apache-2.0"
56
publish = false
67

78
[dependencies]

0 commit comments

Comments
 (0)