Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,16 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: cargo run -p codegen
- run: git diff --exit-code -- 'sdk/src/generated/*.rs' 'sdk/tests/generated/*.rs'

# cargo-deny over Cargo.lock, with deny.toml as the policy: an advisory
# against a pinned crate, a license outside the allowlist or a crate from
# an unknown source fails the pull request.
deny:
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: EmbarkStudios/cargo-deny-action@81891abc19297b21343b15ef67dc61e4aea74fda # v2.1.4
with:
command: check advisories bans licenses sources
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Run all of these before you call a change done. CI requires them.
cargo fmt --all --check
cargo clippy --workspace --tests -- -D warnings
cargo test --workspace
cargo deny check advisories bans licenses sources # needs cargo-deny
cargo run -p codegen # needs protoc; must leave the generated files unchanged
```

Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ cargo clippy --workspace --tests -- -D warnings
# Run tests.
cargo test --workspace

# Check advisories, licenses, bans and sources (needs cargo-deny).
cargo deny check advisories bans licenses sources

# Regenerate sdk/src/generated from the vendored proto.
cargo run -p codegen
```
Expand Down
57 changes: 57 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# cargo-deny: the dependency gate CI runs on every pull request (ci.yml, the
# deny job). An advisory against a crate in Cargo.lock fails the run; the fix
# is a bump, or an entry in `ignore` naming the advisory id with a comment
# saying why it does not apply here.

[graph]
all-features = true

[advisories]
version = 2
db-path = "~/.cargo/advisory-db"
db-urls = ["https://github.com/rustsec/advisory-db"]
# A yanked crate is a warning: Renovate moves the pin, and the advisory, if
# there is one, fails on its own.
yanked = "warn"
# Each entry: { id = "RUSTSEC-YYYY-NNNN", reason = "why it does not apply" }.
ignore = [
# chrono is unmaintained, with no patched release to move to. Nothing in
# the workspace names it: it comes in through pbjson-types, whose
# Timestamp and Duration are the SDK's well-known types, built without
# default features so chrono's clock and local time zone code isn't
# compiled. Remove the entry once pbjson-types is on a release without
# chrono (influxdata/pbjson#162).
{ id = "RUSTSEC-2026-0543", reason = "transitive through pbjson-types, no patched release; the path doesn't compile chrono's clock" },
]

[licenses]
version = 2
# Every license here is Apache-2.0 or on the CNCF allowlist license policy
# (cncf/foundation, policies-guidance/allowed-third-party-license-policy.md),
# a subset of it that the dependency graph uses today. A crate under another
# license fails the run until it is added deliberately.
allow = [
"Apache-2.0",
"BSD-3-Clause",
"ISC",
"MIT",
"Zlib",
]
# Unicode-3.0 is not on the CNCF allowlist. unicode-ident (license
# "(MIT OR Apache-2.0) AND Unicode-3.0") carries it for its identifier
# tables; the crate is only a build-time dependency of proc-macro2, so
# nothing under it ships in a binary. Needs a CNCF license exception; the
# same request is open for wasmCloud (cncf/foundation#1581).
exceptions = [
{ crate = "unicode-ident", allow = ["Unicode-3.0"] },
]
confidence-threshold = 0.8

[bans]
multiple-versions = "warn"
wildcards = "allow"

[sources]
unknown-registry = "deny"
unknown-git = "deny"
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
Loading