Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code: Add new safe API for constructing a code #257

Merged
merged 14 commits into from
Oct 11, 2024
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ jobs:
toolchain: nightly
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
feature-group: default-features
features: "all"
- name: Extract Changelog
uses: release-flow/keep-a-changelog-action@v3
with:
Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- \[lib\]\[deprecated\] `magic_wormhole::transfer::send_*` and `request_file` methods to take an `OfferSend` and `OfferReceive` instead of using separate methods for files and folders. Use `transfer::send()` and `transfer::receive()` for the new methods.
- \[lib\]\[breaking\] struct `transfer::ReceiveRequest` became an enum to prepare for transfer v2
- \[all\]\[\breaking\] Code words with a secret password section shorter than 4 bytes are no longer accepted. This only breaks completely invalid uses of the code.
- \[all\] Code words with a weak password section or a non-integer nameplate will throw an error in the long. This error can be upgraded to a hard error by enabling the "entropy" feature. This feature will become the default in the next major release.
- \[lib\] Implemented FromStr for `Code` and `Nameplate`
- \[lib\] Added new checked type for the `Password` section of a wormhole code
- \[lib\] Added new `entropy` feature. When enabled, the entropy of the passed password will be checked on creation. This will change the signature of `MailboxConnection::create_with_password` to require the password to be passed via the new `Password` wrapper type.
- \[lib\]\[deprecated\] Deprecated the `Code` and `Nameplate` `From<impl Into<String>>` implementations and `new()` methods. They are unchecked and will print a warning for now. These will be removed in the next breaking release.

## [0.7.1] - 2024-07-25

Expand Down
186 changes: 186 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ url = "2.2.2"
tracing = "0.1"
tracing-subscriber = "0.3"
test-log = "0.2"
zxcvbn = "3.1.0"

[package]
name = "magic-wormhole"
Expand Down Expand Up @@ -102,6 +103,7 @@ thiserror = { workspace = true }
futures = { workspace = true }
url = { workspace = true, features = ["serde"] }
percent-encoding = { workspace = true }
zxcvbn = { workspace = true, optional = true }

tracing = { workspace = true, features = ["log", "log-always"] }

Expand Down Expand Up @@ -147,6 +149,8 @@ eyre = { workspace = true }

[features]

# Check the entropy of custom codes. Will fail for any weak passwords.
entropy = ["zxcvbn"]
transfer = ["transit", "dep:tar", "dep:rmp-serde"]
transit = [
"dep:noise-rust-crypto",
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async-std = { workspace = true, features = ["attributes", "unstable"] }
rand = { workspace = true }

# CLI specific dependencies
magic-wormhole = { path = "..", version = "0.7", features = ["all"] }
magic-wormhole = { path = "..", version = "0.7", features = ["all", "entropy"] }
clap = { workspace = true, features = ["cargo", "derive", "help"] }
clap_complete = { workspace = true }
env_logger = { workspace = true }
Expand Down
Loading