Pin dependencies to exact versions, add key rotation, validate CORS origins - #1008
Open
evans-storm wants to merge 1 commit into
Open
Conversation
…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.
|
@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! 🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #897
closes #898
closes #900
Cargo.tomlnow pins an exact version (matching whatCargo.lockalready resolved to), not a caret range.Cargo.lockstays committed (already was) as the source of truth for transitive versions. Added.github/workflows/cargo-lock-check.ymlrunningcargo check --lockedso aCargo.tomlbump committed without regenerating the lockfile fails CI instead of silently drifting.--rotate-key, re-encrypting every wallet'ssecret_key_encryptedfromWALLET_ENCRYPTION_KEYtoWALLET_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 onsrc/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.CORS_ALLOWED_ORIGINSis 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 failsAppConfig::from_env()with a clear message instead of surfacing later as a confusingHeaderValueparse panic inmain.rs.Also fixes the same pre-existing
extractor.rscompile break described in earlier PRs on this repo (ApiErrorgained afieldmember; two call sites weren't updated), needed for this branch to build.Test plan
cargo checkpasses clean (only pre-existing warnings).