diff --git a/Cargo.lock b/Cargo.lock index 89999392bb..927688f98c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -314,7 +314,7 @@ dependencies = [ [[package]] name = "auth-common" version = "0.1.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=b943c85e4a38f5ec60cd18c34c73097640162bfe#b943c85e4a38f5ec60cd18c34c73097640162bfe" +source = "git+https://gitlab.com/veloren/auth.git?rev=bffb5181a35c19ddfd33ee0b4aedba741aafb68d#bffb5181a35c19ddfd33ee0b4aedba741aafb68d" dependencies = [ "rand 0.7.3", "serde", @@ -324,14 +324,15 @@ dependencies = [ [[package]] name = "authc" version = "1.0.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=b943c85e4a38f5ec60cd18c34c73097640162bfe#b943c85e4a38f5ec60cd18c34c73097640162bfe" +source = "git+https://gitlab.com/veloren/auth.git?rev=bffb5181a35c19ddfd33ee0b4aedba741aafb68d#bffb5181a35c19ddfd33ee0b4aedba741aafb68d" dependencies = [ "auth-common", "fxhash", "hex 0.3.2", + "reqwest", "rust-argon2", - "serde_json", - "ureq 1.4.1", + "serde", + "url 2.1.1", "uuid", ] @@ -1613,12 +1614,27 @@ dependencies = [ "bitflags", ] +[[package]] +name = "dtoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d7ed2934d741c6b37e33e3832298e8850b53fd2d2bea03873375596c7cea4e" + [[package]] name = "either" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "encoding_rs" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801bbab217d7f79c0062f4f7205b5d4427c6d1a7bd7aafdd1475f7c59d62b283" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "enum-iterator" version = "0.6.0" @@ -1725,7 +1741,7 @@ checksum = "b5c55005e95bbe15f5f72a73b6597d0dc82ddc97ffe2ca097a99dcd591fefbca" dependencies = [ "libflate", "tar", - "ureq 0.11.4", + "ureq", ] [[package]] @@ -2301,7 +2317,7 @@ dependencies = [ "bytes 0.4.12", "fnv", "futures 0.1.29", - "http", + "http 0.1.21", "indexmap", "log", "slab", @@ -2309,6 +2325,26 @@ dependencies = [ "tokio-io", ] +[[package]] +name = "h2" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.2", + "indexmap", + "slab", + "tokio 0.2.24", + "tokio-util", + "tracing", + "tracing-futures", +] + [[package]] name = "half" version = "1.6.0" @@ -2420,6 +2456,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84129d298a6d57d246960ff8eb831ca4af3f96d29e2e28848dae275408658e26" +dependencies = [ + "bytes 0.5.6", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.1.0" @@ -2428,10 +2475,20 @@ checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" dependencies = [ "bytes 0.4.12", "futures 0.1.29", - "http", + "http 0.1.21", "tokio-buf", ] +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +dependencies = [ + "bytes 0.5.6", + "http 0.2.2", +] + [[package]] name = "http-service" version = "0.4.0" @@ -2441,7 +2498,7 @@ dependencies = [ "async-std", "bytes 0.4.12", "futures 0.3.5", - "http", + "http 0.1.21", "pin-project-lite", ] @@ -2452,9 +2509,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33d5dae94e0fdb82f9524ea2f2b98458b3d8448526d8cc8beccb3d3fded8aff" dependencies = [ "futures 0.3.5", - "http", + "http 0.1.21", "http-service", - "hyper", + "hyper 0.12.35", ] [[package]] @@ -2463,6 +2520,12 @@ version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + [[package]] name = "hyper" version = "0.12.35" @@ -2472,9 +2535,9 @@ dependencies = [ "bytes 0.4.12", "futures 0.1.29", "futures-cpupool", - "h2", - "http", - "http-body", + "h2 0.1.26", + "http 0.1.21", + "http-body 0.1.0", "httparse", "iovec", "itoa", @@ -2482,7 +2545,7 @@ dependencies = [ "net2", "rustc_version", "time", - "tokio", + "tokio 0.1.22", "tokio-buf", "tokio-executor", "tokio-io", @@ -2490,7 +2553,47 @@ dependencies = [ "tokio-tcp", "tokio-threadpool", "tokio-timer", - "want", + "want 0.2.0", +] + +[[package]] +name = "hyper" +version = "0.13.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ad767baac13b44d4529fcf58ba2cd0995e36e7b435bc5b039de6f47e880dbf" +dependencies = [ + "bytes 0.5.6", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.2.7", + "http 0.2.2", + "http-body 0.3.1", + "httparse", + "httpdate", + "itoa", + "pin-project 1.0.2", + "socket2", + "tokio 0.2.24", + "tower-service", + "tracing", + "want 0.3.0", +] + +[[package]] +name = "hyper-rustls" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37743cc83e8ee85eacfce90f2f4102030d9ff0a95244098d781e9bee4a90abb6" +dependencies = [ + "bytes 0.5.6", + "futures-util", + "hyper 0.13.9", + "log", + "rustls 0.18.1", + "tokio 0.2.24", + "tokio-rustls", + "webpki", ] [[package]] @@ -2678,6 +2781,12 @@ dependencies = [ "libc", ] +[[package]] +name = "ipnet" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" + [[package]] name = "itertools" version = "0.9.0" @@ -3059,6 +3168,16 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +[[package]] +name = "mime_guess" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minifb" version = "0.19.1" @@ -4360,6 +4479,43 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "reqwest" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e" +dependencies = [ + "base64 0.12.3", + "bytes 0.5.6", + "encoding_rs", + "futures-core", + "futures-util", + "http 0.2.2", + "http-body 0.3.1", + "hyper 0.13.9", + "hyper-rustls", + "ipnet", + "js-sys", + "lazy_static", + "log", + "mime", + "mime_guess", + "percent-encoding 2.1.0", + "pin-project-lite", + "rustls 0.18.1", + "serde", + "serde_json", + "serde_urlencoded", + "tokio 0.2.24", + "tokio-rustls", + "url 2.1.1", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.19.0", + "winreg", +] + [[package]] name = "ring" version = "0.16.15" @@ -4687,6 +4843,18 @@ dependencies = [ "syn 1.0.54", ] +[[package]] +name = "serde_urlencoded" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +dependencies = [ + "dtoa", + "itoa", + "serde", + "url 2.1.1", +] + [[package]] name = "sha1" version = "0.6.0" @@ -5199,7 +5367,7 @@ dependencies = [ "async-std", "cookie", "futures 0.3.5", - "http", + "http 0.1.21", "http-service", "http-service-hyper", "log", @@ -5269,6 +5437,24 @@ dependencies = [ "tokio-timer", ] +[[package]] +name = "tokio" +version = "0.2.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099837d3464c16a808060bb3f02263b412f6fafcb5d01c533d309985fbeebe48" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "memchr", + "mio 0.6.22", + "num_cpus", + "pin-project-lite", + "slab", +] + [[package]] name = "tokio-buf" version = "0.1.1" @@ -5330,6 +5516,18 @@ dependencies = [ "tokio-sync", ] +[[package]] +name = "tokio-rustls" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a" +dependencies = [ + "futures-core", + "rustls 0.18.1", + "tokio 0.2.24", + "webpki", +] + [[package]] name = "tokio-sync" version = "0.1.8" @@ -5383,6 +5581,20 @@ dependencies = [ "tokio-executor", ] +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes 0.5.6", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio 0.2.24", +] + [[package]] name = "toml" version = "0.5.7" @@ -5392,6 +5604,12 @@ dependencies = [ "serde", ] +[[package]] +name = "tower-service" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" + [[package]] name = "tracing" version = "0.1.21" @@ -5399,6 +5617,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27" dependencies = [ "cfg-if 0.1.10", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -5573,6 +5792,15 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check 0.9.2", +] + [[package]] name = "unicode-bidi" version = "0.3.4" @@ -5647,22 +5875,6 @@ dependencies = [ "webpki-roots 0.18.0", ] -[[package]] -name = "ureq" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb6c9aba13a511bcbb7770864c0e9b8392acda0454a71104498a2bb112d701" -dependencies = [ - "base64 0.12.3", - "chunked_transfer", - "lazy_static", - "qstring", - "rustls 0.18.1", - "url 2.1.1", - "webpki", - "webpki-roots 0.20.0", -] - [[package]] name = "url" version = "1.7.2" @@ -6129,6 +6341,16 @@ dependencies = [ "try-lock", ] +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -6148,6 +6370,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" dependencies = [ "cfg-if 0.1.10", + "serde", + "serde_json", "wasm-bindgen-macro", ] @@ -6507,9 +6731,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.20.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f" +checksum = "f8eff4b7516a57307f9349c64bf34caa34b940b66fed4b2fb3136cb7386e5739" dependencies = [ "webpki", ] @@ -6621,6 +6845,15 @@ dependencies = [ "x11-dl", ] +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "winres" version = "0.1.11" diff --git a/client/Cargo.toml b/client/Cargo.toml index 5473d06dbe..d39bd94686 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -29,7 +29,7 @@ rayon = "1.5" specs = { git = "https://github.com/amethyst/specs.git", rev = "d4435bdf496cf322c74886ca09dd8795984919b4" } vek = { version = "0.12.0", features = ["serde"] } hashbrown = { version = "0.9", features = ["rayon", "serde", "nightly"] } -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "b943c85e4a38f5ec60cd18c34c73097640162bfe" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "bffb5181a35c19ddfd33ee0b4aedba741aafb68d" } [dev-dependencies] tracing-subscriber = { version = "0.2.3", default-features = false, features = ["fmt", "chrono", "ansi", "smallvec"] } diff --git a/client/src/lib.rs b/client/src/lib.rs index f65b361ac7..12e6154835 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -461,7 +461,7 @@ impl Client { let token_or_username = self.server_info.auth_provider.as_ref().map(|addr| // Query whether this is a trusted auth server if auth_trusted(&addr) { - Ok(authc::AuthClient::new(addr) + Ok(authc::AuthClient::new(addr)? .sign_in(&username, &password)? .serialize()) } else { diff --git a/common/net/Cargo.toml b/common/net/Cargo.toml index 7ef94c3082..8deb1c0828 100644 --- a/common/net/Cargo.toml +++ b/common/net/Cargo.toml @@ -21,7 +21,7 @@ tracing = { version = "0.1", default-features = false } hashbrown = { version = "0.9", features = ["rayon", "serde", "nightly"] } # Auth -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "b943c85e4a38f5ec60cd18c34c73097640162bfe" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "bffb5181a35c19ddfd33ee0b4aedba741aafb68d" } # ECS specs = { git = "https://github.com/amethyst/specs.git", features = ["serde", "storage-event-control"], rev = "d4435bdf496cf322c74886ca09dd8795984919b4" } diff --git a/server/Cargo.toml b/server/Cargo.toml index 379ade4bc0..7374ffb84e 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -41,7 +41,7 @@ crossbeam-channel = "0.5" prometheus = { version = "0.11", default-features = false} tiny_http = "0.7.0" portpicker = { git = "https://github.com/xMAC94x/portpicker-rs" } -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "b943c85e4a38f5ec60cd18c34c73097640162bfe" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "bffb5181a35c19ddfd33ee0b4aedba741aafb68d" } libsqlite3-sys = { version = "0.18", features = ["bundled"] } diesel = { version = "1.4.3", features = ["sqlite"] } diesel_migrations = "1.4.0" diff --git a/server/src/login_provider.rs b/server/src/login_provider.rs index e3914f021c..67c5aaaa7f 100644 --- a/server/src/login_provider.rs +++ b/server/src/login_provider.rs @@ -24,7 +24,7 @@ pub struct LoginProvider { impl LoginProvider { pub fn new(auth_addr: Option) -> Self { let auth_server = match auth_addr { - Some(addr) => Some(AuthClient::new(addr)), + Some(addr) => Some(AuthClient::new(&addr).unwrap()), None => None, }; diff --git a/server/src/persistence/character.rs b/server/src/persistence/character.rs index c52bacd89d..eb4c4fc52e 100644 --- a/server/src/persistence/character.rs +++ b/server/src/persistence/character.rs @@ -61,7 +61,7 @@ pub fn load_character_data( connection: VelorenTransaction, map: &AbilityMap, ) -> CharacterDataResult { - use schema::{body::dsl::*, character::dsl::*, item::dsl::*, stats::dsl::*}; + use schema::{body::dsl::*, character::dsl::*, item::dsl::*}; let character_containers = get_pseudo_containers(connection, char_id)?; @@ -81,7 +81,7 @@ pub fn load_character_data( .eq(char_id) .and(player_uuid.eq(requesting_player_uuid)), ) - .inner_join(stats) + .inner_join(schema::stats::dsl::stats) .first::<(Character, Stats)>(&*connection)?; let char_body = body @@ -178,7 +178,7 @@ pub fn create_character( check_character_limit(uuid, connection)?; - use schema::{body, character, stats}; + use schema::{body, character}; let (body, stats, inventory, loadout, waypoint) = persisted_components; @@ -226,7 +226,7 @@ pub fn create_character( // Insert stats record let db_stats = convert_stats_to_database(character_id, &stats, &waypoint)?; - let stats_count = diesel::insert_into(stats::table) + let stats_count = diesel::insert_into(schema::stats::table) .values(&db_stats) .execute(&*connection)?; @@ -538,7 +538,7 @@ pub fn update( char_waypoint: Option, connection: VelorenTransaction, ) -> Result>, Error> { - use super::schema::{item::dsl::*, stats::dsl::*}; + use super::schema::item::dsl::*; let pseudo_containers = get_pseudo_containers(connection, char_id)?; @@ -602,9 +602,10 @@ pub fn update( } let db_stats = convert_stats_to_database(char_id, &char_stats, &char_waypoint)?; - let stats_count = diesel::update(stats.filter(stats_id.eq(char_id))) - .set(db_stats) - .execute(&*connection)?; + let stats_count = + diesel::update(schema::stats::dsl::stats.filter(schema::stats::dsl::stats_id.eq(char_id))) + .set(db_stats) + .execute(&*connection)?; if stats_count != 1 { return Err(Error::OtherError(format!( diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 37ffc6472a..8567047987 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -174,7 +174,7 @@ impl PlayState for MainMenuState { format!("{}: {}", localized_strings.get("common.error"), e) }, client::Error::AuthClientError(e) => match e { - client::AuthClientError::JsonError(e) => format!( + client::AuthClientError::InvalidUrl(e) => format!( "{}: {}", localized_strings.get("common.fatal_error"), e