Completely refactor project structure
parent: tbd commit: ae8ff44
1 | use type_name; |
2 | |
3 | use |
4 | , | DecodeRsaPrivateKey
5 | , | SigningKey
6 | , | Sha256
7 | , |
8 | RsaPrivateKey, |
9 | ; |
10 | use ; |
11 | |
12 | use ; |
13 | |
14 | |
15 | |
16 | pub user: User, |
17 | pub generated_for: Instance, |
18 | pub exp: u64, |
19 | |
20 | |
21 | |
22 | |
23 | pub target_instance: , |
24 | pub source: , |
25 | pub message_type: String, |
26 | #[serde(flatten)] |
27 | pub message: T, |
28 | |
29 | |
30 | |
31 | ; |
32 | |
33 | |
34 | |
35 | ; |
36 | |
37 | |
38 | |
39 | |
40 | A: AuthenticationSourceProvider, |
41 | |
42 | |
43 | vec! |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | A: AuthenticationSourceProvider, |
50 | B: AuthenticationSourceProvider, |
51 | |
52 | |
53 | let = self; |
54 | |
55 | vec! |
56 | |
57 | |
58 | |
59 | |
60 | |
61 | let message_payload = to_vec .unwrap; |
62 | |
63 | let authentication = auth_sources.authenticate_all; |
64 | |
65 | Self |
66 | source: authentication, |
67 | message_type: .to_string, |
68 | message, |
69 | target_instance: None, |
70 | |
71 | |
72 | |
73 | |
74 | instance: impl , |
75 | message: T, |
76 | auth_sources: impl AuthenticationSourceProvider, |
77 | |
78 | let message_payload = to_vec .unwrap; |
79 | |
80 | let authentication = auth_sources.authenticate_all; |
81 | |
82 | Self |
83 | source: authentication, |
84 | message_type: .to_string, |
85 | message, |
86 | target_instance: Some, |
87 | |
88 | |
89 | |
90 | |
91 | Self |
92 | source: vec!, |
93 | message_type: .to_string, |
94 | message, |
95 | target_instance: None, |
96 | |
97 | |
98 | |
99 | |
100 | let message_payload = to_vec .unwrap; |
101 | |
102 | self.source |
103 | .push; |
104 | |
105 | |
106 | |
107 | |
108 | |
109 | |
110 | |
111 | pub user: User, |
112 | pub token: UserAuthenticationToken, |
113 | |
114 | |
115 | |
116 | |
117 | User |
118 | user: self.user, |
119 | token: self.token, |
120 | |
121 | |
122 | |
123 | |
124 | |
125 | |
126 | pub instance: Instance, |
127 | pub private_key: &'a str, |
128 | |
129 | |
130 | |
131 | |
132 | let mut rng = thread_rng; |
133 | |
134 | let private_key = from_pkcs1_pem .unwrap; |
135 | let signing_key = new; |
136 | let signature = signing_key.sign_with_rng; |
137 | |
138 | Instance |
139 | instance: self.instance, |
140 | // TODO: Actually parse signature from private key |
141 | signature: InstanceSignature, |
142 | |
143 | |
144 | |
145 | |
146 | |
147 | |
148 | ; |
149 | |
150 | |
151 | |
152 | Self |
153 | |
154 | |
155 | |
156 | |
157 | |
158 | self.0.clone |
159 | |
160 | |
161 | |
162 | |
163 | |
164 | &self.0 |
165 | |
166 | |
167 | |
168 | |
169 | ; |
170 | |
171 | |
172 | |
173 | &self.0 |
174 | |
175 | |
176 | |
177 | |
178 | |
179 | User |
180 | user: User, |
181 | token: UserAuthenticationToken, |
182 | , |
183 | Instance |
184 | instance: Instance, |
185 | signature: InstanceSignature, |
186 | , |
187 | |
188 |