rename
Seto Elkahfi committed
Aug 5, 2024 at 15:53 UTC
c5940f7aec0fb97cfbc55fa576ed2869c05df4b9
4 files changed
+233
-52
frontend/splitfire-desktop/src-tauri/Cargo.lock
+227
-47
@@ -150,6 +150,12 @@ dependencies = [
150
"system-deps 6.2.1",
151
]
152
153
+[[package]]
154
+name = "atomic-waker"
155
+version = "1.1.2"
156
+source = "registry+https://github.com/rust-lang/crates.io-index"
157
+checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
158
+
159
[[package]]
160
name = "autocfg"
161
version = "1.1.0"
@@ -183,6 +189,12 @@ version = "0.21.7"
189
source = "registry+https://github.com/rust-lang/crates.io-index"
190
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
191
192
+[[package]]
193
+name = "base64"
194
+version = "0.22.1"
195
+source = "registry+https://github.com/rust-lang/crates.io-index"
196
+checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
197
+
198
[[package]]
199
name = "bindgen"
200
version = "0.69.4"
@@ -879,7 +891,7 @@ dependencies = [
891
"rustc_version",
892
"toml 0.8.11",
893
"vswhom",
882
- "winreg 0.52.0",
894
+ "winreg",
895
]
896
897
[[package]]
@@ -1413,16 +1425,16 @@ dependencies = [
1425
1426
[[package]]
1427
name = "h2"
1416
-version = "0.3.25"
1428
+version = "0.4.5"
1429
source = "registry+https://github.com/rust-lang/crates.io-index"
1418
-checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb"
1430
+checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab"
1431
dependencies = [
1432
+ "atomic-waker",
1433
"bytes",
1434
"fnv",
1435
"futures-core",
1436
"futures-sink",
1424
- "futures-util",
1425
- "http",
1437
+ "http 1.1.0",
1438
"indexmap 2.2.5",
1439
"slab",
1440
"tokio",
@@ -1518,14 +1530,37 @@ dependencies = [
1530
"itoa 1.0.10",
1531
]
1532
1533
+[[package]]
1534
+name = "http"
1535
+version = "1.1.0"
1536
+source = "registry+https://github.com/rust-lang/crates.io-index"
1537
+checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258"
1538
+dependencies = [
1539
+ "bytes",
1540
+ "fnv",
1541
+ "itoa 1.0.10",
1542
+]
1543
+
1544
[[package]]
1545
name = "http-body"
1523
-version = "0.4.6"
1546
+version = "1.0.1"
1547
+source = "registry+https://github.com/rust-lang/crates.io-index"
1548
+checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
1549
+dependencies = [
1550
+ "bytes",
1551
+ "http 1.1.0",
1552
+]
1553
+
1554
+[[package]]
1555
+name = "http-body-util"
1556
+version = "0.1.2"
1557
source = "registry+https://github.com/rust-lang/crates.io-index"
1525
-checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
1558
+checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f"
1559
dependencies = [
1560
"bytes",
1528
- "http",
1561
+ "futures-util",
1562
+ "http 1.1.0",
1563
+ "http-body",
1564
"pin-project-lite",
1565
]
1566
@@ -1541,47 +1576,77 @@ version = "1.8.0"
1576
source = "registry+https://github.com/rust-lang/crates.io-index"
1577
checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
1578
1544
-[[package]]
1545
-name = "httpdate"
1546
-version = "1.0.3"
1547
-source = "registry+https://github.com/rust-lang/crates.io-index"
1548
-checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
1549
-
1579
[[package]]
1580
name = "hyper"
1552
-version = "0.14.28"
1581
+version = "1.4.1"
1582
source = "registry+https://github.com/rust-lang/crates.io-index"
1554
-checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"
1583
+checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05"
1584
dependencies = [
1585
"bytes",
1586
"futures-channel",
1558
- "futures-core",
1587
"futures-util",
1588
"h2",
1561
- "http",
1589
+ "http 1.1.0",
1590
"http-body",
1591
"httparse",
1564
- "httpdate",
1592
"itoa 1.0.10",
1593
"pin-project-lite",
1567
- "socket2",
1594
+ "smallvec",
1595
"tokio",
1569
- "tower-service",
1570
- "tracing",
1596
"want",
1597
]
1598
1599
+[[package]]
1600
+name = "hyper-rustls"
1601
+version = "0.27.2"
1602
+source = "registry+https://github.com/rust-lang/crates.io-index"
1603
+checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155"
1604
+dependencies = [
1605
+ "futures-util",
1606
+ "http 1.1.0",
1607
+ "hyper",
1608
+ "hyper-util",
1609
+ "rustls",
1610
+ "rustls-pki-types",
1611
+ "tokio",
1612
+ "tokio-rustls",
1613
+ "tower-service",
1614
+]
1615
+
1616
[[package]]
1617
name = "hyper-tls"
1576
-version = "0.5.0"
1618
+version = "0.6.0"
1619
source = "registry+https://github.com/rust-lang/crates.io-index"
1578
-checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
1620
+checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
1621
dependencies = [
1622
"bytes",
1623
+ "http-body-util",
1624
"hyper",
1625
+ "hyper-util",
1626
"native-tls",
1627
"tokio",
1628
"tokio-native-tls",
1629
+ "tower-service",
1630
+]
1631
+
1632
+[[package]]
1633
+name = "hyper-util"
1634
+version = "0.1.6"
1635
+source = "registry+https://github.com/rust-lang/crates.io-index"
1636
+checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956"
1637
+dependencies = [
1638
+ "bytes",
1639
+ "futures-channel",
1640
+ "futures-util",
1641
+ "http 1.1.0",
1642
+ "http-body",
1643
+ "hyper",
1644
+ "pin-project-lite",
1645
+ "socket2",
1646
+ "tokio",
1647
+ "tower",
1648
+ "tower-service",
1649
+ "tracing",
1650
]
1651
1652
[[package]]
@@ -2542,6 +2607,26 @@ dependencies = [
2607
"siphasher",
2608
]
2609
2610
+[[package]]
2611
+name = "pin-project"
2612
+version = "1.1.5"
2613
+source = "registry+https://github.com/rust-lang/crates.io-index"
2614
+checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3"
2615
+dependencies = [
2616
+ "pin-project-internal",
2617
+]
2618
+
2619
+[[package]]
2620
+name = "pin-project-internal"
2621
+version = "1.1.5"
2622
+source = "registry+https://github.com/rust-lang/crates.io-index"
2623
+checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
2624
+dependencies = [
2625
+ "proc-macro2",
2626
+ "quote",
2627
+ "syn 2.0.53",
2628
+]
2629
+
2630
[[package]]
2631
name = "pin-project-lite"
2632
version = "0.2.13"
@@ -2869,20 +2954,23 @@ dependencies = [
2954
2955
[[package]]
2956
name = "reqwest"
2872
-version = "0.11.26"
2957
+version = "0.12.5"
2958
source = "registry+https://github.com/rust-lang/crates.io-index"
2874
-checksum = "78bf93c4af7a8bb7d879d51cebe797356ff10ae8516ace542b5182d9dcac10b2"
2959
+checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37"
2960
dependencies = [
2876
- "base64 0.21.7",
2961
+ "base64 0.22.1",
2962
"bytes",
2963
"encoding_rs",
2964
"futures-core",
2965
"futures-util",
2966
"h2",
2882
- "http",
2967
+ "http 1.1.0",
2968
"http-body",
2969
+ "http-body-util",
2970
"hyper",
2971
+ "hyper-rustls",
2972
"hyper-tls",
2973
+ "hyper-util",
2974
"ipnet",
2975
"js-sys",
2976
"log",
@@ -2904,7 +2992,22 @@ dependencies = [
2992
"wasm-bindgen",
2993
"wasm-bindgen-futures",
2994
"web-sys",
2907
- "winreg 0.50.0",
2995
+ "winreg",
2996
+]
2997
+
2998
+[[package]]
2999
+name = "ring"
3000
+version = "0.17.8"
3001
+source = "registry+https://github.com/rust-lang/crates.io-index"
3002
+checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d"
3003
+dependencies = [
3004
+ "cc",
3005
+ "cfg-if",
3006
+ "getrandom 0.2.12",
3007
+ "libc",
3008
+ "spin",
3009
+ "untrusted",
3010
+ "windows-sys 0.52.0",
3011
]
3012
3013
[[package]]
@@ -3008,13 +3111,44 @@ dependencies = [
3111
"windows-sys 0.52.0",
3112
]
3113
3114
+[[package]]
3115
+name = "rustls"
3116
+version = "0.23.12"
3117
+source = "registry+https://github.com/rust-lang/crates.io-index"
3118
+checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044"
3119
+dependencies = [
3120
+ "once_cell",
3121
+ "rustls-pki-types",
3122
+ "rustls-webpki",
3123
+ "subtle",
3124
+ "zeroize",
3125
+]
3126
+
3127
[[package]]
3128
name = "rustls-pemfile"
3013
-version = "1.0.4"
3129
+version = "2.1.3"
3130
source = "registry+https://github.com/rust-lang/crates.io-index"
3015
-checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
3131
+checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425"
3132
dependencies = [
3017
- "base64 0.21.7",
3133
+ "base64 0.22.1",
3134
+ "rustls-pki-types",
3135
+]
3136
+
3137
+[[package]]
3138
+name = "rustls-pki-types"
3139
+version = "1.7.0"
3140
+source = "registry+https://github.com/rust-lang/crates.io-index"
3141
+checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d"
3142
+
3143
+[[package]]
3144
+name = "rustls-webpki"
3145
+version = "0.102.6"
3146
+source = "registry+https://github.com/rust-lang/crates.io-index"
3147
+checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e"
3148
+dependencies = [
3149
+ "ring",
3150
+ "rustls-pki-types",
3151
+ "untrusted",
3152
]
3153
3154
[[package]]
@@ -3346,6 +3480,12 @@ dependencies = [
3480
"system-deps 5.0.0",
3481
]
3482
3483
+[[package]]
3484
+name = "spin"
3485
+version = "0.9.8"
3486
+source = "registry+https://github.com/rust-lang/crates.io-index"
3487
+checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
3488
+
3489
[[package]]
3490
name = "stable_deref_trait"
3491
version = "1.2.0"
@@ -3393,6 +3533,12 @@ version = "0.10.0"
3533
source = "registry+https://github.com/rust-lang/crates.io-index"
3534
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
3535
3536
+[[package]]
3537
+name = "subtle"
3538
+version = "2.6.1"
3539
+source = "registry+https://github.com/rust-lang/crates.io-index"
3540
+checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
3541
+
3542
[[package]]
3543
name = "symphonia"
3544
version = "0.5.4"
@@ -3478,9 +3624,9 @@ dependencies = [
3624
3625
[[package]]
3626
name = "sync_wrapper"
3481
-version = "0.1.2"
3627
+version = "1.0.1"
3628
source = "registry+https://github.com/rust-lang/crates.io-index"
3483
-checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
3629
+checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394"
3630
3631
[[package]]
3632
name = "system-configuration"
@@ -3629,7 +3775,7 @@ dependencies = [
3775
"glob",
3776
"gtk",
3777
"heck 0.5.0",
3632
- "http",
3778
+ "http 0.2.12",
3779
"ignore",
3780
"objc",
3781
"once_cell",
@@ -3749,7 +3895,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
3895
checksum = "3068ed62b63dedc705558f4248c7ecbd5561f0f8050949859ea0db2326f26012"
3896
dependencies = [
3897
"gtk",
3752
- "http",
3898
+ "http 0.2.12",
3899
"http-range",
3900
"rand 0.8.5",
3901
"raw-window-handle",
@@ -3965,6 +4111,17 @@ dependencies = [
4111
"tokio",
4112
]
4113
4114
+[[package]]
4115
+name = "tokio-rustls"
4116
+version = "0.26.0"
4117
+source = "registry+https://github.com/rust-lang/crates.io-index"
4118
+checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4"
4119
+dependencies = [
4120
+ "rustls",
4121
+ "rustls-pki-types",
4122
+ "tokio",
4123
+]
4124
+
4125
[[package]]
4126
name = "tokio-util"
4127
version = "0.7.10"
@@ -4058,6 +4215,27 @@ dependencies = [
4215
"winnow 0.6.5",
4216
]
4217
4218
+[[package]]
4219
+name = "tower"
4220
+version = "0.4.13"
4221
+source = "registry+https://github.com/rust-lang/crates.io-index"
4222
+checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
4223
+dependencies = [
4224
+ "futures-core",
4225
+ "futures-util",
4226
+ "pin-project",
4227
+ "pin-project-lite",
4228
+ "tokio",
4229
+ "tower-layer",
4230
+ "tower-service",
4231
+]
4232
+
4233
+[[package]]
4234
+name = "tower-layer"
4235
+version = "0.3.2"
4236
+source = "registry+https://github.com/rust-lang/crates.io-index"
4237
+checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
4238
+
4239
[[package]]
4240
name = "tower-service"
4241
version = "0.3.2"
@@ -4195,6 +4373,12 @@ version = "1.11.0"
4373
source = "registry+https://github.com/rust-lang/crates.io-index"
4374
checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202"
4375
4376
+[[package]]
4377
+name = "untrusted"
4378
+version = "0.9.0"
4379
+source = "registry+https://github.com/rust-lang/crates.io-index"
4380
+checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
4381
+
4382
[[package]]
4383
name = "uri-template-system"
4384
version = "0.1.0"
@@ -4880,16 +5064,6 @@ dependencies = [
5064
"memchr",
5065
]
5066
4883
-[[package]]
4884
-name = "winreg"
4885
-version = "0.50.0"
4886
-source = "registry+https://github.com/rust-lang/crates.io-index"
4887
-checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
4888
-dependencies = [
4889
- "cfg-if",
4890
- "windows-sys 0.48.0",
4891
-]
4892
-
5067
[[package]]
5068
name = "winreg"
5069
version = "0.52.0"
@@ -4917,7 +5091,7 @@ dependencies = [
5091
"glib",
5092
"gtk",
5093
"html5ever",
4920
- "http",
5094
+ "http 0.2.12",
5095
"kuchikiki",
5096
"libc",
5097
"log",
@@ -4978,3 +5152,9 @@ dependencies = [
5152
"linux-raw-sys",
5153
"rustix",
5154
]
5155
+
5156
+[[package]]
5157
+name = "zeroize"
5158
+version = "1.8.1"
5159
+source = "registry+https://github.com/rust-lang/crates.io-index"
5160
+checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
frontend/splitfire-desktop/src-tauri/Cargo.toml
+1
-1
@@ -20,7 +20,7 @@ home = "0.5.4"
20
hound = "3"
21
log = "^0.4"
22
once_cell = "1.18.0"
23
-reqwest = { version = "0.11", features = ["json"] }
23
+reqwest = { version = "0.12", features = ["json"] }
24
ringbuf = "0.3"
25
rodio = "0.17"
26
serde = { version = "1.0", features = ["derive"] }
frontend/splitfire-desktop/src-tauri/src/rest/account.rs
+2
-2
@@ -10,7 +10,7 @@ use crate::{
10
},
11
player::TauriResponse,
12
},
13
- rest::try_parsing_error_codes,
13
+ rest::parse_error_response,
14
};
15
use crate_error_codes::UserError;
16
use log::{debug, error};
@@ -53,7 +53,7 @@ pub async fn account_login(
53
reqwest::StatusCode::OK => response,
54
_ => {
55
debug!("Failed to login: {:?}", response);
56
- let error_response = try_parsing_error_codes(response).await;
56
+ let error_response = parse_error_response(response).await;
57
return error_response;
58
}
59
};
frontend/splitfire-desktop/src-tauri/src/rest/mod.rs
+3
-2
@@ -1,12 +1,12 @@
1
use crate::models::account::ErrorResponse;
2
use crate_error_codes::UserError;
3
-use log::error;
3
+use log::{debug, error};
4
use reqwest::Response;
5
6
pub mod account;
7
pub mod content;
8
9
-async fn try_parsing_error_codes<T>(response: Response) -> Result<T, ErrorResponse> {
9
+async fn parse_error_response<T>(response: Response) -> Result<T, ErrorResponse> {
10
let e: ErrorResponse = match response.json().await {
11
Ok(json) => json,
12
Err(e) => {
@@ -17,5 +17,6 @@ async fn try_parsing_error_codes<T>(response: Response) -> Result<T, ErrorRespon
17
});
18
}
19
};
20
+ debug!("Error response: {:?}", e);
21
return Err(e);
22
}