Skip to content

Commit ff4de30

Browse files
committed
docs: the crate list names common's always-on modules and the SDK's crypto uses
Checked against each crate's Cargo.toml and code: common's net and form modules were missing, its events feature also brings notifications and alerts, and the crypto crate verifies RS256 signatures, which the SDK uses to check tokens.
1 parent e99cc0e commit ff4de30

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

‎docs/dev/rust-conventions.md‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,20 @@ Keep implementations simple. Follow neighbouring modules and share repeated logi
1212
bearer challenges, step-up requirements, SDK error codes and the constants both
1313
SDKs apply, the bodies of auth's settings API, the same-origin rule for browser
1414
requests, and the browser isolation headers every response of auth and
15-
sourceorigin.dev carries (`isolation`). The rest are features: `admin` (the
16-
views of administration, which the admin dashboard shows, the CLI prints as
17-
JSON and the database crate decodes into),
18-
`client-spans` (`SendTraced`, client spans around `reqwest` requests, for auth
19-
and the SDK), `config` (environment variables, validated origins, secret
20-
references), `email` (address normalization), `events` (domain events),
15+
sourceorigin.dev carries (`isolation`). Beside them sit the public IP ranges,
16+
the only ones auth delivers to (`net`), and what auth's forms post that
17+
doesn't decode as itself, such as a checkbox (`form`). The rest are features:
18+
`admin` (the views of administration, which the admin dashboard shows, the CLI
19+
prints as JSON and the database crate decodes into), `client-spans`
20+
(`SendTraced`, client spans around `reqwest` requests, for auth and the SDK), `config` (environment variables, validated origins, secret
21+
references), `email` (address normalization), `events` (domain events, the
22+
notifications they give owners and the alerts administrators see),
2123
`similarity` (look-alike detection for handles and client names) and `sqlx`
2224
(column decoding, enabled only by the database crate).
2325
- `sourceorigin-crypto` (`crates/crypto`): random secrets, digests, HMAC, constant-time
24-
comparison, PKCE, RS256 signing, key sets, AES-256-GCM sealing of keys at rest,
25-
Ed25519 signed notes, for audit checkpoints, and SCRAM-SHA-256 verifiers of
26-
database passwords.
26+
comparison, PKCE, RS256 signing and verification, key sets, AES-256-GCM sealing
27+
of keys at rest, Ed25519 signed notes, for audit checkpoints, and SCRAM-SHA-256
28+
verifiers of database passwords.
2729
- `sourceorigin-auth` (`crates/auth-sdk`): the public Rust SDK, following
2830
[sdk.md](architecture/sdk.md): token validation, typed scopes, login and the JWKS cache auth
2931
also uses for Google; its `axum` feature adds extractors, a bearer layer and
@@ -66,7 +68,7 @@ Application code uses `Secret`, `Digest`, `Pkce`, `Rs256Key`, `KeySet`,
6668
`aws-lc-rs` directly. Environment reads go through `Variable`.
6769
Keep cryptographic implementations in the crypto crate so they can be audited
6870
together. It is Apache-2.0, like the SDK, so the SDK uses it too, for its
69-
randomness, hashes and cookie sealing.
71+
randomness, hashes, token signature checks and cookie sealing.
7072

7173
The workspace has one cryptographic library, `aws-lc-rs`: the crypto crate
7274
builds on it, and it is rustls's provider for every TLS client (reqwest, SQLx

0 commit comments

Comments
 (0)