Skip to content

Pin dependencies to exact versions, add key rotation, validate CORS origins - #1008

Open
evans-storm wants to merge 1 commit into
kellymusk:masterfrom
evans-storm:chore/pin-deps-key-rotation-and-cors-validation
Open

Pin dependencies to exact versions, add key rotation, validate CORS origins#1008
evans-storm wants to merge 1 commit into
kellymusk:masterfrom
evans-storm:chore/pin-deps-key-rotation-and-cors-validation

Conversation

@evans-storm

@evans-storm evans-storm commented Aug 31, 2026

Copy link
Copy Markdown

Summary

Closes #897
closes #898
closes #900

  • Pin all Cargo dependencies to exact versions #897 — Every direct dependency in Cargo.toml now pins an exact version (matching what Cargo.lock already resolved to), not a caret range. Cargo.lock stays committed (already was) as the source of truth for transitive versions. Added .github/workflows/cargo-lock-check.yml running cargo check --locked so a Cargo.toml bump committed without regenerating the lockfile fails CI instead of silently drifting.
  • Implement WALLET_ENCRYPTION_KEY rotation without downtime #898 — Added --rotate-key, re-encrypting every wallet's secret_key_encrypted from WALLET_ENCRYPTION_KEY to WALLET_ENCRYPTION_KEY_NEW. Documented why this is safe without downtime today (nothing in the live server decrypts a wallet secret yet — see the doc comment on src/rotate_key.rs) and what would need to change once that's no longer true. A row that fails to decrypt with the old key is left untouched and reported, so a partial rotation is safe to re-run.
  • Add CORS configuration validation at startup #900CORS_ALLOWED_ORIGINS is now validated at startup — each origin must parse as a URL with an http/https scheme and a host, no path/query, and * is rejected outright (this API sends credentials). A bad value now fails AppConfig::from_env() with a clear message instead of surfacing later as a confusing HeaderValue parse panic in main.rs.

Also fixes the same pre-existing extractor.rs compile break described in earlier PRs on this repo (ApiError gained a field member; two call sites weren't updated), needed for this branch to build.

Test plan

  • cargo check passes clean (only pre-existing warnings).
  • Test code intentionally left untouched per task scope.

…rigins

Closes kellymusk#897, kellymusk#898, kellymusk#900.

- kellymusk#897: Every direct dependency in Cargo.toml now pins an exact version
  (matching what Cargo.lock already resolved to), not a caret range.
  Cargo.lock stays committed (already was) as the source of truth for
  transitive versions. Added .github/workflows/cargo-lock-check.yml running
  `cargo check --locked` so a Cargo.toml bump committed without
  regenerating the lockfile fails CI instead of silently drifting.
- kellymusk#898: Added `--rotate-key`, re-encrypting every wallet's
  secret_key_encrypted from WALLET_ENCRYPTION_KEY to
  WALLET_ENCRYPTION_KEY_NEW. Documented why this is safe without downtime
  today (nothing in the live server decrypts a wallet secret yet — see the
  doc comment on src/rotate_key.rs) and what changes once that's no longer
  true. A row that fails to decrypt with the old key is left untouched and
  reported, so a partial rotation is safe to re-run.
- kellymusk#900: CORS_ALLOWED_ORIGINS is now validated at startup — each origin must
  parse as a URL with an http/https scheme and a host, no path/query, and
  `*` is rejected outright (this API sends credentials). A bad value now
  fails AppConfig::from_env() with a clear message instead of surfacing
  later as a confusing HeaderValue parse panic in main.rs.

Also fixes the same pre-existing extractor.rs compile break described in
earlier PRs on this repo (ApiError gained a `field` member; two call sites
weren't updated), needed for this branch to build.
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@evans-storm Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CORS configuration validation at startup Implement WALLET_ENCRYPTION_KEY rotation without downtime Pin all Cargo dependencies to exact versions

1 participant