Skip to content

Commit 0440cc0

Browse files
committed
Update reqwest and adjust features
With this commit I'm switching the default to reqwest v0.13. I also removed the `native-tls` and `rustls-tls` features and use `reqwest/default-tls` as default. By not forcing a specific other default than reqwest does, this should prevent pulling on other crates by default. Using something else then the default is as easy as turing of the `default-features` for this crate, and pull in reqwest your self. Also adjust the crate to default to the 2024 edition as it's has been available for almost a year. If you need want to keep using reqwest v0.12.x, use the v0.14 version of this crate. Signed-off-by: BlackDex <black.dex@gmail.com>
1 parent f154300 commit 0440cc0

File tree

3 files changed

+88
-42
lines changed

3 files changed

+88
-42
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Install Rust with clippy
4141
- name: "Install rust-toolchain version"
42-
uses: dtolnay/rust-toolchain@4305c38b25d97ef35a8ad1f985ccf2d2242004f2 # stable at Apr 29, 2025, 9:23 PM GMT+2
42+
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable @ Dec 16, 2025, 6:12 PM GMT+1
4343
with:
4444
components: clippy
4545
# End Install Rust with clippy
@@ -53,13 +53,13 @@ jobs:
5353

5454
# Checkout the repo
5555
- name: "Checkout"
56-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
56+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5757
with:
5858
persist-credentials: false
5959
# End Checkout the repo
6060

6161
# Enable Rust Caching
62-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
62+
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
6363
# End Enable Rust Caching
6464

6565
# Run cargo commands
@@ -81,6 +81,18 @@ jobs:
8181
run: |
8282
cargo build --all-features --verbose
8383
84+
- name: "Build all features"
85+
id: build_no_default_features
86+
if: ${{ always() }}
87+
run: |
88+
cargo build --no-default-features --verbose
89+
90+
- name: "Build all features"
91+
id: build_native_tls
92+
if: ${{ always() }}
93+
run: |
94+
cargo build --no-default-features --features reqwest/native-tls --verbose
95+
8496
- name: "Build otp example"
8597
id: build_example_otp
8698
if: ${{ always() }}
@@ -121,7 +133,6 @@ jobs:
121133
cargo clippy --examples
122134
# End Run cargo clippy
123135

124-
125136
# Check for any previous failures, if there are stop, else continue.
126137
# This is useful so all test/clippy/fmt actions are done, and they can all be addressed
127138
- name: "Some checks failed"
@@ -130,6 +141,8 @@ jobs:
130141
RUN_CARGO_UPDATE: ${{ steps.run_cargo_update.outcome }}
131142
RUN_CARGO_TEST: ${{ steps.run_cargo_test.outcome }}
132143
BUILD_ALL: ${{ steps.build_all_features.outcome }}
144+
BUILD_NO_DEF: ${{ steps.build_no_default_features.outcome }}
145+
BUILD_NATIVE: ${{ steps.build_native_tls.outcome }}
133146
EXAMPLE_OTP: ${{ steps.build_example_otp.outcome }}
134147
EXAMPLE_OTP_ASYNC: ${{ steps.build_example_otp_async.outcome }}
135148
EXAMPLE_OTP_CUSTOM: ${{ steps.build_example_otp_custom.outcome }}
@@ -144,6 +157,8 @@ jobs:
144157
echo "|cargo update|${RUN_CARGO_UPDATE}|" >> ${GITHUB_STEP_SUMMARY}
145158
echo "|cargo test|${RUN_CARGO_TEST}|" >> ${GITHUB_STEP_SUMMARY}
146159
echo "|build all features|${BUILD_ALL}|" >> ${GITHUB_STEP_SUMMARY}
160+
echo "|build no def feat|${BUILD_NO_DEF}|" >> ${GITHUB_STEP_SUMMARY}
161+
echo "|build native-tls|${BUILD_NATIVE}|" >> ${GITHUB_STEP_SUMMARY}
147162
echo "|build example otp|${EXAMPLE_OTP}|" >> ${GITHUB_STEP_SUMMARY}
148163
echo "|build example otp_async|${EXAMPLE_OTP_ASYNC}|" >> ${GITHUB_STEP_SUMMARY}
149164
echo "|build example otp_custom|${EXAMPLE_OTP_CUSTOM}|" >> ${GITHUB_STEP_SUMMARY}

Cargo.toml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "yubico_ng"
3-
version = "0.14.1"
3+
version = "0.15.0"
44
authors = ["Mathijs van Veluw <black.dex@gmail.com>"]
5-
edition = "2021"
6-
rust-version = "1.82.0"
5+
edition = "2024"
6+
rust-version = "1.85.0"
77

