Major refactor to handler traits
Added `IntoGiteratedHandler`, which is the new trait for handler functions. This allows us to finally get rid of the Object and ObjectOperation bounds that resulted in hacks around the newer features of the unified stack. Squashed commit of the following: commit 62e1ecf76ee31cda0bab4602d9d00fa0dc2f9158 Author: Amber <[email protected]> Date: Wed Oct 11 09:31:11 2023 -0500 Update commit dfd2d1b0b5d81ee3bc48f0321c6aceaa677e3b8b Author: Amber <[email protected]> Date: Wed Oct 11 09:31:07 2023 -0500 Major refactor to handler traits Added `IntoGiteratedHandler`, which is the new trait for handler functions. This allows us to finally get rid of the Object and ObjectOperation bounds that resulted in hacks around the newer features of the unified stack. Removed dead and legacy code. I think... commit 57b4b398eff32e69f2f4b9700e42a1277a4d1055 Author: Amber <[email protected]> Date: Sun Oct 1 23:05:10 2023 -0500 New handler trait for giterated stack Refactor the old handler trait so it is more generic and can be used for specific kinds of handlers
parent: tbd commit: 90c4780
1 | use ; |
2 | |
3 | use |
4 | , | DecodeRsaPrivateKey
5 | , | SigningKey
6 | , | Sha256
7 | , |
8 | RsaPrivateKey, |
9 | ; |
10 | use ; |
11 | |
12 | use crate:: |
13 | , | Instance
14 | , | GiteratedMessage
15 | , |
16 | , |
17 | , | User
18 | ; |
19 | |
20 | |
21 | |
22 | pub user: User, |
23 | pub generated_for: Instance, |
24 | pub exp: u64, |
25 | |
26 | |
27 | |
28 | |
29 | pub source: , |
30 | pub message: , |
31 | |
32 | |
33 | |
34 | |
35 | pub source: , |
36 | pub object: String, |
37 | pub operation: String, |
38 | pub payload: , |
39 | |
40 | |
41 | |
42 | |
43 | GiteratedMessage |
44 | object: NetworkAnyObject, |
45 | operation: self.operation, |
46 | payload: NetworkAnyOperation, |
47 | |
48 | |
49 | |
50 | |
51 | |
52 | ; |
53 | |
54 | |
55 | |
56 | ; |
57 | |
58 | |
59 | |
60 | |
61 | A: AuthenticationSourceProvider, |
62 | |
63 | |
64 | vec! |
65 | |
66 | |
67 | |
68 | |
69 | |
70 | A: AuthenticationSourceProvider, |
71 | B: AuthenticationSourceProvider, |
72 | |
73 | |
74 | let = self; |
75 | |
76 | vec! |
77 | |
78 | |
79 | |
80 | |
81 | |
82 | Self |
83 | source: vec!, |
84 | message, |
85 | |
86 | |
87 | |
88 | |
89 | &mut self, |
90 | authentication: , |
91 | |
92 | self.source.push; |
93 | |
94 | |
95 | |
96 | let payload = to_vec .unwrap; |
97 | |
98 | AuthenticatedPayload |
99 | object: self.message.object.to_string, |
100 | operation: self.message.operation, |
101 | source: self |
102 | .source |
103 | .drain |
104 | .map |
105 | .flatten |
106 | ., |
107 | payload, |
108 | |
109 | |
110 | |
111 | |
112 | |
113 | |
114 | |
115 | |
116 | pub user: User, |
117 | pub token: UserAuthenticationToken, |
118 | |
119 | |
120 | |
121 | |
122 | User |
123 | user: self.user.clone, |
124 | token: self.token.clone, |
125 | |
126 | |
127 | |
128 | |
129 | |
130 | |
131 | pub instance: Instance, |
132 | pub private_key: String, |
133 | |
134 | |
135 | |
136 | |
137 | let mut rng = thread_rng; |
138 | |
139 | let private_key = from_pkcs1_pem .unwrap; |
140 | let signing_key = new; |
141 | let signature = signing_key.sign_with_rng; |
142 | |
143 | Instance |
144 | instance: self.instance.clone, |
145 | // TODO: Actually parse signature from private key |
146 | signature: InstanceSignature, |
147 | |
148 | |
149 | |
150 | |
151 | |
152 | |
153 | ; |
154 | |
155 | |
156 | |
157 | Self |
158 | |
159 | |
160 | |
161 | |
162 | |
163 | self.0.clone |
164 | |
165 | |
166 | |
167 | |
168 | |
169 | &self.0 |
170 | |
171 | |
172 | |
173 | |
174 | ; |
175 | |
176 | |
177 | |
178 | &self.0 |
179 | |
180 | |
181 | |
182 | |
183 | |
184 | User |
185 | user: User, |
186 | token: UserAuthenticationToken, |
187 | , |
188 | Instance |
189 | instance: Instance, |
190 | signature: InstanceSignature, |
191 | , |
192 | |
193 |