Skip to content

Commit 4f4de22

Browse files
authored
add cargo deny (#569)
1 parent 0d29adb commit 4f4de22

File tree

8 files changed

+92
-16
lines changed

8 files changed

+92
-16
lines changed

.github/workflows/rust.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
- name: Add fmt
4545
run: rustup component add rustfmt
4646

47+
- name: Add cargo deny
48+
run: cargo install cargo-deny
49+
4750
- name: Check formatting
4851
run: cargo fmt -- --check
4952

@@ -76,6 +79,10 @@ jobs:
7679
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
7780
continue-on-error: true
7881

82+
- name: Cargo deny
83+
run: cargo deny check
84+
continue-on-error: true
85+
7986
- name: Upload analysis results to GitHub
8087
uses: github/codeql-action/upload-sarif@v3
8188
with:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* (breaks all chains in the DB)
55
* Add functionality for sharing a bill with an external party, encrypted, hashed, and signed, with the plaintext block data
66
* Change visibility of `bill_service::error` and `bill_service::service` to private, moving the used types to `bill_service`
7+
* Add cargo deny
78

89
# 0.3.17
910

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,9 @@ rstest = "0.25.0"
5454
secp256k1 = { version = "0.29" }
5555
reqwest = { version = "0.12", default-features = false }
5656
miniscript = { version = "12.3" }
57+
base64 = "0.22"
58+
mockall = "0.13.1"
59+
bcr-ebill-core = { path = "./crates/bcr-ebill-core" }
60+
bcr-ebill-persistence = { path = "./crates/bcr-ebill-persistence" }
61+
bcr-ebill-transport = { path = "./crates/bcr-ebill-transport" }
62+
surrealdb = { version = "2.3", default-features = false }

crates/bcr-ebill-api/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ nostr-sdk.workspace = true
2525
nostr.workspace = true
2626
futures.workspace = true
2727
infer = { version = "0.19.0", default-features = false }
28-
bcr-ebill-core = { path = "../bcr-ebill-core" }
29-
bcr-ebill-persistence = { path = "../bcr-ebill-persistence" }
30-
bcr-ebill-transport = { path = "../bcr-ebill-transport" }
28+
bcr-ebill-core.workspace = true
29+
bcr-ebill-persistence.workspace = true
30+
bcr-ebill-transport.workspace = true
3131
tokio.workspace = true
3232
tokio_with_wasm.workspace = true
3333
secp256k1.workspace = true
@@ -48,7 +48,7 @@ reqwest = { workspace = true, features = ["json"] }
4848
reqwest = { workspace = true, features = ["default", "json"] }
4949

5050
[dev-dependencies]
51-
mockall = "0.13.1"
51+
mockall.workspace = true
5252
nostr-relay-builder = "0.42"
5353
tokio.workspace = true
5454
async-broadcast.workspace = true

crates/bcr-ebill-persistence/Cargo.toml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,24 @@ thiserror.workspace = true
1818
uuid.workspace = true
1919
futures.workspace = true
2020
nostr.workspace = true
21-
bcr-ebill-core = { path = "../bcr-ebill-core" }
21+
bcr-ebill-core.workspace = true
2222
tokio.workspace = true
2323
tokio_with_wasm.workspace = true
2424
bitcoin.workspace = true
2525
arc-swap = "1.7"
2626

2727
# Enable "kv-indxdb" only for WebAssembly (wasm32)
2828
[target.'cfg(target_arch = "wasm32")'.dependencies]
29-
surrealdb = { version = "2.3", default-features = false, features = [
30-
"kv-indxdb",
31-
] }
32-
base64 = "0.22"
29+
surrealdb = { workspace = true, default-features = false, features = ["kv-indxdb"] }
30+
base64.workspace = true
3331

3432
# Enable "protocol-ws" for all other targets
3533
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
36-
surrealdb = { version = "2.3", default-features = false, features = ["protocol-ws"] }
34+
surrealdb = { workspace = true, default-features = false, features = ["protocol-ws"] }
3735

3836
[dev-dependencies]
39-
surrealdb = { version = "2.3", features = ["kv-mem"], default-features = false }
40-
base64 = "0.22"
37+
surrealdb = { workspace = true, default-features = false, features = ["kv-mem"] }
38+
base64.workspace = true
4139

4240
[features]
4341
embedded-db = ["surrealdb/kv-rocksdb"]

crates/bcr-ebill-transport/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ license.workspace = true
88
doctest = false
99

1010
[dependencies]
11-
bcr-ebill-core = { path = "../bcr-ebill-core" }
12-
bcr-ebill-persistence = { path = "../bcr-ebill-persistence" }
11+
bcr-ebill-core.workspace = true
12+
bcr-ebill-persistence.workspace = true
1313
async-trait.workspace = true
1414
serde.workspace = true
1515
serde_json.workspace = true
@@ -23,7 +23,7 @@ async-broadcast.workspace = true
2323
bitcoin.workspace = true
2424

2525
[dev-dependencies]
26-
mockall = "0.13.1"
26+
mockall.workspace = true
2727

2828
[target.'cfg(target_arch = "wasm32")'.dependencies]
2929
reqwest = { workspace = true, features = ["json"] }

crates/bcr-ebill-wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ console_log = { version = "1.0.0", features = ["color"] }
3232
gloo-timers = { version = "0.3.0", features = ["futures"] }
3333
tsify = { version = "0.4.5", features = ["js"] }
3434
bcr-ebill-api = { path = "../bcr-ebill-api" }
35-
bcr-ebill-transport = { path = "../bcr-ebill-transport" }
35+
bcr-ebill-transport.workspace = true

deny.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# The graph table configures how the dependency graph is constructed and thus
2+
# which crates the checks are performed against
3+
[graph]
4+
targets = []
5+
exclude = []
6+
all-features = false
7+
no-default-features = false
8+
features = []
9+
10+
[output]
11+
feature-depth = 1
12+
13+
# This section is considered when running `cargo deny check advisories`
14+
# More documentation for the advisories section can be found here:
15+
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
16+
[advisories]
17+
ignore = []
18+
unmaintained = "workspace"
19+
20+
# This section is considered when running `cargo deny check licenses`
21+
# More documentation for the licenses section can be found here:
22+
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
23+
[licenses]
24+
allow = ["MIT", "Apache-2.0", "Unicode-3.0", "Unlicense", "CDLA-Permissive-2.0", "MPL-2.0", "ISC", "CC0-1.0",
25+
"BUSL-1.1", "BSD-3-Clause", "MITNFA", "Zlib", "BSD-2-Clause",
26+
]
27+
confidence-threshold = 0.8
28+
exceptions = []
29+
30+
[licenses.private]
31+
ignore = false
32+
registries = []
33+
34+
# This section is considered when running `cargo deny check bans`.
35+
# More documentation about the 'bans' section can be found here:
36+
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
37+
[bans]
38+
# Lint level for when multiple versions of the same crate are detected
39+
multiple-versions = "allow"
40+
wildcards = "allow"
41+
highlight = "all"
42+
workspace-default-features = "allow"
43+
external-default-features = "allow"
44+
allow = []
45+
deny = []
46+
skip = []
47+
skip-tree = []
48+
[bans.workspace-dependencies]
49+
duplicates = "deny"
50+
unused = "deny"
51+
52+
# This section is considered when running `cargo deny check sources`.
53+
# More documentation about the 'sources' section can be found here:
54+
# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html
55+
[sources]
56+
unknown-registry = "warn"
57+
unknown-git = "warn"
58+
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
59+
allow-git = []
60+
61+
[sources.allow-org]
62+
github = ["BitcreditProtocol"]
63+
gitlab = []
64+
bitbucket = []

0 commit comments

Comments
 (0)