aboutsummaryrefslogtreecommitdiff
path: root/azalea-auth
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2025-11-30 21:04:12 -0600
committerGitHub <noreply@github.com>2025-11-30 21:04:12 -0600
commit6c110f2731c3893af397cc6a660f374ff705c99b (patch)
treed3441af29cf40b49d474fc04aa1f426ad4292fa0 /azalea-auth
parent6930966aabf9b49fb6a0dc8b61076fa3f1abc298 (diff)
downloadazalea-drasl-6c110f2731c3893af397cc6a660f374ff705c99b.tar.xz
Add `online-mode` Cargo feature (#281)
* Add `online-mode` cargo feature * fix bad formatting in Cargo.toml
Diffstat (limited to 'azalea-auth')
-rw-r--r--azalea-auth/Cargo.toml6
-rw-r--r--azalea-auth/src/lib.rs11
-rw-r--r--azalea-auth/src/sessionserver.rs1
3 files changed, 14 insertions, 4 deletions
diff --git a/azalea-auth/Cargo.toml b/azalea-auth/Cargo.toml
index c33945df..84b06884 100644
--- a/azalea-auth/Cargo.toml
+++ b/azalea-auth/Cargo.toml
@@ -15,7 +15,7 @@ crypto-bigint.workspace = true # TODO: Remove when rsa is fixed.
crypto-primes.workspace = true # TODO: Remove when rsa is fixed.
indexmap.workspace = true
md-5.workspace = true
-reqwest = { workspace = true, default-features = false, features = [
+reqwest = { workspace = true, optional = true, default-features = false, features = [
"json",
"rustls-tls",
] }
@@ -32,5 +32,9 @@ uuid = { workspace = true, features = ["serde", "v3"] }
env_logger.workspace = true
tokio = { workspace = true, features = ["full"] }
+[features]
+default = ["online-mode"]
+online-mode = ["dep:reqwest"]
+
[lints]
workspace = true
diff --git a/azalea-auth/src/lib.rs b/azalea-auth/src/lib.rs
index 1643bf04..a024f4d5 100644
--- a/azalea-auth/src/lib.rs
+++ b/azalea-auth/src/lib.rs
@@ -1,10 +1,15 @@
#![doc = include_str!("../README.md")]
+#[cfg(feature = "online-mode")]
mod auth;
+#[cfg(feature = "online-mode")]
pub mod cache;
+#[cfg(feature = "online-mode")]
pub mod certs;
-pub mod game_profile;
-pub mod offline;
+#[cfg(feature = "online-mode")]
pub mod sessionserver;
-
+#[cfg(feature = "online-mode")]
pub use auth::*;
+
+pub mod game_profile;
+pub mod offline;
diff --git a/azalea-auth/src/sessionserver.rs b/azalea-auth/src/sessionserver.rs
index 317d09fa..e8ab5de7 100644
--- a/azalea-auth/src/sessionserver.rs
+++ b/azalea-auth/src/sessionserver.rs
@@ -1,4 +1,5 @@
//! Tell Mojang you're joining a multiplayer server.
+
use std::sync::LazyLock;
use reqwest::StatusCode;