-
Notifications
You must be signed in to change notification settings - Fork 55
feat(ci): configure cargo deny for workspace layer boundary enforcement #1932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
josecelano
merged 3 commits into
torrust:develop
from
josecelano:1925-configure-cargo-deny-for-layer-boundary-enforcement
Jun 23, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
9778503
feat(ci): configure cargo deny for workspace layer boundary enforcement
josecelano e1b01da
chore(ci): address copilot PR review comments on layer bans config
josecelano 97b37fb
chore(ci): pin cargo-deny version and align spec example with deny.toml
josecelano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # deny.toml | ||
| # Configuration for `cargo deny check bans` | ||
| # | ||
| # This file enforces the workspace's layered architecture rules by preventing | ||
| # accidental dependency edges between layers. Dependencies may only flow downward: | ||
| # servers may depend on core/protocol/domain, but inner layers must not depend on | ||
| # outer layers. | ||
| # | ||
| # See: | ||
| # - docs/packages.md for the layer architecture and forbidden edge table | ||
| # - packages/AGENTS.md for the package catalog | ||
|
|
||
| [advisories] | ||
| # Advisory scanning is a separate concern and not configured here. | ||
|
|
||
| [licenses] | ||
| # License checking is a separate concern and not configured here. | ||
|
|
||
| [bans] | ||
| # `multiple-versions` is set to "warn" because the workspace has pre-existing | ||
| # duplicate external dependency versions (e.g. `block-buffer`, `sha1`, `toml`). | ||
| # Fixing those is out of scope for this layer enforcement configuration and | ||
| # would require a separate workspace-wide dependency audit. | ||
| multiple-versions = "warn" | ||
| wildcards = "deny" | ||
|
|
||
| # Ban server-layer crates from being depended on by non-server packages. | ||
| # The `wrappers` list specifies which packages are allowed to use each | ||
| # server crate as a direct dependency. All other uses (direct or transitive) | ||
| # are denied. | ||
| deny = [ | ||
| # axum server crates — only the root binary and other axum servers may depend on them | ||
| { crate = "torrust-tracker-axum-health-check-api-server", wrappers = [ | ||
| "torrust-tracker", | ||
| "torrust-tracker-axum-health-check-api-server", | ||
| ] }, | ||
| { crate = "torrust-tracker-axum-http-server", wrappers = [ | ||
| "torrust-tracker", | ||
| "torrust-tracker-axum-health-check-api-server", | ||
| ] }, | ||
| { crate = "torrust-tracker-axum-rest-api-server", wrappers = [ | ||
| "torrust-tracker", | ||
| "torrust-tracker-axum-health-check-api-server", | ||
| ] }, | ||
| { crate = "torrust-tracker-axum-server", wrappers = [ | ||
| "torrust-tracker", | ||
| "torrust-tracker-axum-health-check-api-server", | ||
| "torrust-tracker-axum-http-server", | ||
| "torrust-tracker-axum-rest-api-server", | ||
| ] }, | ||
|
|
||
| # udp server — only server-layer + root + rest-api-core (pending fix) may depend on it | ||
| { crate = "torrust-tracker-udp-server", wrappers = [ | ||
| "torrust-tracker", | ||
| "torrust-tracker-axum-health-check-api-server", | ||
| "torrust-tracker-axum-rest-api-server", | ||
| "torrust-tracker-rest-api-core", | ||
| ] }, | ||
|
|
||
| # Protocol crates must not be used directly by torrust-tracker-core. | ||
| # Only servers and the respective protocol-specific *-core may depend on them. | ||
| { crate = "torrust-tracker-http-protocol", wrappers = [ | ||
| "torrust-tracker-axum-http-server", | ||
| "torrust-tracker-http-core", | ||
| ] }, | ||
| { crate = "torrust-tracker-udp-protocol", wrappers = [ | ||
| "torrust-tracker-client-lib", | ||
| "torrust-tracker-udp-core", | ||
| "torrust-tracker-udp-server", | ||
| ] }, | ||
|
|
||
| # Core protocol-specific wrappers must not be depended on by tracker-core | ||
| { crate = "torrust-tracker-http-core", wrappers = [ | ||
| "torrust-tracker", | ||
| "torrust-tracker-axum-http-server", | ||
| "torrust-tracker-axum-rest-api-server", | ||
| "torrust-tracker-rest-api-core", | ||
| ] }, | ||
| { crate = "torrust-tracker-udp-core", wrappers = [ | ||
| "torrust-tracker", | ||
| "torrust-tracker-axum-rest-api-server", | ||
| "torrust-tracker-rest-api-core", | ||
| "torrust-tracker-udp-server", | ||
| ] }, | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.