Skip to content

Commit 79595cb

Browse files
committed
Add dependency license and advisory checks
1 parent 66f6a3e commit 79595cb

5 files changed

Lines changed: 76 additions & 3 deletions

File tree

.github/workflows/deps.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Check dependencies
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
pull_request:
9+
paths:
10+
- justfile
11+
- Cargo.lock
12+
- Cargo.toml
13+
- deny.toml
14+
- .github/workflows/deps.yml
15+
16+
jobs:
17+
advisories:
18+
timeout-minutes: 10
19+
runs-on: ubuntu-22.04
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: EmbarkStudios/cargo-deny-action@v2
23+
with:
24+
command: check advisories
25+
26+
policy:
27+
timeout-minutes: 10
28+
runs-on: ubuntu-22.04
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: EmbarkStudios/cargo-deny-action@v2
32+
with:
33+
command: check bans licenses sources

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ assert2 = "0.4.0"
3636
prost-build = "0.14"
3737
rstest = "0.26.1"
3838
ed25519-dalek = { version = "2", features = ["pkcs8", "rand_core"] }
39-
rand = "0.8"
39+
rand_core = { version = "0.6", features = ["getrandom"] }

deny.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[advisories]
2+
db-path = "~/.cargo/advisory-db"
3+
db-urls = ["https://github.com/rustsec/advisory-db"]
4+
# https://github.com/EmbarkStudios/cargo-deny/pull/611
5+
version = 2
6+
yanked = "deny"
7+
ignore = [
8+
{ id = "RUSTSEC-2026-0097", reason = "jsonwebtoken's rust_crypto backend pulls in rand 0.8 for key generation, but this crate only uses Ed25519 verification in production and uses OsRng-based key generation in tests" },
9+
{ id = "RUSTSEC-2023-0071", reason = "jsonwebtoken's rust_crypto feature enables RSA support transitively, but this crate verifies EdDSA identity tokens and does not use RSA keys or RSA signature verification" },
10+
]
11+
12+
[licenses]
13+
version = 2
14+
allow = [
15+
"MIT",
16+
"Apache-2.0",
17+
"BSD-3-Clause",
18+
"Unicode-3.0",
19+
]
20+
confidence-threshold = 0.8
21+
22+
[licenses.private]
23+
ignore = true
24+
registries = []
25+
26+
[bans]
27+
multiple-versions = "warn"
28+
wildcards = "allow"
29+
highlight = "all"
30+
allow = []
31+
skip = []
32+
33+
[sources]
34+
unknown-registry = "deny"
35+
unknown-git = "deny"
36+
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
37+
allow-git = []

justfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ clippy: (_target-installed target)
5555
cargo clippy {{ _target-option }} {{ _features }} --all-targets --workspace -- -D warnings
5656

5757
# Runs all lints (fmt, clippy, deny)
58-
lint: check-fmt clippy
58+
lint: check-fmt clippy check-deny
5959

6060
build *flags: (_target-installed target)
6161
cargo build {{ _target-option }} {{ _features }} {{ flags }}
@@ -72,6 +72,9 @@ verify: lint test
7272
udeps *flags:
7373
RUSTC_BOOTSTRAP=1 cargo udeps --all-features --all-targets {{ flags }}
7474

75+
check-deny:
76+
cargo deny --all-features check
77+
7578
_target-installed target:
7679
#!/usr/bin/env bash
7780
set -euo pipefail

src/request_identity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ mod tests {
164164

165165
use ed25519_dalek::pkcs8::EncodePrivateKey;
166166
use ed25519_dalek::SigningKey;
167-
use rand::rngs::OsRng;
167+
use rand_core::OsRng;
168168
use serde::Serialize;
169169
use std::time::SystemTime;
170170

0 commit comments

Comments
 (0)