Skip to content
Draft
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
11 changes: 11 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ wildcards = "deny"
# Duplicates come from dependencies' own requirements, which this workspace
# can't change; warning about them would only bury real failures.
multiple-versions = "allow"
# Each crypto and database primitive has one owner, so a dependency cannot quietly
# add a second one. `wrappers` lists the only crates that may depend on it; any
# other path to it fails. Names are checked against `cargo tree -i`.
deny = [
{ crate = "ring", reason = "aws-lc-rs is the cryptography provider" },
{ crate = "sha2", wrappers = ["sqlx-core", "sqlx-macros-core", "sqlx-postgres"], reason = "digests come from `sourceorigin-crypto`; only SQLx's own SCRAM sign-in uses it" },
{ crate = "rand", wrappers = ["opentelemetry_sdk", "sqlx-postgres", "webauthn-rs-core"], reason = "randomness comes from `sourceorigin-crypto`; only these dependencies draw their own" },
{ crate = "openssl", wrappers = ["auth-service", "webauthn-attestation-ca", "webauthn-authenticator-rs", "webauthn-rs-core"], reason = "only webauthn-rs links it; auth-service names it for its `vendored` feature alone and never calls it" },
{ crate = "aws-lc-rs", wrappers = ["rcgen", "rustls", "rustls-webpki", "sourceorigin-crypto"], reason = "SourceOrigin's cryptography is `sourceorigin-crypto`; the TLS stack, and the test certificates' generator, bring their own" },
{ crate = "sqlx", wrappers = ["sourceorigin-common", "sourceorigin-repository"], reason = "SQL lives in `sourceorigin-repository`; `sourceorigin-common` only decodes identifiers from columns" },
]

# Crates come from crates.io only: never another registry or a Git repository.
[sources]
Expand Down
5 changes: 4 additions & 1 deletion docs/dev/rust-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ The workspace has one cryptographic library, `aws-lc-rs`: the crypto crate
builds on it, and it is rustls's provider for every TLS client (reqwest, SQLx
and lettre). Don't add another, such as `ring`, `openssl`, `sha2` or `rand`.
OpenSSL is in the tree only because webauthn-rs needs it, and auth-service names
it only to build it vendored. `cargo tree -i ring` should print nothing.
it only to build it vendored. `deny.toml` bans these crates and lists the only
dependencies that may bring `sha2`, `rand`, `openssl` and `aws-lc-rs`, and the only
crates that may use `sqlx`; `just audit` fails on any other path to them, and on
`ring` entirely.

Hold a secret in a type that zeroizes it when dropped: the crypto crate's
`Secret` and `ClientSecret`, `SecretBytes` for configured secrets, `secrecy`'s
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ expressions included.
| Any command against a scratch cluster | `just db scratch -- psql` |
| Browser tests, against a running deployment | `just web test-browser` |
| Register the browser tests' clients with auth on `localhost` | `just web browser-client` |
| Dependency audits: cargo-deny's advisories, licenses, `*` requirements and sources other than crates.io, and pnpm's | `just audit` (`just rust audit` / `just web audit`) |
| Dependency audits: cargo-deny's advisories, licenses, `*` requirements, banned crates and sources other than crates.io, and pnpm's | `just audit` (`just rust audit` / `just web audit`) |
| Validate the piqueld manifests with piquelctl, and the telemetry configs with the images that run them (needs Docker) | `just infra check` |
| Regenerate the query cache, the SDK vectors, the TypeScript SDK's wire types and shared constants, or the generated documentation | `just db prepare` / `just sdk-vectors` / `just sdk-types` / `just docs reference` |
| Build the book and check its links | `just docs` |
Expand Down
2 changes: 1 addition & 1 deletion just/rust.just
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ unused:
# Advisories, licenses, wildcard requirements and sources other than crates.io,
# as deny.toml configures them. Every feature is on, so the audit covers what
# the SDKs' features pull in even when no workspace crate enables them.
[doc("Advisories, licenses, wildcards and sources other than crates.io, by cargo-deny.")]
[doc("Advisories, licenses, wildcards, banned crates and sources other than crates.io, by cargo-deny.")]
audit:
@cargo deny --all-features check

Expand Down
Loading