88
description = "Yubikey client API library"
99
license = "MIT OR Apache-2.0"
@@ -23,26 +23,27 @@ include = [
2323
name = "yubico_ng"
2424
path = "src/lib.rs"
2525

26+
[features]
27+
default = ["online-tokio", "reqwest/default-tls"]
28+
online-tokio = ["futures"]
29+
2630
[dependencies]
2731
base64 = "0.22"
2832
futures = { version = "0.3", optional = true }
2933
hmac = "0.12"
3034
rand = "0.9"
31-
reqwest = { version = "0.12", features = ["blocking"], default-features = false }
35+
reqwest = { version = "0.13", features = ["blocking"], default-features = false }
3236
sha1 = "0.10"
3337
threadpool = "1.8"
3438
form_urlencoded = "1"
3539

3640
[dev-dependencies]
37-
tokio = { version = ">=1.47", features = ["macros", "rt-multi-thread"], default-features = false }
41+
tokio = { version = ">=1.49", features = ["macros", "rt-multi-thread"], default-features = false }
3842
futures = "0.3"
3943
dotenvy = "0.15"
44+
# Force a minimal version for tracing which ensures reqwest/native-tls works too
45+
tracing = { version = ">=0.1.35" }
4046

41-
[features]
42-
default = ["online-tokio", "native-tls"]
43-
online-tokio = ["futures"]
44-
native-tls = ["reqwest/native-tls"]
45-
rustls-tls = ["reqwest/rustls-tls"]
4647

4748
# Linting config
4849
# https://doc.rust-lang.org/rustc/lints/groups.html

README.md

Lines changed: 58 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -179,31 +179,61 @@ The OTP is valid.
179179

180180
## Changelog
181181

182-
- 0.14.1 (2025-08-13):
183-
* Exclude several files from the crate package
184-
185-
- 0.14.0 (2025-08-13) (not published to crates.io):
186-
* Upgrade to `tokio` 1.47
187-
* Bumped MSRV to v1.82.0 needed by latest packages
188-
* Added more clippy/rust lints including `pedantic` and fixed found items
189-
* Use only the main api server, the others are deprecated
190-
* Updated GHA
191-
* Added dotenvy as a dev dependency to load `.env` files
192-
193-
- 0.13.0 (2025-04-23):
194-
* Upgrade to `tokio` 1.44, `rand` 0.9
195-
* Renamed to yubico_ng and published crate
196-
* Made edition 2024 compatible
197-
* Added several clippy/rust lints and fixed those
198-
* Fixed a panic if the `YK_API_HOST` was invalid
199-
* Use only the main api server, the others are deprecated
200-
* Run cargo fmt
201-
* Updated GHA to use hashes and run/fix zizmor
202-
203-
- 0.12.0: Upgrade to `tokio` 1.37, `reqwest` 0.12, `base64` 0.22, clippy fixes.
204-
- 0.10.0: Upgrade to `tokio` 1.1 and `reqwest` 0.11
205-
- 0.9.2: (Yanked) Dependencies update
206-
- 0.9.1: Set HTTP Proxy (Basic-auth is optional)
207-
- 0.9.0: Moving to `tokio` 0.2 and `reqwest` 0.10
208-
- 0.9.0-alpha.1: Moving to `futures` 0.3.0-alpha.19
209-
- 0.8: Rename the `sync` and `async` modules to `sync_verifier` and `async_verifier` to avoid the use of the `async` reserved keyword.
182+
- 0.15.0 (2026-01-18):
183+
* Use reqwest v0.13 or higher
184+
* Switched to edition 2024
185+
* Set MSRV to v1.85.0 which supports edition 2024 by default
186+
* Removed `native-tls` and `rustls-tls` and use `reqwest/default-tls` by default.<br>
187+
All other reqwest features are disabled in this crate it self!
188+
189+
#### Hightlights
190+
191+
In this version I removed the specific reqwest features because it would limit reqwest to those specific features.<br>
192+
I default to the `default-tls` feature via the `default` feature of the crate it self, which should be fine for most use cases.
193+
194+
If you want to use anything else besides `default-tls`, use `default-features = false`, define `reqwest` as a custom dependency and define the wanted features. This way you can use `rustls-no-provider` and use any provider supported by `reqwest`.
195+
196+
```toml
197+
[dependencies]
198+
yubico_ng = { version = "0.15", default-features = false, features = ["online-tokio"] }
199+
reqwest = { version = "0.13.1", default-features = false, features = ["rustls-no-provider"] }
200+
rustls = { version = "0.23.36", default-features = false, features = ["ring"] }
201+
```
202+
203+
```rust
204+
fn main() {
205+
// Initialize rustls with ring so reqwest v0.13+ will work without aws-lc for example
206+
rustls::crypto::ring::default_provider()
207+
.install_default()
208+
.expect("Failed to install rustls crypto provider for Reqwest");
209+
}
210+
```
211+
212+
- 0.14.1 (2025-08-13):
213+
* Exclude several files from the crate package
214+
215+
- 0.14.0 (2025-08-13) (not published to crates.io):
216+
* Upgrade to `tokio` 1.47
217+
* Bumped MSRV to v1.82.0 needed by latest packages
218+
* Added more clippy/rust lints including `pedantic` and fixed found items
219+
* Use only the main api server, the others are deprecated
220+
* Updated GHA
221+
* Added dotenvy as a dev dependency to load `.env` files
222+
223+
- 0.13.0 (2025-04-23):
224+
* Upgrade to `tokio` 1.44, `rand` 0.9
225+
* Renamed to yubico_ng and published crate
226+
* Made edition 2024 compatible
227+
* Added several clippy/rust lints and fixed those
228+
* Fixed a panic if the `YK_API_HOST` was invalid
229+
* Use only the main api server, the others are deprecated
230+
* Run cargo fmt
231+
* Updated GHA to use hashes and run/fix zizmor
232+
233+
- 0.12.0: Upgrade to `tokio` 1.37, `reqwest` 0.12, `base64` 0.22, clippy fixes.
234+
- 0.10.0: Upgrade to `tokio` 1.1 and `reqwest` 0.11
235+
- 0.9.2: (Yanked) Dependencies update
236+
- 0.9.1: Set HTTP Proxy (Basic-auth is optional)
237+
- 0.9.0: Moving to `tokio` 0.2 and `reqwest` 0.10
238+
- 0.9.0-alpha.1: Moving to `futures` 0.3.0-alpha.19
239+
- 0.8: Rename the `sync` and `async` modules to `sync_verifier` and `async_verifier` to avoid the use of the `async` reserved keyword.

0 commit comments

Comments
 (0)