tree: 3c66143642b4dc2487075552d0ac53bc107f5f12 [path history] [tgz]
  1. Cargo.lock
  2. Cargo.toml
  3. deny.toml
  4. main.rs
  5. README.md
examples/03_deny_copyleft/README.md

02_deny_copyleft

This example shows how to explicitly deny certain licenses that will be checked against the license requirements of every crate in your dependency graph.

Requirement

license = "MIT AND Apache-2.0"

Config

[licenses]
allow = [ "MIT" ]
deny = [ "Apache-2.0" ]

Description

Just as we can allow specific licenses, we can deny specific ones via [licenses.deny]. Note that the license requirement has changed to use the operator AND instead of OR which means that the user is required to license the crate under both of the licenses, so even though we still allow MIT, our denial of Apache-2.0 causes the expression to fail and cargo-deny to emit an error that we did not accede to the license requirements of the crate.