Skip to content

Commit c0f6b85

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 5890afe commit c0f6b85

File tree

6 files changed

+116
-50
lines changed

6 files changed

+116
-50
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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ target/
1717
# Integration testing extension library for SQLite.
1818
ipaddr.dylib
1919
ipaddr.so
20+
21+
# Temporary files from running the tests locally like they would be run from CI
22+
.sqlx

Cargo.lock

Lines changed: 35 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ sqlx-sqlite = { workspace = true, optional = true }
161161
anyhow = "1.0.52"
162162
time_ = { version = "0.3.2", package = "time" }
163163
futures = "0.3.19"
164-
env_logger = "0.9.0"
164+
env_logger = "0.11"
165165
async-std = { version = "1.12.0", features = ["attributes"] }
166166
tokio = { version = "1.15.0", features = ["full"] }
167167
dotenvy = "0.15.0"
@@ -175,7 +175,7 @@ rand = "0.8.4"
175175
rand_xoshiro = "0.6.0"
176176
hex = "0.4.3"
177177
tempfile = "3.9.0"
178-
criterion = {version = "0.4", features = ["async_tokio"]}
178+
criterion = { version = "0.5", features = ["async_tokio"] }
179179

180180
# Needed to test SQLCipher
181181
libsqlite3-sys = { version = "0.27", features = ["bundled-sqlcipher"] }

deny.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
notice = "deny"
7+
unmaintained = "deny"
8+
vulnerability = "deny"
9+
yanked = "deny"
10+
11+
[licenses]
12+
allow = [
13+
"Apache-2.0",
14+
"BSD-2-Clause",
15+
"BSD-3-Clause",
16+
"ISC",
17+
"MIT",
18+
"MPL-2.0",
19+
"OpenSSL",
20+
"Unicode-DFS-2016",
21+
"Zlib",
22+
]
23+
default = "deny"
24+
confidence-threshold = 0.9
25+
unlicensed = "deny"
26+
27+
[[licenses.clarify]]
28+
name = "ring"
29+
expression = "MIT AND ISC AND OpenSSL"
30+
license-files = [
31+
{ path = "LICENSE", hash = 0xbd0eed23 }
32+
]
33+
34+
[bans]
35+
allow = []
36+
deny = []
37+
multiple-versions = "deny"
38+
skip = [
39+
# async-std 1.12 uses two versions - this older version directly, and a newer verison transitively.
40+
{ name = "async-channel", version = "=1.9.0" },
41+
# native-tls 0.2.11 has this older version as a transitive dependency
42+
{ name = "spin", version = "=0.5.2" },
43+
# criterion 0.5.1 uses this older version of itertools
44+
{ name = "itertools", version = "=0.10.5" },
45+
# syn 2.0 has not been adopted by many crates using syn 1.x due to difficult breaking changes
46+
{ name = "syn", version = "<2" },
47+
]
48+
skip-tree = [
49+
# async-std 1.12 uses two versions - this older version directly, and a newer verison transitively.
50+
{ name = "async-io", version = "=1.13.0" },
51+
]
52+
53+
# Warn, rather than deny, due to sqlx crates not referencing each other by a specific version
54+
wildcards = "warn"
55+
56+
[sources]
57+
allow-git = []
58+
allow-registry = [
59+
"https://github.com/rust-lang/crates.io-index"
60+
]
61+
unknown-git = "deny"
62+
unknown-registry = "deny"
63+
64+
[sources.allow-org]
65+
bitbucket = []
66+
github = []
67+
gitlab = []

sqlx-test/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
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]
89
sqlx = { default-features = false, path = ".." }
9-
env_logger = "0.9.0"
10+
env_logger = "0.11"
1011
dotenvy = "0.15.0"
1112
anyhow = "1.0.26"
1213
async-std = { version = "1.8.0", features = [ "attributes" ] }

0 commit comments

Comments
 (0)