|
Added
Link Here
|
| 1 |
From 9a73230f6c37b2771e90d73a78b280701e07df03 Mon Sep 17 00:00:00 2001 |
| 2 |
From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= |
| 3 |
<dani-garcia@users.noreply.github.com> |
| 4 |
Date: Sun, 16 Jun 2024 21:46:44 +0200 |
| 5 |
Subject: [PATCH] Update rust and remove unused header values |
| 6 |
|
| 7 |
--- |
| 8 |
docker/DockerSettings.yaml | 2 +- |
| 9 |
docker/Dockerfile.alpine | 8 ++++---- |
| 10 |
docker/Dockerfile.debian | 2 +- |
| 11 |
rust-toolchain.toml | 2 +- |
| 12 |
src/auth.rs | 11 ----------- |
| 13 |
5 files changed, 7 insertions(+), 18 deletions(-) |
| 14 |
|
| 15 |
diff --git a/docker/DockerSettings.yaml b/docker/DockerSettings.yaml |
| 16 |
index 3d2b7d4049..64fedb63a8 100644 |
| 17 |
diff --git a/src/auth.rs b/src/auth.rs |
| 18 |
index f05eba6548..eee620e3f3 100644 |
| 19 |
--- src/auth.rs.orig |
| 20 |
+++ src/auth.rs |
| 21 |
@@ -405,7 +405,6 @@ impl<'r> FromRequest<'r> for Host { |
| 22 |
} |
| 23 |
|
| 24 |
pub struct ClientHeaders { |
| 25 |
- pub host: String, |
| 26 |
pub device_type: i32, |
| 27 |
pub ip: ClientIp, |
| 28 |
} |
| 29 |
@@ -425,7 +424,6 @@ impl<'r> FromRequest<'r> for ClientHeaders { |
| 30 |
request.headers().get_one("device-type").map(|d| d.parse().unwrap_or(14)).unwrap_or_else(|| 14); |
| 31 |
|
| 32 |
Outcome::Success(ClientHeaders { |
| 33 |
- host, |
| 34 |
device_type, |
| 35 |
ip, |
| 36 |
}) |
| 37 |
@@ -531,7 +529,6 @@ pub struct OrgHeaders { |
| 38 |
pub user: User, |
| 39 |
pub org_user_type: UserOrgType, |
| 40 |
pub org_user: UserOrganization, |
| 41 |
- pub org_id: String, |
| 42 |
pub ip: ClientIp, |
| 43 |
} |
| 44 |
|
| 45 |
@@ -594,7 +591,6 @@ impl<'r> FromRequest<'r> for OrgHeaders { |
| 46 |
} |
| 47 |
}, |
| 48 |
org_user, |
| 49 |
- org_id: String::from(org_id), |
| 50 |
ip: headers.ip, |
| 51 |
}) |
| 52 |
} |
| 53 |
@@ -671,7 +667,6 @@ pub struct ManagerHeaders { |
| 54 |
pub host: String, |
| 55 |
pub device: Device, |
| 56 |
pub user: User, |
| 57 |
- pub org_user_type: UserOrgType, |
| 58 |
pub ip: ClientIp, |
| 59 |
} |
| 60 |
|
| 61 |
@@ -700,7 +695,6 @@ impl<'r> FromRequest<'r> for ManagerHeaders { |
| 62 |
host: headers.host, |
| 63 |
device: headers.device, |
| 64 |
user: headers.user, |
| 65 |
- org_user_type: headers.org_user_type, |
| 66 |
ip: headers.ip, |
| 67 |
}) |
| 68 |
} else { |
| 69 |
@@ -727,7 +721,6 @@ pub struct ManagerHeadersLoose { |
| 70 |
pub device: Device, |
| 71 |
pub user: User, |
| 72 |
pub org_user: UserOrganization, |
| 73 |
- pub org_user_type: UserOrgType, |
| 74 |
pub ip: ClientIp, |
| 75 |
} |
| 76 |
|
| 77 |
@@ -743,7 +736,6 @@ impl<'r> FromRequest<'r> for ManagerHeadersLoose { |
| 78 |
device: headers.device, |
| 79 |
user: headers.user, |
| 80 |
org_user: headers.org_user, |
| 81 |
- org_user_type: headers.org_user_type, |
| 82 |
ip: headers.ip, |
| 83 |
}) |
| 84 |
} else { |
| 85 |
@@ -782,14 +774,12 @@ impl ManagerHeaders { |
| 86 |
host: h.host, |
| 87 |
device: h.device, |
| 88 |
user: h.user, |
| 89 |
- org_user_type: h.org_user_type, |
| 90 |
ip: h.ip, |
| 91 |
}) |
| 92 |
} |
| 93 |
} |
| 94 |
|
| 95 |
pub struct OwnerHeaders { |
| 96 |
- pub host: String, |
| 97 |
pub device: Device, |
| 98 |
pub user: User, |
| 99 |
pub ip: ClientIp, |
| 100 |
@@ -803,7 +793,6 @@ impl<'r> FromRequest<'r> for OwnerHeaders { |
| 101 |
let headers = try_outcome!(OrgHeaders::from_request(request).await); |
| 102 |
if headers.org_user_type == UserOrgType::Owner { |
| 103 |
Outcome::Success(Self { |
| 104 |
- host: headers.host, |
| 105 |
device: headers.device, |
| 106 |
user: headers.user, |
| 107 |
ip: headers.ip, |
| 108 |
From 16d09be2fac290224d3b9ff19685db422f4e6014 Mon Sep 17 00:00:00 2001 |
| 109 |
From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= |
| 110 |
<dani-garcia@users.noreply.github.com> |
| 111 |
Date: Sun, 16 Jun 2024 21:56:53 +0200 |
| 112 |
Subject: [PATCH] Missed one unused var |
| 113 |
|
| 114 |
--- |
| 115 |
src/auth.rs | 1 - |
| 116 |
1 file changed, 1 deletion(-) |
| 117 |
|
| 118 |
diff --git a/src/auth.rs b/src/auth.rs |
| 119 |
index eee620e3f3..c8060a28ab 100644 |
| 120 |
--- src/auth.rs.orig |
| 121 |
+++ src/auth.rs |
| 122 |
@@ -414,7 +414,6 @@ impl<'r> FromRequest<'r> for ClientHeaders { |
| 123 |
type Error = &'static str; |
| 124 |
|
| 125 |
async fn from_request(request: &'r Request<'_>) -> Outcome<Self, Self::Error> { |
| 126 |
- let host = try_outcome!(Host::from_request(request).await).host; |
| 127 |
let ip = match ClientIp::from_request(request).await { |
| 128 |
Outcome::Success(ip) => ip, |
| 129 |
_ => err_handler!("Error getting Client IP"), |