Skip to content

Commit 539fa84

Browse files
authored
chore(deps): apply available major bumps (sha2 0.11, rand 0.10) and tighten maintenance spec (#106)
- Bump sha2 0.10 -> 0.11 (drop-in for our Digest + Sha256 usage) - Bump rand 0.8 -> 0.10; switch generate_nonce to rand::random() since rand::thread_rng() and crate-root RngCore were removed - Tighten specs/maintenance.md §1 to require evaluating/applying major bumps via cargo upgrade --incompatible, not just cargo update Both bumps cover only the optional bot-auth feature. Verified clippy + tests + doctests + docs + release build with and without bot-auth.
1 parent 1f5e490 commit 539fa84

5 files changed

Lines changed: 117 additions & 35 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Changed
1111

1212
- chore(deps): refresh `Cargo.lock` to latest compatible versions (tokio 1.52, reqwest 0.13.3, rustls 0.23.40, tower-http 0.6.10, rustls-platform-verifier 0.7, pyo3 0.28.3, and others)
13+
- chore(deps): bump `sha2` 0.10 → 0.11 and `rand` 0.8 → 0.10 for the optional `bot-auth` feature; switched the nonce generator to `rand::random()` since `rand::thread_rng()` was removed in rand 0.10
1314
- docs: document conditional-request, content-focus, ETag, metadata, word count, redirect chain, and paywall fields in spec and README
15+
- docs(specs): require deep maintenance to apply available major (SemVer-incompatible) dep bumps, not just `cargo update`
1416

1517
### Maintenance
1618

Cargo.lock

Lines changed: 99 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ tower = { version = "0.5", features = ["util"] }
5555
# Crypto (bot-auth feature)
5656
ed25519-dalek = { version = "2", features = ["rand_core"] }
5757
base64 = "0.22"
58-
sha2 = "0.10"
59-
rand = "0.8"
58+
sha2 = "0.11"
59+
rand = "0.10"

crates/fetchkit/src/bot_auth.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
2323
use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine};
2424
use ed25519_dalek::{Signer, SigningKey, VerifyingKey};
25-
use rand::RngCore;
2625
use sha2::{Digest, Sha256};
2726
use std::time::{SystemTime, UNIX_EPOCH};
2827

@@ -161,8 +160,7 @@ fn jwk_thumbprint_ed25519(key: &VerifyingKey) -> String {
161160

162161
/// Generate a cryptographically random nonce (32 bytes, base64url-encoded).
163162
fn generate_nonce() -> String {
164-
let mut bytes = [0u8; 32];
165-
rand::thread_rng().fill_bytes(&mut bytes);
163+
let bytes: [u8; 32] = rand::random();
166164
URL_SAFE_NO_PAD.encode(bytes)
167165
}
168166

specs/maintenance.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,23 @@ Define recurring maintenance tasks to keep the fetchkit repository healthy, up-t
88

99
### 1. Dependency Updates
1010

11-
Update all workspace and crate-level dependencies to their latest compatible versions.
11+
Update all workspace and crate-level dependencies to their latest versions, including major
12+
(SemVer-incompatible) bumps. Maintenance must not stop at `cargo update`; it must also
13+
bump the manifest constraints in `Cargo.toml` for available major versions and adapt the
14+
code where the API has changed.
1215

1316
1. **Check outdated deps** - Run `cargo outdated -R` (or equivalent) to list stale dependencies
1417
2. **Update minor/patch** - Apply non-breaking updates via `cargo update`
15-
3. **Evaluate major bumps** - Major version upgrades are allowed; review changelogs for breaking changes and adapt code accordingly
18+
3. **Evaluate and apply major bumps** - Run `cargo upgrade --incompatible --dry-run`
19+
(from `cargo-edit`) to enumerate available major upgrades. Bump the manifest
20+
constraints in `Cargo.toml` for each one, read the upstream changelog/migration
21+
notes, and adapt the code (imports, renamed functions, removed APIs). A
22+
maintenance pass that ships only `cargo update` is incomplete — call out any
23+
major bump that is intentionally deferred, with the reason, in the PR body and
24+
`CHANGELOG.md`.
1625
4. **Verify lockfile** - Ensure `Cargo.lock` reflects the updated versions
17-
5. **Build & test** - `cargo build --workspace && cargo test --workspace` must pass after updates
26+
5. **Build & test** - `cargo build --workspace && cargo test --workspace` must pass
27+
after updates, with and without optional features (e.g. `--features bot-auth`)
1828
6. **Audit advisories** - Run `cargo audit` (if available) to check for known vulnerabilities
1929

2030
### 2. Documentation Quality (docs.rs / rustdoc)

0 commit comments

Comments
 (0)