aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/Cargo.lock2241
-rw-r--r--backend/Cargo.toml29
-rw-r--r--backend/diesel.toml5
-rw-r--r--backend/migrations/.gitkeep0
-rw-r--r--backend/migrations/2020-09-22-104623_create_users/down.sql3
-rw-r--r--backend/migrations/2020-09-22-104623_create_users/up.sql8
-rw-r--r--backend/migrations/2020-11-16-133516_create_products_table/down.sql3
-rw-r--r--backend/migrations/2020-11-16-133516_create_products_table/up.sql8
-rw-r--r--backend/migrations/2020-12-13-140215_all_tables/down.sql11
-rw-r--r--backend/migrations/2020-12-13-140215_all_tables/up.sql47
-rw-r--r--backend/rustfmt.toml15
-rw-r--r--backend/src/bin/server.rs94
-rw-r--r--backend/src/handlers/cart_items.rs107
-rw-r--r--backend/src/handlers/mod.rs5
-rw-r--r--backend/src/handlers/product.rs138
-rw-r--r--backend/src/handlers/rating.rs91
-rw-r--r--backend/src/handlers/smoke.rs15
-rw-r--r--backend/src/handlers/users.rs148
-rw-r--r--backend/src/lib.rs10
-rw-r--r--backend/src/models.rs97
-rw-r--r--backend/src/schema.rs61
-rw-r--r--backend/tests/product/chair.json6
-rw-r--r--backend/tests/product/dumb_sofa.json4
-rw-r--r--backend/tests/product/smart_sofa.json6
-rw-r--r--backend/tests/requests.txt21
-rw-r--r--backend/tests/users/add_akshay.json8
-rw-r--r--backend/tests/users/add_user.json7
27 files changed, 3188 insertions, 0 deletions
diff --git a/backend/Cargo.lock b/backend/Cargo.lock
new file mode 100644
index 0000000..2f6aaaa
--- /dev/null
+++ b/backend/Cargo.lock
@@ -0,0 +1,2241 @@
1# This file is automatically @generated by Cargo.
2# It is not intended for manual editing.
3[[package]]
4name = "actix-codec"
5version = "0.3.0"
6source = "registry+https://github.com/rust-lang/crates.io-index"
7checksum = "78d1833b3838dbe990df0f1f87baf640cf6146e898166afe401839d1b001e570"
8dependencies = [
9 "bitflags",
10 "bytes",
11 "futures-core",
12 "futures-sink",
13 "log",
14 "pin-project 0.4.23",
15 "tokio",
16 "tokio-util",
17]
18
19[[package]]
20name = "actix-connect"
21version = "2.0.0"
22source = "registry+https://github.com/rust-lang/crates.io-index"
23checksum = "177837a10863f15ba8d3ae3ec12fac1099099529ed20083a27fdfe247381d0dc"
24dependencies = [
25 "actix-codec",
26 "actix-rt",
27 "actix-service",
28 "actix-utils",
29 "derive_more",
30 "either",
31 "futures-util",
32 "http",
33 "log",
34 "trust-dns-proto",
35 "trust-dns-resolver",
36]
37
38[[package]]
39name = "actix-cors"
40version = "0.5.3"
41source = "registry+https://github.com/rust-lang/crates.io-index"
42checksum = "3f3a3d5493dbc9b8769fe88c030d057ef8d2edc5728e5e26267780e8fc5db0be"
43dependencies = [
44 "actix-web",
45 "derive_more",
46 "futures-util",
47 "log",
48 "once_cell",
49 "tinyvec 1.1.0",
50]
51
52[[package]]
53name = "actix-http"
54version = "2.0.0"
55source = "registry+https://github.com/rust-lang/crates.io-index"
56checksum = "05dd80ba8f27c4a34357c07e338c8f5c38f8520e6d626ca1727d8fecc41b0cab"
57dependencies = [
58 "actix-codec",
59 "actix-connect",
60 "actix-rt",
61 "actix-service",
62 "actix-threadpool",
63 "actix-utils",
64 "base64",
65 "bitflags",
66 "brotli2",
67 "bytes",
68 "cookie",
69 "copyless",
70 "derive_more",
71 "either",
72 "encoding_rs",
73 "flate2",
74 "futures-channel",
75 "futures-core",
76 "futures-util",
77 "fxhash",
78 "h2",
79 "http",
80 "httparse",
81 "indexmap",
82 "itoa",
83 "language-tags",
84 "lazy_static",
85 "log",
86 "mime",
87 "percent-encoding 2.1.0",
88 "pin-project 0.4.23",
89 "rand",
90 "regex",
91 "serde",
92 "serde_json",
93 "serde_urlencoded",
94 "sha-1",
95 "slab",
96 "time 0.2.21",
97]
98
99[[package]]
100name = "actix-identity"
101version = "0.3.1"
102source = "registry+https://github.com/rust-lang/crates.io-index"
103checksum = "3263fe74cf505c6f9e18209c89fbdba5569cfd3905a7e907b42aa1c85c18fae5"
104dependencies = [
105 "actix-service",
106 "actix-web",
107 "futures-util",
108 "serde",
109 "serde_json",
110 "time 0.2.21",
111]
112
113[[package]]
114name = "actix-macros"
115version = "0.1.2"
116source = "registry+https://github.com/rust-lang/crates.io-index"
117checksum = "a60f9ba7c4e6df97f3aacb14bb5c0cd7d98a49dcbaed0d7f292912ad9a6a3ed2"
118dependencies = [
119 "quote",
120 "syn",
121]
122
123[[package]]
124name = "actix-router"
125version = "0.2.5"
126source = "registry+https://github.com/rust-lang/crates.io-index"
127checksum = "bbd1f7dbda1645bf7da33554db60891755f6c01c1b2169e2f4c492098d30c235"
128dependencies = [
129 "bytestring",
130 "http",
131 "log",
132 "regex",
133 "serde",
134]
135
136[[package]]
137name = "actix-rt"
138version = "1.1.1"
139source = "registry+https://github.com/rust-lang/crates.io-index"
140checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227"
141dependencies = [
142 "actix-macros",
143 "actix-threadpool",
144 "copyless",
145 "futures-channel",
146 "futures-util",
147 "smallvec",
148 "tokio",
149]
150
151[[package]]
152name = "actix-server"
153version = "1.0.4"
154source = "registry+https://github.com/rust-lang/crates.io-index"
155checksum = "45407e6e672ca24784baa667c5d32ef109ccdd8d5e0b5ebb9ef8a67f4dfb708e"
156dependencies = [
157 "actix-codec",
158 "actix-rt",
159 "actix-service",
160 "actix-utils",
161 "futures-channel",
162 "futures-util",
163 "log",
164 "mio",
165 "mio-uds",
166 "num_cpus",
167 "slab",
168 "socket2",
169]
170
171[[package]]
172name = "actix-service"
173version = "1.0.6"
174source = "registry+https://github.com/rust-lang/crates.io-index"
175checksum = "0052435d581b5be835d11f4eb3bce417c8af18d87ddf8ace99f8e67e595882bb"
176dependencies = [
177 "futures-util",
178 "pin-project 0.4.23",
179]
180
181[[package]]
182name = "actix-testing"
183version = "1.0.1"
184source = "registry+https://github.com/rust-lang/crates.io-index"
185checksum = "47239ca38799ab74ee6a8a94d1ce857014b2ac36f242f70f3f75a66f691e791c"
186dependencies = [
187 "actix-macros",
188 "actix-rt",
189 "actix-server",
190 "actix-service",
191 "log",
192 "socket2",
193]
194
195[[package]]
196name = "actix-threadpool"
197version = "0.3.3"
198source = "registry+https://github.com/rust-lang/crates.io-index"
199checksum = "d209f04d002854b9afd3743032a27b066158817965bf5d036824d19ac2cc0e30"
200dependencies = [
201 "derive_more",
202 "futures-channel",
203 "lazy_static",
204 "log",
205 "num_cpus",
206 "parking_lot",
207 "threadpool",
208]
209
210[[package]]
211name = "actix-tls"
212version = "2.0.0"
213source = "registry+https://github.com/rust-lang/crates.io-index"
214checksum = "24789b7d7361cf5503a504ebe1c10806896f61e96eca9a7350e23001aca715fb"
215dependencies = [
216 "actix-codec",
217 "actix-service",
218 "actix-utils",
219 "futures-util",
220]
221
222[[package]]
223name = "actix-utils"
224version = "2.0.0"
225source = "registry+https://github.com/rust-lang/crates.io-index"
226checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a"
227dependencies = [
228 "actix-codec",
229 "actix-rt",
230 "actix-service",
231 "bitflags",
232 "bytes",
233 "either",
234 "futures-channel",
235 "futures-sink",
236 "futures-util",
237 "log",
238 "pin-project 0.4.23",
239 "slab",
240]
241
242[[package]]
243name = "actix-web"
244version = "3.0.2"
245source = "registry+https://github.com/rust-lang/crates.io-index"
246checksum = "36de80175eb1f0a5c518024ce0d23646b54a23008279e090ca1848f6f1448bf4"
247dependencies = [
248 "actix-codec",
249 "actix-http",
250 "actix-macros",
251 "actix-router",
252 "actix-rt",
253 "actix-server",
254 "actix-service",
255 "actix-testing",
256 "actix-threadpool",
257 "actix-tls",
258 "actix-utils",
259 "actix-web-codegen",
260 "awc",
261 "bytes",
262 "derive_more",
263 "encoding_rs",
264 "futures-channel",
265 "futures-core",
266 "futures-util",
267 "fxhash",
268 "log",
269 "mime",
270 "pin-project 0.4.23",
271 "regex",
272 "serde",
273 "serde_json",
274 "serde_urlencoded",
275 "socket2",
276 "time 0.2.21",
277 "tinyvec 0.3.4",
278 "url 2.1.1",
279]
280
281[[package]]
282name = "actix-web-codegen"
283version = "0.3.0"
284source = "registry+https://github.com/rust-lang/crates.io-index"
285checksum = "750ca8fb60bbdc79491991650ba5d2ae7cd75f3fc00ead51390cfe9efda0d4d8"
286dependencies = [
287 "proc-macro2",
288 "quote",
289 "syn",
290]
291
292[[package]]
293name = "addr2line"
294version = "0.13.0"
295source = "registry+https://github.com/rust-lang/crates.io-index"
296checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072"
297dependencies = [
298 "gimli",
299]
300
301[[package]]
302name = "adler"
303version = "0.2.3"
304source = "registry+https://github.com/rust-lang/crates.io-index"
305checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
306
307[[package]]
308name = "aead"
309version = "0.3.2"
310source = "registry+https://github.com/rust-lang/crates.io-index"
311checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331"
312dependencies = [
313 "generic-array",
314]
315
316[[package]]
317name = "aes"
318version = "0.4.0"
319source = "registry+https://github.com/rust-lang/crates.io-index"
320checksum = "f7001367fde4c768a19d1029f0a8be5abd9308e1119846d5bd9ad26297b8faf5"
321dependencies = [
322 "aes-soft",
323 "aesni",
324 "block-cipher 0.7.1",
325]
326
327[[package]]
328name = "aes-gcm"
329version = "0.6.0"
330source = "registry+https://github.com/rust-lang/crates.io-index"
331checksum = "86f5007801316299f922a6198d1d09a0bae95786815d066d5880d13f7c45ead1"
332dependencies = [
333 "aead",
334 "aes",
335 "block-cipher 0.7.1",
336 "ghash",
337 "subtle",
338]
339
340[[package]]
341name = "aes-soft"
342version = "0.4.0"
343source = "registry+https://github.com/rust-lang/crates.io-index"
344checksum = "4925647ee64e5056cf231608957ce7c81e12d6d6e316b9ce1404778cc1d35fa7"
345dependencies = [
346 "block-cipher 0.7.1",
347 "byteorder",
348 "opaque-debug 0.2.3",
349]
350
351[[package]]
352name = "aesni"
353version = "0.7.0"
354source = "registry+https://github.com/rust-lang/crates.io-index"
355checksum = "d050d39b0b7688b3a3254394c3e30a9d66c41dcf9b05b0e2dbdc623f6505d264"
356dependencies = [
357 "block-cipher 0.7.1",
358 "opaque-debug 0.2.3",
359]
360
361[[package]]
362name = "aho-corasick"
363version = "0.7.13"
364source = "registry+https://github.com/rust-lang/crates.io-index"
365checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
366dependencies = [
367 "memchr",
368]
369
370[[package]]
371name = "arc-swap"
372version = "0.4.7"
373source = "registry+https://github.com/rust-lang/crates.io-index"
374checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
375
376[[package]]
377name = "async-trait"
378version = "0.1.40"
379source = "registry+https://github.com/rust-lang/crates.io-index"
380checksum = "687c230d85c0a52504709705fc8a53e4a692b83a2184f03dae73e38e1e93a783"
381dependencies = [
382 "proc-macro2",
383 "quote",
384 "syn",
385]
386
387[[package]]
388name = "atty"
389version = "0.2.14"
390source = "registry+https://github.com/rust-lang/crates.io-index"
391checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
392dependencies = [
393 "hermit-abi",
394 "libc",
395 "winapi 0.3.9",
396]
397
398[[package]]
399name = "autocfg"
400version = "1.0.1"
401source = "registry+https://github.com/rust-lang/crates.io-index"
402checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
403
404[[package]]
405name = "awc"
406version = "2.0.0"
407source = "registry+https://github.com/rust-lang/crates.io-index"
408checksum = "150e00c06683ab44c5f97d033950e5d87a7a042d06d77f5eecb443cbd23d0575"
409dependencies = [
410 "actix-codec",
411 "actix-http",
412 "actix-rt",
413 "actix-service",
414 "base64",
415 "bytes",
416 "derive_more",
417 "futures-core",
418 "log",
419 "mime",
420 "percent-encoding 2.1.0",
421 "rand",
422 "serde",
423 "serde_json",
424 "serde_urlencoded",
425]
426
427[[package]]
428name = "backtrace"
429version = "0.3.50"
430source = "registry+https://github.com/rust-lang/crates.io-index"
431checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293"
432dependencies = [
433 "addr2line",
434 "cfg-if",
435 "libc",
436 "miniz_oxide",
437 "object",
438 "rustc-demangle",
439]
440
441[[package]]
442name = "base-x"
443version = "0.2.6"
444source = "registry+https://github.com/rust-lang/crates.io-index"
445checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1"
446
447[[package]]
448name = "base64"
449version = "0.12.3"
450source = "registry+https://github.com/rust-lang/crates.io-index"
451checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
452
453[[package]]
454name = "bcrypt"
455version = "0.8.2"
456source = "registry+https://github.com/rust-lang/crates.io-index"
457checksum = "e2cab630912253fb9dc92c0e2fabd0a7b51f5a5a4007177cfa31e517015b7204"
458dependencies = [
459 "base64",
460 "blowfish",
461 "byteorder",
462 "getrandom",
463]
464
465[[package]]
466name = "bigdecimal"
467version = "0.0.14"
468source = "registry+https://github.com/rust-lang/crates.io-index"
469checksum = "679e21a6734fdfc63378aea80c2bf31e6ac8ced21ed33e1ee37f8f7bf33c2056"
470dependencies = [
471 "num-bigint",
472 "num-integer",
473 "num-traits",
474]
475
476[[package]]
477name = "bigdecimal"
478version = "0.1.2"
479source = "registry+https://github.com/rust-lang/crates.io-index"
480checksum = "1374191e2dd25f9ae02e3aa95041ed5d747fc77b3c102b49fe2dd9a8117a6244"
481dependencies = [
482 "num-bigint",
483 "num-integer",
484 "num-traits",
485]
486
487[[package]]
488name = "bitflags"
489version = "1.2.1"
490source = "registry+https://github.com/rust-lang/crates.io-index"
491checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
492
493[[package]]
494name = "block-buffer"
495version = "0.9.0"
496source = "registry+https://github.com/rust-lang/crates.io-index"
497checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
498dependencies = [
499 "generic-array",
500]
501
502[[package]]
503name = "block-cipher"
504version = "0.7.1"
505source = "registry+https://github.com/rust-lang/crates.io-index"
506checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10"
507dependencies = [
508 "generic-array",
509]
510
511[[package]]
512name = "block-cipher"
513version = "0.8.0"
514source = "registry+https://github.com/rust-lang/crates.io-index"
515checksum = "f337a3e6da609650eb74e02bc9fac7b735049f7623ab12f2e4c719316fcc7e80"
516dependencies = [
517 "generic-array",
518]
519
520[[package]]
521name = "blowfish"
522version = "0.6.0"
523source = "registry+https://github.com/rust-lang/crates.io-index"
524checksum = "0f06850ba969bc59388b2cc0a4f186fc6d9d37208863b15b84ae3866ac90ac06"
525dependencies = [
526 "block-cipher 0.8.0",
527 "byteorder",
528 "opaque-debug 0.3.0",
529]
530
531[[package]]
532name = "brotli-sys"
533version = "0.3.2"
534source = "registry+https://github.com/rust-lang/crates.io-index"
535checksum = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd"
536dependencies = [
537 "cc",
538 "libc",
539]
540
541[[package]]
542name = "brotli2"
543version = "0.3.2"
544source = "registry+https://github.com/rust-lang/crates.io-index"
545checksum = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e"
546dependencies = [
547 "brotli-sys",
548 "libc",
549]
550
551[[package]]
552name = "bumpalo"
553version = "3.4.0"
554source = "registry+https://github.com/rust-lang/crates.io-index"
555checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820"
556
557[[package]]
558name = "byteorder"
559version = "1.3.4"
560source = "registry+https://github.com/rust-lang/crates.io-index"
561checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
562
563[[package]]
564name = "bytes"
565version = "0.5.6"
566source = "registry+https://github.com/rust-lang/crates.io-index"
567checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
568
569[[package]]
570name = "bytestring"
571version = "0.1.5"
572source = "registry+https://github.com/rust-lang/crates.io-index"
573checksum = "fc7c05fa5172da78a62d9949d662d2ac89d4cc7355d7b49adee5163f1fb3f363"
574dependencies = [
575 "bytes",
576]
577
578[[package]]
579name = "cc"
580version = "1.0.60"
581source = "registry+https://github.com/rust-lang/crates.io-index"
582checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c"
583
584[[package]]
585name = "cfg-if"
586version = "0.1.10"
587source = "registry+https://github.com/rust-lang/crates.io-index"
588checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
589
590[[package]]
591name = "chrono"
592version = "0.4.19"
593source = "registry+https://github.com/rust-lang/crates.io-index"
594checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
595dependencies = [
596 "libc",
597 "num-integer",
598 "num-traits",
599 "serde",
600 "time 0.1.44",
601 "winapi 0.3.9",
602]
603
604[[package]]
605name = "cloudabi"
606version = "0.1.0"
607source = "registry+https://github.com/rust-lang/crates.io-index"
608checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
609dependencies = [
610 "bitflags",
611]
612
613[[package]]
614name = "const_fn"
615version = "0.4.2"
616source = "registry+https://github.com/rust-lang/crates.io-index"
617checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2"
618
619[[package]]
620name = "cookie"
621version = "0.14.2"
622source = "registry+https://github.com/rust-lang/crates.io-index"
623checksum = "1373a16a4937bc34efec7b391f9c1500c30b8478a701a4f44c9165cc0475a6e0"
624dependencies = [
625 "aes-gcm",
626 "base64",
627 "hkdf",
628 "hmac",
629 "percent-encoding 2.1.0",
630 "rand",
631 "sha2",
632 "time 0.2.21",
633 "version_check",
634]
635
636[[package]]
637name = "copyless"
638version = "0.1.5"
639source = "registry+https://github.com/rust-lang/crates.io-index"
640checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536"
641
642[[package]]
643name = "cpuid-bool"
644version = "0.1.2"
645source = "registry+https://github.com/rust-lang/crates.io-index"
646checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
647
648[[package]]
649name = "crc32fast"
650version = "1.2.0"
651source = "registry+https://github.com/rust-lang/crates.io-index"
652checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
653dependencies = [
654 "cfg-if",
655]
656
657[[package]]
658name = "crypto-mac"
659version = "0.8.0"
660source = "registry+https://github.com/rust-lang/crates.io-index"
661checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab"
662dependencies = [
663 "generic-array",
664 "subtle",
665]
666
667[[package]]
668name = "derive_more"
669version = "0.99.10"
670source = "registry+https://github.com/rust-lang/crates.io-index"
671checksum = "1dcfabdab475c16a93d669dddfc393027803e347d09663f524447f642fbb84ba"
672dependencies = [
673 "proc-macro2",
674 "quote",
675 "syn",
676]
677
678[[package]]
679name = "diesel"
680version = "1.4.5"
681source = "registry+https://github.com/rust-lang/crates.io-index"
682checksum = "3e2de9deab977a153492a1468d1b1c0662c1cf39e5ea87d0c060ecd59ef18d8c"
683dependencies = [
684 "bigdecimal 0.1.2",
685 "byteorder",
686 "chrono",
687 "diesel_derives",
688 "mysqlclient-sys",
689 "num-bigint",
690 "num-integer",
691 "num-traits",
692 "r2d2",
693 "url 1.7.2",
694]
695
696[[package]]
697name = "diesel_derives"
698version = "1.4.1"
699source = "registry+https://github.com/rust-lang/crates.io-index"
700checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3"
701dependencies = [
702 "proc-macro2",
703 "quote",
704 "syn",
705]
706
707[[package]]
708name = "digest"
709version = "0.9.0"
710source = "registry+https://github.com/rust-lang/crates.io-index"
711checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
712dependencies = [
713 "generic-array",
714]
715
716[[package]]
717name = "discard"
718version = "1.0.4"
719source = "registry+https://github.com/rust-lang/crates.io-index"
720checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0"
721
722[[package]]
723name = "dtoa"
724version = "0.4.6"
725source = "registry+https://github.com/rust-lang/crates.io-index"
726checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b"
727
728[[package]]
729name = "either"
730version = "1.6.1"
731source = "registry+https://github.com/rust-lang/crates.io-index"
732checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
733
734[[package]]
735name = "encoding_rs"
736version = "0.8.24"
737source = "registry+https://github.com/rust-lang/crates.io-index"
738checksum = "a51b8cf747471cb9499b6d59e59b0444f4c90eba8968c4e44874e92b5b64ace2"
739dependencies = [
740 "cfg-if",
741]
742
743[[package]]
744name = "enum-as-inner"
745version = "0.3.3"
746source = "registry+https://github.com/rust-lang/crates.io-index"
747checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595"
748dependencies = [
749 "heck",
750 "proc-macro2",
751 "quote",
752 "syn",
753]
754
755[[package]]
756name = "env_logger"
757version = "0.7.1"
758source = "registry+https://github.com/rust-lang/crates.io-index"
759checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
760dependencies = [
761 "atty",
762 "humantime",
763 "log",
764 "regex",
765 "termcolor",
766]
767
768[[package]]
769name = "flate2"
770version = "1.0.17"
771source = "registry+https://github.com/rust-lang/crates.io-index"
772checksum = "766d0e77a2c1502169d4a93ff3b8c15a71fd946cd0126309752104e5f3c46d94"
773dependencies = [
774 "cfg-if",
775 "crc32fast",
776 "libc",
777 "miniz_oxide",
778]
779
780[[package]]
781name = "fnv"
782version = "1.0.7"
783source = "registry+https://github.com/rust-lang/crates.io-index"
784checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
785
786[[package]]
787name = "fuchsia-zircon"
788version = "0.3.3"
789source = "registry+https://github.com/rust-lang/crates.io-index"
790checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
791dependencies = [
792 "bitflags",
793 "fuchsia-zircon-sys",
794]
795
796[[package]]
797name = "fuchsia-zircon-sys"
798version = "0.3.3"
799source = "registry+https://github.com/rust-lang/crates.io-index"
800checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
801
802[[package]]
803name = "furby"
804version = "0.1.0"
805dependencies = [
806 "actix-cors",
807 "actix-identity",
808 "actix-web",
809 "bcrypt",
810 "bigdecimal 0.0.14",
811 "chrono",
812 "diesel",
813 "log",
814 "pretty_env_logger",
815 "rand",
816 "serde",
817 "serde_derive",
818 "serde_json",
819]
820
821[[package]]
822name = "futures"
823version = "0.3.5"
824source = "registry+https://github.com/rust-lang/crates.io-index"
825checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
826dependencies = [
827 "futures-channel",
828 "futures-core",
829 "futures-io",
830 "futures-sink",
831 "futures-task",
832 "futures-util",
833]
834
835[[package]]
836name = "futures-channel"
837version = "0.3.8"
838source = "registry+https://github.com/rust-lang/crates.io-index"
839checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64"
840dependencies = [
841 "futures-core",
842 "futures-sink",
843]
844
845[[package]]
846name = "futures-core"
847version = "0.3.8"
848source = "registry+https://github.com/rust-lang/crates.io-index"
849checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748"
850
851[[package]]
852name = "futures-io"
853version = "0.3.8"
854source = "registry+https://github.com/rust-lang/crates.io-index"
855checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb"
856
857[[package]]
858name = "futures-macro"
859version = "0.3.8"
860source = "registry+https://github.com/rust-lang/crates.io-index"
861checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556"
862dependencies = [
863 "proc-macro-hack",
864 "proc-macro2",
865 "quote",
866 "syn",
867]
868
869[[package]]
870name = "futures-sink"
871version = "0.3.8"
872source = "registry+https://github.com/rust-lang/crates.io-index"
873checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d"
874
875[[package]]
876name = "futures-task"
877version = "0.3.8"
878source = "registry+https://github.com/rust-lang/crates.io-index"
879checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d"
880dependencies = [
881 "once_cell",
882]
883
884[[package]]
885name = "futures-util"
886version = "0.3.8"
887source = "registry+https://github.com/rust-lang/crates.io-index"
888checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2"
889dependencies = [
890 "futures-channel",
891 "futures-core",
892 "futures-io",
893 "futures-macro",
894 "futures-sink",
895 "futures-task",
896 "memchr",
897 "pin-project 1.0.2",
898 "pin-utils",
899 "proc-macro-hack",
900 "proc-macro-nested",
901 "slab",
902]
903
904[[package]]
905name = "fxhash"
906version = "0.2.1"
907source = "registry+https://github.com/rust-lang/crates.io-index"
908checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
909dependencies = [
910 "byteorder",
911]
912
913[[package]]
914name = "generic-array"
915version = "0.14.4"
916source = "registry+https://github.com/rust-lang/crates.io-index"
917checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
918dependencies = [
919 "typenum",
920 "version_check",
921]
922
923[[package]]
924name = "getrandom"
925version = "0.1.15"
926source = "registry+https://github.com/rust-lang/crates.io-index"
927checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
928dependencies = [
929 "cfg-if",
930 "libc",
931 "wasi 0.9.0+wasi-snapshot-preview1",
932]
933
934[[package]]
935name = "ghash"
936version = "0.3.0"
937source = "registry+https://github.com/rust-lang/crates.io-index"
938checksum = "d6e27f0689a6e15944bdce7e45425efb87eaa8ab0c6e87f11d0987a9133e2531"
939dependencies = [
940 "polyval",
941]
942
943[[package]]
944name = "gimli"
945version = "0.22.0"
946source = "registry+https://github.com/rust-lang/crates.io-index"
947checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724"
948
949[[package]]
950name = "h2"
951version = "0.2.6"
952source = "registry+https://github.com/rust-lang/crates.io-index"
953checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53"
954dependencies = [
955 "bytes",
956 "fnv",
957 "futures-core",
958 "futures-sink",
959 "futures-util",
960 "http",
961 "indexmap",
962 "slab",
963 "tokio",
964 "tokio-util",
965 "tracing",
966]
967
968[[package]]
969name = "hashbrown"
970version = "0.9.0"
971source = "registry+https://github.com/rust-lang/crates.io-index"
972checksum = "00d63df3d41950fb462ed38308eea019113ad1508da725bbedcd0fa5a85ef5f7"
973
974[[package]]
975name = "heck"
976version = "0.3.1"
977source = "registry+https://github.com/rust-lang/crates.io-index"
978checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
979dependencies = [
980 "unicode-segmentation",
981]
982
983[[package]]
984name = "hermit-abi"
985version = "0.1.16"
986source = "registry+https://github.com/rust-lang/crates.io-index"
987checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151"
988dependencies = [
989 "libc",
990]
991
992[[package]]
993name = "hkdf"
994version = "0.9.0"
995source = "registry+https://github.com/rust-lang/crates.io-index"
996checksum = "fe1149865383e4526a43aee8495f9a325f0b806c63ce6427d06336a590abbbc9"
997dependencies = [
998 "digest",
999 "hmac",
1000]
1001
1002[[package]]
1003name = "hmac"
1004version = "0.8.1"
1005source = "registry+https://github.com/rust-lang/crates.io-index"
1006checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840"
1007dependencies = [
1008 "crypto-mac",
1009 "digest",
1010]
1011
1012[[package]]
1013name = "hostname"
1014version = "0.3.1"
1015source = "registry+https://github.com/rust-lang/crates.io-index"
1016checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867"
1017dependencies = [
1018 "libc",
1019 "match_cfg",
1020 "winapi 0.3.9",
1021]
1022
1023[[package]]
1024name = "http"
1025version = "0.2.1"
1026source = "registry+https://github.com/rust-lang/crates.io-index"
1027checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9"
1028dependencies = [
1029 "bytes",
1030 "fnv",
1031 "itoa",
1032]
1033
1034[[package]]
1035name = "httparse"
1036version = "1.3.4"
1037source = "registry+https://github.com/rust-lang/crates.io-index"
1038checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9"
1039
1040[[package]]
1041name = "humantime"
1042version = "1.3.0"
1043source = "registry+https://github.com/rust-lang/crates.io-index"
1044checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
1045dependencies = [
1046 "quick-error",
1047]
1048
1049[[package]]
1050name = "idna"
1051version = "0.1.5"
1052source = "registry+https://github.com/rust-lang/crates.io-index"
1053checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
1054dependencies = [
1055 "matches",
1056 "unicode-bidi",
1057 "unicode-normalization",
1058]
1059
1060[[package]]
1061name = "idna"
1062version = "0.2.0"
1063source = "registry+https://github.com/rust-lang/crates.io-index"
1064checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9"
1065dependencies = [
1066 "matches",
1067 "unicode-bidi",
1068 "unicode-normalization",
1069]
1070
1071[[package]]
1072name = "indexmap"
1073version = "1.6.0"
1074source = "registry+https://github.com/rust-lang/crates.io-index"
1075checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2"
1076dependencies = [
1077 "autocfg",
1078 "hashbrown",
1079]
1080
1081[[package]]
1082name = "instant"
1083version = "0.1.7"
1084source = "registry+https://github.com/rust-lang/crates.io-index"
1085checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66"
1086dependencies = [
1087 "cfg-if",
1088]
1089
1090[[package]]
1091name = "iovec"
1092version = "0.1.4"
1093source = "registry+https://github.com/rust-lang/crates.io-index"
1094checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
1095dependencies = [
1096 "libc",
1097]
1098
1099[[package]]
1100name = "ipconfig"
1101version = "0.2.2"
1102source = "registry+https://github.com/rust-lang/crates.io-index"
1103checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7"
1104dependencies = [
1105 "socket2",
1106 "widestring",
1107 "winapi 0.3.9",
1108 "winreg",
1109]
1110
1111[[package]]
1112name = "itoa"
1113version = "0.4.6"
1114source = "registry+https://github.com/rust-lang/crates.io-index"
1115checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
1116
1117[[package]]
1118name = "kernel32-sys"
1119version = "0.2.2"
1120source = "registry+https://github.com/rust-lang/crates.io-index"
1121checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
1122dependencies = [
1123 "winapi 0.2.8",
1124 "winapi-build",
1125]
1126
1127[[package]]
1128name = "language-tags"
1129version = "0.2.2"
1130source = "registry+https://github.com/rust-lang/crates.io-index"
1131checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
1132
1133[[package]]
1134name = "lazy_static"
1135version = "1.4.0"
1136source = "registry+https://github.com/rust-lang/crates.io-index"
1137checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
1138
1139[[package]]
1140name = "libc"
1141version = "0.2.77"
1142source = "registry+https://github.com/rust-lang/crates.io-index"
1143checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
1144
1145[[package]]
1146name = "linked-hash-map"
1147version = "0.5.3"
1148source = "registry+https://github.com/rust-lang/crates.io-index"
1149checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a"
1150
1151[[package]]
1152name = "lock_api"
1153version = "0.4.1"
1154source = "registry+https://github.com/rust-lang/crates.io-index"
1155checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c"
1156dependencies = [
1157 "scopeguard",
1158]
1159
1160[[package]]
1161name = "log"
1162version = "0.4.11"
1163source = "registry+https://github.com/rust-lang/crates.io-index"
1164checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
1165dependencies = [
1166 "cfg-if",
1167]
1168
1169[[package]]
1170name = "lru-cache"
1171version = "0.1.2"
1172source = "registry+https://github.com/rust-lang/crates.io-index"
1173checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c"
1174dependencies = [
1175 "linked-hash-map",
1176]
1177
1178[[package]]
1179name = "match_cfg"
1180version = "0.1.0"
1181source = "registry+https://github.com/rust-lang/crates.io-index"
1182checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4"
1183
1184[[package]]
1185name = "matches"
1186version = "0.1.8"
1187source = "registry+https://github.com/rust-lang/crates.io-index"
1188checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
1189
1190[[package]]
1191name = "memchr"
1192version = "2.3.3"
1193source = "registry+https://github.com/rust-lang/crates.io-index"
1194checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
1195
1196[[package]]
1197name = "mime"
1198version = "0.3.16"
1199source = "registry+https://github.com/rust-lang/crates.io-index"
1200checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
1201
1202[[package]]
1203name = "miniz_oxide"
1204version = "0.4.2"
1205source = "registry+https://github.com/rust-lang/crates.io-index"
1206checksum = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9"
1207dependencies = [
1208 "adler",
1209 "autocfg",
1210]
1211
1212[[package]]
1213name = "mio"
1214version = "0.6.22"
1215source = "registry+https://github.com/rust-lang/crates.io-index"
1216checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430"
1217dependencies = [
1218 "cfg-if",
1219 "fuchsia-zircon",
1220 "fuchsia-zircon-sys",
1221 "iovec",
1222 "kernel32-sys",
1223 "libc",
1224 "log",
1225 "miow",
1226 "net2",
1227 "slab",
1228 "winapi 0.2.8",
1229]
1230
1231[[package]]
1232name = "mio-uds"
1233version = "0.6.8"
1234source = "registry+https://github.com/rust-lang/crates.io-index"
1235checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0"
1236dependencies = [
1237 "iovec",
1238 "libc",
1239 "mio",
1240]
1241
1242[[package]]
1243name = "miow"
1244version = "0.2.1"
1245source = "registry+https://github.com/rust-lang/crates.io-index"
1246checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
1247dependencies = [
1248 "kernel32-sys",
1249 "net2",
1250 "winapi 0.2.8",
1251 "ws2_32-sys",
1252]
1253
1254[[package]]
1255name = "mysqlclient-sys"
1256version = "0.2.4"
1257source = "registry+https://github.com/rust-lang/crates.io-index"
1258checksum = "7e9637d93448044078aaafea7419aed69d301b4a12bcc4aa0ae856eb169bef85"
1259dependencies = [
1260 "pkg-config",
1261 "vcpkg",
1262]
1263
1264[[package]]
1265name = "net2"
1266version = "0.2.35"
1267source = "registry+https://github.com/rust-lang/crates.io-index"
1268checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853"
1269dependencies = [
1270 "cfg-if",
1271 "libc",
1272 "winapi 0.3.9",
1273]
1274
1275[[package]]
1276name = "num-bigint"
1277version = "0.2.6"
1278source = "registry+https://github.com/rust-lang/crates.io-index"
1279checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304"
1280dependencies = [
1281 "autocfg",
1282 "num-integer",
1283 "num-traits",
1284]
1285
1286[[package]]
1287name = "num-integer"
1288version = "0.1.44"
1289source = "registry+https://github.com/rust-lang/crates.io-index"
1290checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
1291dependencies = [
1292 "autocfg",
1293 "num-traits",
1294]
1295
1296[[package]]
1297name = "num-traits"
1298version = "0.2.14"
1299source = "registry+https://github.com/rust-lang/crates.io-index"
1300checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
1301dependencies = [
1302 "autocfg",
1303]
1304
1305[[package]]
1306name = "num_cpus"
1307version = "1.13.0"
1308source = "registry+https://github.com/rust-lang/crates.io-index"
1309checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
1310dependencies = [
1311 "hermit-abi",
1312 "libc",
1313]
1314
1315[[package]]
1316name = "object"
1317version = "0.20.0"
1318source = "registry+https://github.com/rust-lang/crates.io-index"
1319checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
1320
1321[[package]]
1322name = "once_cell"
1323version = "1.4.1"
1324source = "registry+https://github.com/rust-lang/crates.io-index"
1325checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
1326
1327[[package]]
1328name = "opaque-debug"
1329version = "0.2.3"
1330source = "registry+https://github.com/rust-lang/crates.io-index"
1331checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
1332
1333[[package]]
1334name = "opaque-debug"
1335version = "0.3.0"
1336source = "registry+https://github.com/rust-lang/crates.io-index"
1337checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
1338
1339[[package]]
1340name = "parking_lot"
1341version = "0.11.0"
1342source = "registry+https://github.com/rust-lang/crates.io-index"
1343checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
1344dependencies = [
1345 "instant",
1346 "lock_api",
1347 "parking_lot_core",
1348]
1349
1350[[package]]
1351name = "parking_lot_core"
1352version = "0.8.0"
1353source = "registry+https://github.com/rust-lang/crates.io-index"
1354checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
1355dependencies = [
1356 "cfg-if",
1357 "cloudabi",
1358 "instant",
1359 "libc",
1360 "redox_syscall",
1361 "smallvec",
1362 "winapi 0.3.9",
1363]
1364
1365[[package]]
1366name = "percent-encoding"
1367version = "1.0.1"
1368source = "registry+https://github.com/rust-lang/crates.io-index"
1369checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
1370
1371[[package]]
1372name = "percent-encoding"
1373version = "2.1.0"
1374source = "registry+https://github.com/rust-lang/crates.io-index"
1375checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
1376
1377[[package]]
1378name = "pin-project"
1379version = "0.4.23"
1380source = "registry+https://github.com/rust-lang/crates.io-index"
1381checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa"
1382dependencies = [
1383 "pin-project-internal 0.4.23",
1384]
1385
1386[[package]]
1387name = "pin-project"
1388version = "1.0.2"
1389source = "registry+https://github.com/rust-lang/crates.io-index"
1390checksum = "9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7"
1391dependencies = [
1392 "pin-project-internal 1.0.2",
1393]
1394
1395[[package]]
1396name = "pin-project-internal"
1397version = "0.4.23"
1398source = "registry+https://github.com/rust-lang/crates.io-index"
1399checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f"
1400dependencies = [
1401 "proc-macro2",
1402 "quote",
1403 "syn",
1404]
1405
1406[[package]]
1407name = "pin-project-internal"
1408version = "1.0.2"
1409source = "registry+https://github.com/rust-lang/crates.io-index"
1410checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f"
1411dependencies = [
1412 "proc-macro2",
1413 "quote",
1414 "syn",
1415]
1416
1417[[package]]
1418name = "pin-project-lite"
1419version = "0.1.7"
1420source = "registry+https://github.com/rust-lang/crates.io-index"
1421checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715"
1422
1423[[package]]
1424name = "pin-utils"
1425version = "0.1.0"
1426source = "registry+https://github.com/rust-lang/crates.io-index"
1427checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1428
1429[[package]]
1430name = "pkg-config"
1431version = "0.3.18"
1432source = "registry+https://github.com/rust-lang/crates.io-index"
1433checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33"
1434
1435[[package]]
1436name = "polyval"
1437version = "0.4.0"
1438source = "registry+https://github.com/rust-lang/crates.io-index"
1439checksum = "d9a50142b55ab3ed0e9f68dfb3709f1d90d29da24e91033f28b96330643107dc"
1440dependencies = [
1441 "cfg-if",
1442 "universal-hash",
1443]
1444
1445[[package]]
1446name = "ppv-lite86"
1447version = "0.2.9"
1448source = "registry+https://github.com/rust-lang/crates.io-index"
1449checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
1450
1451[[package]]
1452name = "pretty_env_logger"
1453version = "0.4.0"
1454source = "registry+https://github.com/rust-lang/crates.io-index"
1455checksum = "926d36b9553851b8b0005f1275891b392ee4d2d833852c417ed025477350fb9d"
1456dependencies = [
1457 "env_logger",
1458 "log",
1459]
1460
1461[[package]]
1462name = "proc-macro-hack"
1463version = "0.5.19"
1464source = "registry+https://github.com/rust-lang/crates.io-index"
1465checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
1466
1467[[package]]
1468name = "proc-macro-nested"
1469version = "0.1.6"
1470source = "registry+https://github.com/rust-lang/crates.io-index"
1471checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a"
1472
1473[[package]]
1474name = "proc-macro2"
1475version = "1.0.24"
1476source = "registry+https://github.com/rust-lang/crates.io-index"
1477checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
1478dependencies = [
1479 "unicode-xid",
1480]
1481
1482[[package]]
1483name = "quick-error"
1484version = "1.2.3"
1485source = "registry+https://github.com/rust-lang/crates.io-index"
1486checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
1487
1488[[package]]
1489name = "quote"
1490version = "1.0.7"
1491source = "registry+https://github.com/rust-lang/crates.io-index"
1492checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
1493dependencies = [
1494 "proc-macro2",
1495]
1496
1497[[package]]
1498name = "r2d2"
1499version = "0.8.9"
1500source = "registry+https://github.com/rust-lang/crates.io-index"
1501checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f"
1502dependencies = [
1503 "log",
1504 "parking_lot",
1505 "scheduled-thread-pool",
1506]
1507
1508[[package]]
1509name = "rand"
1510version = "0.7.3"
1511source = "registry+https://github.com/rust-lang/crates.io-index"
1512checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
1513dependencies = [
1514 "getrandom",
1515 "libc",
1516 "rand_chacha",
1517 "rand_core",
1518 "rand_hc",
1519]
1520
1521[[package]]
1522name = "rand_chacha"
1523version = "0.2.2"
1524source = "registry+https://github.com/rust-lang/crates.io-index"
1525checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
1526dependencies = [
1527 "ppv-lite86",
1528 "rand_core",
1529]
1530
1531[[package]]
1532name = "rand_core"
1533version = "0.5.1"
1534source = "registry+https://github.com/rust-lang/crates.io-index"
1535checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
1536dependencies = [
1537 "getrandom",
1538]
1539
1540[[package]]
1541name = "rand_hc"
1542version = "0.2.0"
1543source = "registry+https://github.com/rust-lang/crates.io-index"
1544checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
1545dependencies = [
1546 "rand_core",
1547]
1548
1549[[package]]
1550name = "redox_syscall"
1551version = "0.1.57"
1552source = "registry+https://github.com/rust-lang/crates.io-index"
1553checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
1554
1555[[package]]
1556name = "regex"
1557version = "1.3.9"
1558source = "registry+https://github.com/rust-lang/crates.io-index"
1559checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6"
1560dependencies = [
1561 "aho-corasick",
1562 "memchr",
1563 "regex-syntax",
1564 "thread_local",
1565]
1566
1567[[package]]
1568name = "regex-syntax"
1569version = "0.6.18"
1570source = "registry+https://github.com/rust-lang/crates.io-index"
1571checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
1572
1573[[package]]
1574name = "resolv-conf"
1575version = "0.6.3"
1576source = "registry+https://github.com/rust-lang/crates.io-index"
1577checksum = "11834e137f3b14e309437a8276714eed3a80d1ef894869e510f2c0c0b98b9f4a"
1578dependencies = [
1579 "hostname",
1580 "quick-error",
1581]
1582
1583[[package]]
1584name = "rustc-demangle"
1585version = "0.1.16"
1586source = "registry+https://github.com/rust-lang/crates.io-index"
1587checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
1588
1589[[package]]
1590name = "rustc_version"
1591version = "0.2.3"
1592source = "registry+https://github.com/rust-lang/crates.io-index"
1593checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
1594dependencies = [
1595 "semver",
1596]
1597
1598[[package]]
1599name = "ryu"
1600version = "1.0.5"
1601source = "registry+https://github.com/rust-lang/crates.io-index"
1602checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
1603
1604[[package]]
1605name = "scheduled-thread-pool"
1606version = "0.2.5"
1607source = "registry+https://github.com/rust-lang/crates.io-index"
1608checksum = "dc6f74fd1204073fa02d5d5d68bec8021be4c38690b61264b2fdb48083d0e7d7"
1609dependencies = [
1610 "parking_lot",
1611]
1612
1613[[package]]
1614name = "scopeguard"
1615version = "1.1.0"
1616source = "registry+https://github.com/rust-lang/crates.io-index"
1617checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
1618
1619[[package]]
1620name = "semver"
1621version = "0.9.0"
1622source = "registry+https://github.com/rust-lang/crates.io-index"
1623checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
1624dependencies = [
1625 "semver-parser",
1626]
1627
1628[[package]]
1629name = "semver-parser"
1630version = "0.7.0"
1631source = "registry+https://github.com/rust-lang/crates.io-index"
1632checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
1633
1634[[package]]
1635name = "serde"
1636version = "1.0.116"
1637source = "registry+https://github.com/rust-lang/crates.io-index"
1638checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5"
1639dependencies = [
1640 "serde_derive",
1641]
1642
1643[[package]]
1644name = "serde_derive"
1645version = "1.0.116"
1646source = "registry+https://github.com/rust-lang/crates.io-index"
1647checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8"
1648dependencies = [
1649 "proc-macro2",
1650 "quote",
1651 "syn",
1652]
1653
1654[[package]]
1655name = "serde_json"
1656version = "1.0.57"
1657source = "registry+https://github.com/rust-lang/crates.io-index"
1658checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c"
1659dependencies = [
1660 "itoa",
1661 "ryu",
1662 "serde",
1663]
1664
1665[[package]]
1666name = "serde_urlencoded"
1667version = "0.6.1"
1668source = "registry+https://github.com/rust-lang/crates.io-index"
1669checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97"
1670dependencies = [
1671 "dtoa",
1672 "itoa",
1673 "serde",
1674 "url 2.1.1",
1675]
1676
1677[[package]]
1678name = "sha-1"
1679version = "0.9.1"
1680source = "registry+https://github.com/rust-lang/crates.io-index"
1681checksum = "170a36ea86c864a3f16dd2687712dd6646f7019f301e57537c7f4dc9f5916770"
1682dependencies = [
1683 "block-buffer",
1684 "cfg-if",
1685 "cpuid-bool",
1686 "digest",
1687 "opaque-debug 0.3.0",
1688]
1689
1690[[package]]
1691name = "sha1"
1692version = "0.6.0"
1693source = "registry+https://github.com/rust-lang/crates.io-index"
1694checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d"
1695
1696[[package]]
1697name = "sha2"
1698version = "0.9.1"
1699source = "registry+https://github.com/rust-lang/crates.io-index"
1700checksum = "2933378ddfeda7ea26f48c555bdad8bb446bf8a3d17832dc83e380d444cfb8c1"
1701dependencies = [
1702 "block-buffer",
1703 "cfg-if",
1704 "cpuid-bool",
1705 "digest",
1706 "opaque-debug 0.3.0",
1707]
1708
1709[[package]]
1710name = "signal-hook-registry"
1711version = "1.2.1"
1712source = "registry+https://github.com/rust-lang/crates.io-index"
1713checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035"
1714dependencies = [
1715 "arc-swap",
1716 "libc",
1717]
1718
1719[[package]]
1720name = "slab"
1721version = "0.4.2"
1722source = "registry+https://github.com/rust-lang/crates.io-index"
1723checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
1724
1725[[package]]
1726name = "smallvec"
1727version = "1.4.2"
1728source = "registry+https://github.com/rust-lang/crates.io-index"
1729checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
1730
1731[[package]]
1732name = "socket2"
1733version = "0.3.15"
1734source = "registry+https://github.com/rust-lang/crates.io-index"
1735checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44"
1736dependencies = [
1737 "cfg-if",
1738 "libc",
1739 "redox_syscall",
1740 "winapi 0.3.9",
1741]
1742
1743[[package]]
1744name = "standback"
1745version = "0.2.10"
1746source = "registry+https://github.com/rust-lang/crates.io-index"
1747checksum = "33a71ea1ea5f8747d1af1979bfb7e65c3a025a70609f04ceb78425bc5adad8e6"
1748dependencies = [
1749 "version_check",
1750]
1751
1752[[package]]
1753name = "stdweb"
1754version = "0.4.20"
1755source = "registry+https://github.com/rust-lang/crates.io-index"
1756checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5"
1757dependencies = [
1758 "discard",
1759 "rustc_version",
1760 "stdweb-derive",
1761 "stdweb-internal-macros",
1762 "stdweb-internal-runtime",
1763 "wasm-bindgen",
1764]
1765
1766[[package]]
1767name = "stdweb-derive"
1768version = "0.5.3"
1769source = "registry+https://github.com/rust-lang/crates.io-index"
1770checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
1771dependencies = [
1772 "proc-macro2",
1773 "quote",
1774 "serde",
1775 "serde_derive",
1776 "syn",
1777]
1778
1779[[package]]
1780name = "stdweb-internal-macros"
1781version = "0.2.9"
1782source = "registry+https://github.com/rust-lang/crates.io-index"
1783checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11"
1784dependencies = [
1785 "base-x",
1786 "proc-macro2",
1787 "quote",
1788 "serde",
1789 "serde_derive",
1790 "serde_json",
1791 "sha1",
1792 "syn",
1793]
1794
1795[[package]]
1796name = "stdweb-internal-runtime"
1797version = "0.1.5"
1798source = "registry+https://github.com/rust-lang/crates.io-index"
1799checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0"
1800
1801[[package]]
1802name = "subtle"
1803version = "2.3.0"
1804source = "registry+https://github.com/rust-lang/crates.io-index"
1805checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd"
1806
1807[[package]]
1808name = "syn"
1809version = "1.0.54"
1810source = "registry+https://github.com/rust-lang/crates.io-index"
1811checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44"
1812dependencies = [
1813 "proc-macro2",
1814 "quote",
1815 "unicode-xid",
1816]
1817
1818[[package]]
1819name = "termcolor"
1820version = "1.1.0"
1821source = "registry+https://github.com/rust-lang/crates.io-index"
1822checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
1823dependencies = [
1824 "winapi-util",
1825]
1826
1827[[package]]
1828name = "thiserror"
1829version = "1.0.20"
1830source = "registry+https://github.com/rust-lang/crates.io-index"
1831checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08"
1832dependencies = [
1833 "thiserror-impl",
1834]
1835
1836[[package]]
1837name = "thiserror-impl"
1838version = "1.0.20"
1839source = "registry+https://github.com/rust-lang/crates.io-index"
1840checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793"
1841dependencies = [
1842 "proc-macro2",
1843 "quote",
1844 "syn",
1845]
1846
1847[[package]]
1848name = "thread_local"
1849version = "1.0.1"
1850source = "registry+https://github.com/rust-lang/crates.io-index"
1851checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
1852dependencies = [
1853 "lazy_static",
1854]
1855
1856[[package]]
1857name = "threadpool"
1858version = "1.8.1"
1859source = "registry+https://github.com/rust-lang/crates.io-index"
1860checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa"
1861dependencies = [
1862 "num_cpus",
1863]
1864
1865[[package]]
1866name = "time"
1867version = "0.1.44"
1868source = "registry+https://github.com/rust-lang/crates.io-index"
1869checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
1870dependencies = [
1871 "libc",
1872 "wasi 0.10.0+wasi-snapshot-preview1",
1873 "winapi 0.3.9",
1874]
1875
1876[[package]]
1877name = "time"
1878version = "0.2.21"
1879source = "registry+https://github.com/rust-lang/crates.io-index"
1880checksum = "2c2e31fb28e2a9f01f5ed6901b066c1ba2333c04b64dc61254142bafcb3feb2c"
1881dependencies = [
1882 "const_fn",
1883 "libc",
1884 "standback",
1885 "stdweb",
1886 "time-macros",
1887 "version_check",
1888 "winapi 0.3.9",
1889]
1890
1891[[package]]
1892name = "time-macros"
1893version = "0.1.0"
1894source = "registry+https://github.com/rust-lang/crates.io-index"
1895checksum = "9ae9b6e9f095bc105e183e3cd493d72579be3181ad4004fceb01adbe9eecab2d"
1896dependencies = [
1897 "proc-macro-hack",
1898 "time-macros-impl",
1899]
1900
1901[[package]]
1902name = "time-macros-impl"
1903version = "0.1.1"
1904source = "registry+https://github.com/rust-lang/crates.io-index"
1905checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa"
1906dependencies = [
1907 "proc-macro-hack",
1908 "proc-macro2",
1909 "quote",
1910 "standback",
1911 "syn",
1912]
1913
1914[[package]]
1915name = "tinyvec"
1916version = "0.3.4"
1917source = "registry+https://github.com/rust-lang/crates.io-index"
1918checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117"
1919
1920[[package]]
1921name = "tinyvec"
1922version = "1.1.0"
1923source = "registry+https://github.com/rust-lang/crates.io-index"
1924checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f"
1925dependencies = [
1926 "tinyvec_macros",
1927]
1928
1929[[package]]
1930name = "tinyvec_macros"
1931version = "0.1.0"
1932source = "registry+https://github.com/rust-lang/crates.io-index"
1933checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
1934
1935[[package]]
1936name = "tokio"
1937version = "0.2.22"
1938source = "registry+https://github.com/rust-lang/crates.io-index"
1939checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd"
1940dependencies = [
1941 "bytes",
1942 "futures-core",
1943 "iovec",
1944 "lazy_static",
1945 "libc",
1946 "memchr",
1947 "mio",
1948 "mio-uds",
1949 "pin-project-lite",
1950 "signal-hook-registry",
1951 "slab",
1952 "winapi 0.3.9",
1953]
1954
1955[[package]]
1956name = "tokio-util"
1957version = "0.3.1"
1958source = "registry+https://github.com/rust-lang/crates.io-index"
1959checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499"
1960dependencies = [
1961 "bytes",
1962 "futures-core",
1963 "futures-sink",
1964 "log",
1965 "pin-project-lite",
1966 "tokio",
1967]
1968
1969[[package]]
1970name = "tracing"
1971version = "0.1.19"
1972source = "registry+https://github.com/rust-lang/crates.io-index"
1973checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c"
1974dependencies = [
1975 "cfg-if",
1976 "log",
1977 "tracing-core",
1978]
1979
1980[[package]]
1981name = "tracing-core"
1982version = "0.1.16"
1983source = "registry+https://github.com/rust-lang/crates.io-index"
1984checksum = "5bcf46c1f1f06aeea2d6b81f3c863d0930a596c86ad1920d4e5bad6dd1d7119a"
1985dependencies = [
1986 "lazy_static",
1987]
1988
1989[[package]]
1990name = "trust-dns-proto"
1991version = "0.19.5"
1992source = "registry+https://github.com/rust-lang/crates.io-index"
1993checksum = "cdd7061ba6f4d4d9721afedffbfd403f20f39a4301fee1b70d6fcd09cca69f28"
1994dependencies = [
1995 "async-trait",
1996 "backtrace",
1997 "enum-as-inner",
1998 "futures",
1999 "idna 0.2.0",
2000 "lazy_static",
2001 "log",
2002 "rand",
2003 "smallvec",
2004 "thiserror",
2005 "tokio",
2006 "url 2.1.1",
2007]
2008
2009[[package]]
2010name = "trust-dns-resolver"
2011version = "0.19.5"
2012source = "registry+https://github.com/rust-lang/crates.io-index"
2013checksum = "0f23cdfdc3d8300b3c50c9e84302d3bd6d860fb9529af84ace6cf9665f181b77"
2014dependencies = [
2015 "backtrace",
2016 "cfg-if",
2017 "futures",
2018 "ipconfig",
2019 "lazy_static",
2020 "log",
2021 "lru-cache",
2022 "resolv-conf",
2023 "smallvec",
2024 "thiserror",
2025 "tokio",
2026 "trust-dns-proto",
2027]
2028
2029[[package]]
2030name = "typenum"
2031version = "1.12.0"
2032source = "registry+https://github.com/rust-lang/crates.io-index"
2033checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
2034
2035[[package]]
2036name = "unicode-bidi"
2037version = "0.3.4"
2038source = "registry+https://github.com/rust-lang/crates.io-index"
2039checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
2040dependencies = [
2041 "matches",
2042]
2043
2044[[package]]
2045name = "unicode-normalization"
2046version = "0.1.13"
2047source = "registry+https://github.com/rust-lang/crates.io-index"
2048checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977"
2049dependencies = [
2050 "tinyvec 0.3.4",
2051]
2052
2053[[package]]
2054name = "unicode-segmentation"
2055version = "1.6.0"
2056source = "registry+https://github.com/rust-lang/crates.io-index"
2057checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
2058
2059[[package]]
2060name = "unicode-xid"
2061version = "0.2.1"
2062source = "registry+https://github.com/rust-lang/crates.io-index"
2063checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
2064
2065[[package]]
2066name = "universal-hash"
2067version = "0.4.0"
2068source = "registry+https://github.com/rust-lang/crates.io-index"
2069checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402"
2070dependencies = [
2071 "generic-array",
2072 "subtle",
2073]
2074
2075[[package]]
2076name = "url"
2077version = "1.7.2"
2078source = "registry+https://github.com/rust-lang/crates.io-index"
2079checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a"
2080dependencies = [
2081 "idna 0.1.5",
2082 "matches",
2083 "percent-encoding 1.0.1",
2084]
2085
2086[[package]]
2087name = "url"
2088version = "2.1.1"
2089source = "registry+https://github.com/rust-lang/crates.io-index"
2090checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb"
2091dependencies = [
2092 "idna 0.2.0",
2093 "matches",
2094 "percent-encoding 2.1.0",
2095]
2096
2097[[package]]
2098name = "vcpkg"
2099version = "0.2.10"
2100source = "registry+https://github.com/rust-lang/crates.io-index"
2101checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
2102
2103[[package]]
2104name = "version_check"
2105version = "0.9.2"
2106source = "registry+https://github.com/rust-lang/crates.io-index"
2107checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
2108
2109[[package]]
2110name = "wasi"
2111version = "0.9.0+wasi-snapshot-preview1"
2112source = "registry+https://github.com/rust-lang/crates.io-index"
2113checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
2114
2115[[package]]
2116name = "wasi"
2117version = "0.10.0+wasi-snapshot-preview1"
2118source = "registry+https://github.com/rust-lang/crates.io-index"
2119checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
2120
2121[[package]]
2122name = "wasm-bindgen"
2123version = "0.2.68"
2124source = "registry+https://github.com/rust-lang/crates.io-index"
2125checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42"
2126dependencies = [
2127 "cfg-if",
2128 "wasm-bindgen-macro",
2129]
2130
2131[[package]]
2132name = "wasm-bindgen-backend"
2133version = "0.2.68"
2134source = "registry+https://github.com/rust-lang/crates.io-index"
2135checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68"
2136dependencies = [
2137 "bumpalo",
2138 "lazy_static",
2139 "log",
2140 "proc-macro2",
2141 "quote",
2142 "syn",
2143 "wasm-bindgen-shared",
2144]
2145
2146[[package]]
2147name = "wasm-bindgen-macro"
2148version = "0.2.68"
2149source = "registry+https://github.com/rust-lang/crates.io-index"
2150checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038"
2151dependencies = [
2152 "quote",
2153 "wasm-bindgen-macro-support",
2154]
2155
2156[[package]]
2157name = "wasm-bindgen-macro-support"
2158version = "0.2.68"
2159source = "registry+https://github.com/rust-lang/crates.io-index"
2160checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe"
2161dependencies = [
2162 "proc-macro2",
2163 "quote",
2164 "syn",
2165 "wasm-bindgen-backend",
2166 "wasm-bindgen-shared",
2167]
2168
2169[[package]]
2170name = "wasm-bindgen-shared"
2171version = "0.2.68"
2172source = "registry+https://github.com/rust-lang/crates.io-index"
2173checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307"
2174
2175[[package]]
2176name = "widestring"
2177version = "0.4.2"
2178source = "registry+https://github.com/rust-lang/crates.io-index"
2179checksum = "a763e303c0e0f23b0da40888724762e802a8ffefbc22de4127ef42493c2ea68c"
2180
2181[[package]]
2182name = "winapi"
2183version = "0.2.8"
2184source = "registry+https://github.com/rust-lang/crates.io-index"
2185checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
2186
2187[[package]]
2188name = "winapi"
2189version = "0.3.9"
2190source = "registry+https://github.com/rust-lang/crates.io-index"
2191checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
2192dependencies = [
2193 "winapi-i686-pc-windows-gnu",
2194 "winapi-x86_64-pc-windows-gnu",
2195]
2196
2197[[package]]
2198name = "winapi-build"
2199version = "0.1.1"
2200source = "registry+https://github.com/rust-lang/crates.io-index"
2201checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
2202
2203[[package]]
2204name = "winapi-i686-pc-windows-gnu"
2205version = "0.4.0"
2206source = "registry+https://github.com/rust-lang/crates.io-index"
2207checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
2208
2209[[package]]
2210name = "winapi-util"
2211version = "0.1.5"
2212source = "registry+https://github.com/rust-lang/crates.io-index"
2213checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
2214dependencies = [
2215 "winapi 0.3.9",
2216]
2217
2218[[package]]
2219name = "winapi-x86_64-pc-windows-gnu"
2220version = "0.4.0"
2221source = "registry+https://github.com/rust-lang/crates.io-index"
2222checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
2223
2224[[package]]
2225name = "winreg"
2226version = "0.6.2"
2227source = "registry+https://github.com/rust-lang/crates.io-index"
2228checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9"
2229dependencies = [
2230 "winapi 0.3.9",
2231]
2232
2233[[package]]
2234name = "ws2_32-sys"
2235version = "0.2.1"
2236source = "registry+https://github.com/rust-lang/crates.io-index"
2237checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
2238dependencies = [
2239 "winapi 0.2.8",
2240 "winapi-build",
2241]
diff --git a/backend/Cargo.toml b/backend/Cargo.toml
new file mode 100644
index 0000000..8ce728b
--- /dev/null
+++ b/backend/Cargo.toml
@@ -0,0 +1,29 @@
1[package]
2name = "furby"
3version = "0.1.0"
4authors = ["Akshay <[email protected]>"]
5edition = "2018"
6
7# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8
9[dependencies]
10actix-web = "3"
11bcrypt = "0.8"
12serde = "1.0"
13serde_derive = "1.0"
14serde_json = "1.0"
15log = "0.4"
16pretty_env_logger = "0.4"
17actix-identity = "0.3.1"
18actix-cors = "0.5"
19bigdecimal = "0.0.14"
20rand = "0.7"
21
22[dependencies.diesel]
23version = "1.4.2"
24features = ["mysql", "r2d2", "numeric", "chrono"]
25default-features = false
26
27[dependencies.chrono]
28version = "0.4"
29features = ["serde"]
diff --git a/backend/diesel.toml b/backend/diesel.toml
new file mode 100644
index 0000000..92267c8
--- /dev/null
+++ b/backend/diesel.toml
@@ -0,0 +1,5 @@
1# For documentation on how to configure this file,
2# see diesel.rs/guides/configuring-diesel-cli
3
4[print_schema]
5file = "src/schema.rs"
diff --git a/backend/migrations/.gitkeep b/backend/migrations/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/backend/migrations/.gitkeep
diff --git a/backend/migrations/2020-09-22-104623_create_users/down.sql b/backend/migrations/2020-09-22-104623_create_users/down.sql
new file mode 100644
index 0000000..2c92cb7
--- /dev/null
+++ b/backend/migrations/2020-09-22-104623_create_users/down.sql
@@ -0,0 +1,3 @@
1-- This file should undo anything in `up.sql`
2
3DROP TABLE members;
diff --git a/backend/migrations/2020-09-22-104623_create_users/up.sql b/backend/migrations/2020-09-22-104623_create_users/up.sql
new file mode 100644
index 0000000..dfd27d9
--- /dev/null
+++ b/backend/migrations/2020-09-22-104623_create_users/up.sql
@@ -0,0 +1,8 @@
1-- Your SQL goes here
2CREATE TABLE members (
3 id INTEGER PRIMARY KEY AUTO_INCREMENT,
4 username VARCHAR(255) NOT NULL UNIQUE,
5 password VARCHAR(255) NOT NULL,
6 phone_number VARCHAR(10) NOT NULL,
7 email_id VARCHAR(255) NOT NULL
8)
diff --git a/backend/migrations/2020-11-16-133516_create_products_table/down.sql b/backend/migrations/2020-11-16-133516_create_products_table/down.sql
new file mode 100644
index 0000000..7d99a98
--- /dev/null
+++ b/backend/migrations/2020-11-16-133516_create_products_table/down.sql
@@ -0,0 +1,3 @@
1-- This file should undo anything in `up.sql`
2
3DROP TABLE product;
diff --git a/backend/migrations/2020-11-16-133516_create_products_table/up.sql b/backend/migrations/2020-11-16-133516_create_products_table/up.sql
new file mode 100644
index 0000000..829c5be
--- /dev/null
+++ b/backend/migrations/2020-11-16-133516_create_products_table/up.sql
@@ -0,0 +1,8 @@
1-- Your SQL goes here
2CREATE TABLE product (
3 id INTEGER PRIMARY KEY AUTO_INCREMENT,
4 name VARCHAR(255) NOT NULL,
5 kind VARCHAR(255),
6 price FLOAT NOT NULL,
7 description VARCHAR(255)
8)
diff --git a/backend/migrations/2020-12-13-140215_all_tables/down.sql b/backend/migrations/2020-12-13-140215_all_tables/down.sql
new file mode 100644
index 0000000..9c554a2
--- /dev/null
+++ b/backend/migrations/2020-12-13-140215_all_tables/down.sql
@@ -0,0 +1,11 @@
1-- This file should undo anything in `up.sql`
2
3drop table customer;
4
5drop table product;
6
7drop table cart_items;
8
9drop table rating;
10
11drop table transaction;
diff --git a/backend/migrations/2020-12-13-140215_all_tables/up.sql b/backend/migrations/2020-12-13-140215_all_tables/up.sql
new file mode 100644
index 0000000..527b926
--- /dev/null
+++ b/backend/migrations/2020-12-13-140215_all_tables/up.sql
@@ -0,0 +1,47 @@
1-- Your SQL goes here
2
3create table customer (
4 id integer primary key auto_increment,
5 username varchar(255) not null unique,
6 password varchar(255) not null,
7 phone_number varchar(10) not null,
8 email_id varchar(255) not null,
9 address text(500)
10);
11
12create table product (
13 id integer primary key auto_increment,
14 name varchar(255) not null,
15 kind varchar(255),
16 price float not null,
17 description varchar(255)
18);
19
20create table cart_items (
21 cart_id integer,
22 product_id integer,
23 constraint cart_items_pk primary key (cart_id, product_id),
24 foreign key (cart_id) references customer(id),
25 foreign key (product_id) references product(id)
26);
27
28create table rating (
29 id integer primary key auto_increment,
30 comment_text text(500),
31 comment_date date default curdate(),
32 product_id integer,
33 customer_id integer,
34
35 stars integer check (stars >= 0 AND stars <= 5),
36 foreign key (customer_id) references customer(id),
37 foreign key (product_id) references product(id)
38);
39
40create table transaction (
41 id integer primary key auto_increment,
42 payment_type varchar(255) not null,
43 amount float not null,
44 customer_id integer,
45
46 foreign key (customer_id) references customer(id)
47);
diff --git a/backend/rustfmt.toml b/backend/rustfmt.toml
new file mode 100644
index 0000000..be4296e
--- /dev/null
+++ b/backend/rustfmt.toml
@@ -0,0 +1,15 @@
1max_width = 80
2hard_tabs = false
3tab_spaces = 4
4newline_style = "Auto"
5use_small_heuristics = "Default"
6reorder_imports = true
7reorder_modules = true
8remove_nested_parens = true
9fn_args_layout = "Tall"
10edition = "2018"
11merge_derives = true
12use_try_shorthand = false
13use_field_init_shorthand = false
14force_explicit_abi = true
15
diff --git a/backend/src/bin/server.rs b/backend/src/bin/server.rs
new file mode 100644
index 0000000..7c67e4f
--- /dev/null
+++ b/backend/src/bin/server.rs
@@ -0,0 +1,94 @@
1use actix_cors::Cors;
2use actix_identity::{CookieIdentityPolicy, IdentityService};
3use actix_web::middleware;
4use actix_web::{web, App, HttpServer};
5use diesel::r2d2::{ConnectionManager, Pool};
6use diesel::MysqlConnection;
7use furby::handlers::smoke::manual_hello;
8use furby::handlers::{cart_items, product, rating, users};
9use rand::Rng;
10
11#[actix_web::main]
12async fn main() -> std::io::Result<()> {
13 pretty_env_logger::init();
14
15 let db_url = env!("DATABASE_URL");
16 let manager = ConnectionManager::<MysqlConnection>::new(db_url);
17 let pool = Pool::builder()
18 .build(manager)
19 .expect("Failed to create pool.");
20
21 let private_key = rand::thread_rng().gen::<[u8; 32]>();
22 HttpServer::new(move || {
23 App::new()
24 .wrap(IdentityService::new(
25 CookieIdentityPolicy::new(&private_key)
26 .name("user-login")
27 .domain("127.0.0.1")
28 .path("/")
29 .same_site(actix_web::cookie::SameSite::None)
30 .http_only(true)
31 .secure(false),
32 ))
33 .wrap(
34 Cors::default()
35 .allowed_origin("http://127.0.0.1:8000")
36 .allowed_origin("http://localhost:8000")
37 .allow_any_method()
38 .allow_any_header(),
39 )
40 .wrap(
41 middleware::DefaultHeaders::new()
42 .header("Access-Control-Allow-Credentials", "true")
43 .header("Access-Control-Expose-Headers", "set-cookie"),
44 )
45 .wrap(middleware::Logger::default())
46 .data(pool.clone())
47 .service(
48 web::scope("/user")
49 .route("/existing", web::post().to(users::name_exists))
50 .route("/login", web::post().to(users::login))
51 .route("/{uname}", web::get().to(users::user_details))
52 .route("/new", web::post().to(users::new_user))
53 .route(
54 "/change_password",
55 web::post().to(users::change_password),
56 ),
57 )
58 .service(
59 web::scope("/product")
60 .route("/catalog", web::get().to(product::get_all_products))
61 .route("/new", web::post().to(product::new_product))
62 .route("/{id}", web::get().to(product::product_details))
63 .route(
64 "/reviews/{id}",
65 web::get().to(product::get_product_reviews),
66 )
67 .route(
68 "/update_product/{id}",
69 web::post().to(product::update_product),
70 ),
71 )
72 .service(
73 web::scope("/cart")
74 .route(
75 "/items",
76 web::get().to(cart_items::get_user_cart_items),
77 )
78 .route("/add", web::post().to(cart_items::add_to_cart))
79 .route(
80 "/remove",
81 web::post().to(cart_items::remove_from_cart),
82 ),
83 )
84 .service(
85 web::scope("/rating")
86 .route("/add", web::post().to(rating::add_rating))
87 .route("/remove", web::post().to(rating::remove_rating)),
88 )
89 .route("/hey", web::get().to(manual_hello))
90 })
91 .bind("127.0.0.1:7878")?
92 .run()
93 .await
94}
diff --git a/backend/src/handlers/cart_items.rs b/backend/src/handlers/cart_items.rs
new file mode 100644
index 0000000..25baaeb
--- /dev/null
+++ b/backend/src/handlers/cart_items.rs
@@ -0,0 +1,107 @@
1use crate::models::{AddCartItem, CartItem, Customer, Product};
2use crate::schema::product::dsl as prod;
3use crate::schema::{cart_items::dsl::*, customer::dsl::*};
4use crate::TPool;
5
6use actix_identity::Identity;
7use actix_web::{web, HttpResponse, Responder};
8use diesel::prelude::*;
9use log::{error, info};
10use serde::Deserialize;
11
12pub async fn add_to_cart(
13 cookie: Identity,
14 item_id: String,
15 pool: web::Data<TPool>,
16) -> impl Responder {
17 let item_details = item_id.parse::<i32>().unwrap_or(-1);
18 info!("Add to cart hit: {:?}", item_details);
19 info!("[cart] Current user: {:?}", cookie.identity());
20 let conn = pool.get().unwrap();
21 if let Some(uname) = cookie.identity() {
22 let selected_user = customer
23 .filter(username.eq(&uname))
24 .limit(1)
25 .first::<Customer>(&conn)
26 .expect("Couldn't connect to DB");
27 let new_cart_item = AddCartItem {
28 cart_id: selected_user.id,
29 product_id: item_details,
30 };
31 info!(
32 "cart id: {:?}, product id {:?}",
33 selected_user.id, item_details
34 );
35 diesel::insert_into(cart_items)
36 .values((cart_id.eq(selected_user.id), product_id.eq(item_details)))
37 .execute(&conn)
38 .expect("Coundn't connect to DB");
39 HttpResponse::Ok().body("Inserted successfully!")
40 } else {
41 error!("Unauthorized add to cart action!");
42 return HttpResponse::Unauthorized()
43 .body("Need to be logged in to add to cart!");
44 }
45}
46
47pub async fn remove_from_cart(
48 cookie: Identity,
49 item_id: String,
50 pool: web::Data<TPool>,
51) -> impl Responder {
52 info!("Remove from cart hit: {:?}", item_id);
53 let item_details = item_id.parse::<i32>().unwrap_or(-1);
54 let conn = pool.get().unwrap();
55 if let Some(uname) = cookie.identity() {
56 let selected_user = customer
57 .filter(username.eq(&uname))
58 .limit(1)
59 .first::<Customer>(&conn)
60 .expect("Couldn't connect to DB");
61
62 diesel::delete(
63 cart_items
64 .filter(cart_id.eq(selected_user.id))
65 .filter(product_id.eq(item_details)),
66 )
67 .execute(&conn)
68 .expect("Coundn't connect to DB");
69 HttpResponse::Ok().body("Removed successfully!")
70 } else {
71 error!("Unauthorized add to cart action!");
72 return HttpResponse::Unauthorized()
73 .body("Need to be logged in to add to cart!");
74 }
75}
76
77pub async fn get_user_cart_items(
78 cookie: Identity,
79 pool: web::Data<TPool>,
80) -> impl Responder {
81 let conn = pool.get().unwrap();
82 if let Some(uname) = cookie.identity() {
83 let selected_user = customer
84 .filter(username.eq(&uname))
85 .limit(1)
86 .first::<Customer>(&conn)
87 .expect("Couldn't connect to DB");
88 let user_cart_items = cart_items
89 .filter(cart_id.eq(selected_user.id))
90 .load::<CartItem>(&conn)
91 .expect("Couldn't connect to DB");
92 let cart_products = user_cart_items
93 .into_iter()
94 .map(|item| {
95 prod::product
96 .filter(prod::id.eq(item.product_id))
97 .limit(1)
98 .first::<Product>(&conn)
99 .expect("Couldn't connect to db")
100 })
101 .collect::<Vec<_>>();
102 return HttpResponse::Ok().json(&cart_products);
103 } else {
104 return HttpResponse::Unauthorized()
105 .body("Need to be logged in to add to cart!");
106 }
107}
diff --git a/backend/src/handlers/mod.rs b/backend/src/handlers/mod.rs
new file mode 100644
index 0000000..9416857
--- /dev/null
+++ b/backend/src/handlers/mod.rs
@@ -0,0 +1,5 @@
1pub mod cart_items;
2pub mod product;
3pub mod rating;
4pub mod smoke;
5pub mod users;
diff --git a/backend/src/handlers/product.rs b/backend/src/handlers/product.rs
new file mode 100644
index 0000000..41a47a0
--- /dev/null
+++ b/backend/src/handlers/product.rs
@@ -0,0 +1,138 @@
1use crate::models::{Customer, NewProduct, Product, Rating, UpdateProduct};
2use crate::schema::customer::dsl as cust;
3use crate::schema::product::dsl::*;
4use crate::schema::rating::dsl as rating;
5use crate::TPool;
6
7use actix_web::{web, HttpResponse, Responder};
8use chrono::naive::NaiveDate;
9use diesel::prelude::*;
10use log::{error, info};
11use serde::{Deserialize, Serialize};
12
13pub async fn new_product(
14 pool: web::Data<TPool>,
15 item: web::Json<NewProduct>,
16) -> impl Responder {
17 info!("New product hit: {:?}", item.name);
18 let conn = pool.get().unwrap();
19 diesel::insert_into(product)
20 .values(item.into_inner())
21 .execute(&conn)
22 .expect("Coundn't connect to DB");
23 HttpResponse::Ok().body("Inserted successfully!")
24}
25
26pub async fn product_details(
27 pool: web::Data<TPool>,
28 product_id: web::Path<i32>,
29) -> impl Responder {
30 let conn = pool.get().unwrap();
31 let product_id = product_id.into_inner();
32 info!("Fetching product details for {}", product_id);
33 let selected_product = product
34 .filter(id.eq(&product_id))
35 .limit(1)
36 .first::<Product>(&conn);
37 match selected_product {
38 Ok(m) => {
39 info!("Found product: {}", product_id);
40 HttpResponse::Ok().json(m)
41 }
42 Err(_) => {
43 error!("Product not found: {}", product_id);
44 HttpResponse::NotFound().finish()
45 }
46 }
47}
48
49pub async fn update_product(
50 pool: web::Data<TPool>,
51 product_id: web::Path<i32>,
52 product_details: web::Json<UpdateProduct>,
53) -> impl Responder {
54 let conn = pool.get().unwrap();
55 let product_id = product_id.into_inner();
56 let product_details = product_details.into_inner();
57 info!("Updating product: {:?}", product_id);
58 match diesel::update(product.filter(id.eq(product_id)))
59 .set((
60 name.eq(product_details.name),
61 kind.eq(product_details.kind),
62 price.eq(product_details.price),
63 description.eq(product_details.description),
64 ))
65 .execute(&conn)
66 {
67 Ok(_) => {
68 return HttpResponse::Ok().body("Changed product successfully")
69 }
70 _ => {
71 return HttpResponse::InternalServerError()
72 .body("Unable to update record")
73 }
74 }
75}
76
77pub async fn get_all_products(pool: web::Data<TPool>) -> impl Responder {
78 let conn = pool.get().unwrap();
79 info!("Generating and returning catalog ...");
80 match product.load::<Product>(&conn) {
81 Ok(products) => return HttpResponse::Ok().json(&products),
82 Err(_) => {
83 return HttpResponse::InternalServerError()
84 .body("Unable to fetch product catalog")
85 }
86 }
87}
88
89#[derive(Serialize, Deserialize, Debug)]
90struct ProductRating {
91 pub comment_text: Option<String>,
92 pub comment_date: NaiveDate,
93 pub product_name: String,
94 pub customer_name: String,
95 pub stars: Option<i32>,
96}
97
98pub async fn get_product_reviews(
99 pool: web::Data<TPool>,
100 product_id: web::Path<i32>,
101) -> impl Responder {
102 let conn = pool.get().unwrap();
103 info!("Fetching product reviews for {}", product_id);
104 let pid = product_id.into_inner();
105 let rating_entries = rating::rating
106 .filter(rating::product_id.eq(pid))
107 .load::<Rating>(&conn)
108 .expect("Couldn't connect to DB");
109 let json_ratings = rating_entries
110 .into_iter()
111 .map(move |p| {
112 let selected_product = product
113 .filter(id.eq(&p.product_id.unwrap()))
114 .limit(1)
115 .first::<Product>(&conn)
116 .unwrap()
117 .name
118 .clone();
119
120 let selected_customer = cust::customer
121 .filter(cust::id.eq(&p.customer_id.unwrap()))
122 .limit(1)
123 .first::<Customer>(&conn)
124 .unwrap()
125 .username
126 .clone();
127
128 ProductRating {
129 comment_text: p.comment_text,
130 comment_date: p.comment_date.unwrap(),
131 product_name: selected_product,
132 customer_name: selected_customer,
133 stars: p.stars,
134 }
135 })
136 .collect::<Vec<_>>();
137 return HttpResponse::Ok().json(&json_ratings);
138}
diff --git a/backend/src/handlers/rating.rs b/backend/src/handlers/rating.rs
new file mode 100644
index 0000000..dfbeb3e
--- /dev/null
+++ b/backend/src/handlers/rating.rs
@@ -0,0 +1,91 @@
1use crate::models::{AddRating, Customer, Rating};
2use crate::schema::rating::dsl as rating;
3use crate::schema::{customer::dsl::*, product::dsl::*};
4use crate::TPool;
5
6use actix_identity::Identity;
7use actix_web::{web, HttpResponse, Responder};
8use diesel::prelude::*;
9use log::{error, info};
10use serde::Deserialize;
11
12#[derive(Deserialize, Debug)]
13pub struct AddRatingJson {
14 pub comment_text: Option<String>,
15 pub stars: Option<i32>,
16 pub product_id: i32,
17}
18
19pub async fn add_rating(
20 cookie: Identity,
21 rating_details: web::Json<AddRatingJson>,
22 pool: web::Data<TPool>,
23) -> impl Responder {
24 info!("Add rating hit: {:?}", rating_details.product_id);
25 info!("{:?}", cookie.identity());
26 let conn = pool.get().unwrap();
27 if let Some(uname) = cookie.identity() {
28 let selected_user = customer
29 .filter(username.eq(&uname))
30 .limit(1)
31 .first::<Customer>(&conn)
32 .expect("Couldn't connect to DB");
33 let rating_details = rating_details.into_inner();
34 let new_rating = AddRating {
35 comment_text: rating_details.comment_text,
36 stars: rating_details.stars,
37 product_id: rating_details.product_id,
38 customer_id: selected_user.id,
39 };
40 diesel::insert_into(rating::rating)
41 .values(new_rating)
42 .execute(&conn)
43 .expect("Coundn't connect to DB");
44 HttpResponse::Ok().body("Inserted rating successfully!")
45 } else {
46 error!("Unauthorized add rating action!");
47 return HttpResponse::Unauthorized()
48 .body("Need to be logged in to add rating!");
49 }
50}
51
52#[derive(Deserialize, Debug)]
53pub struct RemoveRating {
54 rating_id: i32,
55}
56
57pub async fn remove_rating(
58 cookie: Identity,
59 rating_details: web::Json<RemoveRating>,
60 pool: web::Data<TPool>,
61) -> impl Responder {
62 info!("Remove rating hit: {:?}", rating_details.rating_id);
63 let conn = pool.get().unwrap();
64 if let Some(uname) = cookie.identity() {
65 let selected_user = customer
66 .filter(username.eq(&uname))
67 .limit(1)
68 .first::<Customer>(&conn)
69 .expect("Couldn't connect to DB");
70
71 diesel::delete(
72 rating::rating
73 .filter(rating::customer_id.eq(selected_user.id))
74 .filter(rating::id.eq(rating_details.rating_id)),
75 )
76 .execute(&conn)
77 .expect("Coundn't connect to DB");
78 HttpResponse::Ok().body("Removed successfully!")
79 } else {
80 error!("Unauthorized add to cart action!");
81 return HttpResponse::Unauthorized()
82 .body("Need to be logged in to add to cart!");
83 }
84}
85
86// pub async fn get_product_reviews(
87// product: web::Json<GetProductReviews>,
88// pool: web::Data<TPool>,
89// ) -> impl Responder {
90// unimplemented!()
91// }
diff --git a/backend/src/handlers/smoke.rs b/backend/src/handlers/smoke.rs
new file mode 100644
index 0000000..d0a1038
--- /dev/null
+++ b/backend/src/handlers/smoke.rs
@@ -0,0 +1,15 @@
1use actix_web::{get, post, HttpResponse, Responder};
2
3#[get("/")]
4async fn hello() -> impl Responder {
5 HttpResponse::Ok().body("Hello world!")
6}
7
8#[post("/echo")]
9async fn echo(req_body: String) -> impl Responder {
10 HttpResponse::Ok().body(req_body)
11}
12
13pub async fn manual_hello() -> impl Responder {
14 HttpResponse::Ok().body("Hey there!")
15}
diff --git a/backend/src/handlers/users.rs b/backend/src/handlers/users.rs
new file mode 100644
index 0000000..24fb591
--- /dev/null
+++ b/backend/src/handlers/users.rs
@@ -0,0 +1,148 @@
1use crate::models::{Customer, NewCustomer};
2use crate::schema::customer::dsl::*;
3use crate::TPool;
4
5use actix_identity::Identity;
6use actix_web::{web, HttpResponse, Responder};
7use bcrypt::{hash, verify, DEFAULT_COST};
8use diesel::prelude::*;
9use log::{error, info};
10use serde::Deserialize;
11
12pub async fn new_user(
13 pool: web::Data<TPool>,
14 item: web::Json<NewCustomer>,
15) -> impl Responder {
16 info!("Creating ... {:?}", item.username);
17 let conn = pool.get().unwrap();
18 let hashed_item = NewCustomer {
19 password: hash(&item.password, DEFAULT_COST).unwrap(),
20 ..(item.into_inner())
21 };
22 diesel::insert_into(customer)
23 .values(hashed_item)
24 .execute(&conn)
25 .expect("Coundn't connect to DB");
26 HttpResponse::Ok().body("Inserted successfully!")
27}
28
29pub async fn name_exists(
30 pool: web::Data<TPool>,
31 item: String,
32) -> impl Responder {
33 let conn = pool.get().unwrap();
34 info!("target: {:?}", item);
35 if (customer
36 .filter(username.eq(&item))
37 .limit(1)
38 .load::<Customer>(&conn)
39 .expect("Coundn't connect to DB"))
40 .len()
41 > 0
42 {
43 HttpResponse::Ok().body("true")
44 } else {
45 HttpResponse::Ok().body("false")
46 }
47}
48
49#[derive(Deserialize)]
50pub struct Login {
51 username: String,
52 password: String,
53}
54
55pub async fn login(
56 pool: web::Data<TPool>,
57 cookie: Identity,
58 login_details: web::Json<Login>,
59) -> impl Responder {
60 info!("Login hit");
61 if let Some(uname) = cookie.identity() {
62 info!("Found existing cookie: {:?}", cookie.identity());
63 return HttpResponse::Ok().finish();
64 }
65 let conn = pool.get().unwrap();
66 let entered_pass = &login_details.password;
67 let selected_user = customer
68 .filter(username.eq(&login_details.username))
69 .limit(1)
70 .first::<Customer>(&conn)
71 .expect("Couldn't connect to DB");
72 let hashed_pass = selected_user.password;
73 if verify(entered_pass, &hashed_pass).unwrap() {
74 cookie.remember(login_details.username.clone());
75 info!(
76 "Successful login: {} {}",
77 selected_user.username, selected_user.email_id
78 );
79 HttpResponse::Ok().finish()
80 } else {
81 HttpResponse::Unauthorized().finish()
82 }
83}
84
85pub async fn logout(cookie: Identity) -> impl Responder {
86 cookie.forget();
87 HttpResponse::Found().header("location", "/").finish()
88}
89
90pub async fn user_details(
91 uname: web::Path<String>,
92 pool: web::Data<TPool>,
93) -> impl Responder {
94 let conn = pool.get().unwrap();
95 let uname = uname.into_inner();
96 info!("Fetching info for: \"{}\"", uname);
97 let selected_user = customer
98 .filter(username.eq(&uname))
99 .limit(1)
100 .first::<Customer>(&conn);
101 match selected_user {
102 Ok(m) => {
103 info!("Found user: {}", uname);
104 HttpResponse::Ok().json(m)
105 }
106 Err(_) => {
107 error!("User not found: {}", uname);
108 HttpResponse::NotFound().finish()
109 }
110 }
111}
112
113#[derive(Deserialize, Debug)]
114pub struct ChangePassword {
115 old_password: String,
116 new_password: String,
117}
118
119pub async fn change_password(
120 cookie: Identity,
121 password_details: web::Json<ChangePassword>,
122 pool: web::Data<TPool>,
123) -> impl Responder {
124 info!("Change password request: {:?}", password_details);
125 let conn = pool.get().unwrap();
126 if let Some(uname) = cookie.identity() {
127 let entered_pass = &password_details.old_password;
128 let new_password = &password_details.new_password;
129 let selected_user = customer
130 .filter(username.eq(&uname))
131 .limit(1)
132 .first::<Customer>(&conn)
133 .expect("Couldn't connect to DB");
134 let hashed_pass = selected_user.password;
135 if verify(entered_pass, &hashed_pass).unwrap() {
136 let hashed_new_password =
137 hash(&new_password, DEFAULT_COST).unwrap();
138 diesel::update(customer.filter(id.eq(selected_user.id)))
139 .set(password.eq(hashed_new_password))
140 .execute(&conn)
141 .unwrap();
142 return HttpResponse::Ok().body("Changed password successfully");
143 } else {
144 return HttpResponse::Ok().body("Invalid password");
145 }
146 }
147 return HttpResponse::Unauthorized().body("Login first");
148}
diff --git a/backend/src/lib.rs b/backend/src/lib.rs
new file mode 100644
index 0000000..d956a3f
--- /dev/null
+++ b/backend/src/lib.rs
@@ -0,0 +1,10 @@
1#[macro_use]
2extern crate diesel;
3
4pub mod handlers;
5pub mod models;
6pub mod schema;
7
8use diesel::r2d2::{self, ConnectionManager};
9use diesel::MysqlConnection;
10pub type TPool = r2d2::Pool<ConnectionManager<MysqlConnection>>;
diff --git a/backend/src/models.rs b/backend/src/models.rs
new file mode 100644
index 0000000..a104209
--- /dev/null
+++ b/backend/src/models.rs
@@ -0,0 +1,97 @@
1use super::schema::{cart_items, customer, product, rating, transaction};
2
3use chrono::naive::{NaiveDate, NaiveDateTime};
4use diesel::{Insertable, Queryable};
5use serde::{Deserialize, Serialize};
6
7/* Member */
8#[derive(Queryable, Serialize)]
9pub struct Customer {
10 pub id: i32,
11 pub username: String,
12 pub password: String,
13 pub phone_number: String,
14 pub email_id: String,
15 pub address: Option<String>,
16}
17
18#[derive(Insertable, Deserialize)]
19#[table_name = "customer"]
20pub struct NewCustomer {
21 pub username: String,
22 pub password: String,
23 pub phone_number: String,
24 pub email_id: String,
25
26 #[serde(skip_serializing_if = "Option::is_none")]
27 pub address: Option<String>,
28}
29
30/* Product */
31#[derive(Queryable, Serialize)]
32pub struct Product {
33 pub id: i32,
34 pub name: String,
35 pub kind: Option<String>,
36 pub price: f32,
37 pub description: Option<String>,
38}
39
40#[derive(Insertable, Deserialize)]
41#[table_name = "product"]
42pub struct NewProduct {
43 pub name: String,
44
45 #[serde(skip_serializing_if = "Option::is_none")]
46 pub kind: Option<String>,
47 pub price: f32,
48
49 #[serde(skip_serializing_if = "Option::is_none")]
50 pub description: Option<String>,
51}
52
53#[derive(Deserialize)]
54pub struct UpdateProduct {
55 pub name: String,
56 pub kind: Option<String>,
57 pub price: f32,
58 pub description: Option<String>,
59}
60
61/* Cart Items */
62#[derive(Queryable, Serialize)]
63pub struct CartItem {
64 pub cart_id: i32,
65 pub product_id: i32,
66}
67
68#[derive(Insertable, Deserialize)]
69#[table_name = "cart_items"]
70pub struct AddCartItem {
71 pub cart_id: i32,
72 pub product_id: i32,
73}
74
75/* Rating */
76#[derive(Queryable, Serialize)]
77pub struct Rating {
78 pub id: i32,
79 pub comment_text: Option<String>,
80 pub comment_date: Option<NaiveDate>,
81 pub product_id: Option<i32>,
82 pub customer_id: Option<i32>,
83 pub stars: Option<i32>,
84}
85
86#[derive(Insertable, Deserialize)]
87#[table_name = "rating"]
88pub struct AddRating {
89 #[serde(skip_serializing_if = "Option::is_none")]
90 pub comment_text: Option<String>,
91
92 #[serde(skip_serializing_if = "Option::is_none")]
93 pub stars: Option<i32>,
94
95 pub product_id: i32,
96 pub customer_id: i32,
97}
diff --git a/backend/src/schema.rs b/backend/src/schema.rs
new file mode 100644
index 0000000..f08221a
--- /dev/null
+++ b/backend/src/schema.rs
@@ -0,0 +1,61 @@
1table! {
2 cart_items (cart_id, product_id) {
3 cart_id -> Integer,
4 product_id -> Integer,
5 }
6}
7
8table! {
9 customer (id) {
10 id -> Integer,
11 username -> Varchar,
12 password -> Varchar,
13 phone_number -> Varchar,
14 email_id -> Varchar,
15 address -> Nullable<Text>,
16 }
17}
18
19table! {
20 product (id) {
21 id -> Integer,
22 name -> Varchar,
23 kind -> Nullable<Varchar>,
24 price -> Float,
25 description -> Nullable<Varchar>,
26 }
27}
28
29table! {
30 rating (id) {
31 id -> Integer,
32 comment_text -> Nullable<Text>,
33 comment_date -> Nullable<Date>,
34 product_id -> Nullable<Integer>,
35 customer_id -> Nullable<Integer>,
36 stars -> Nullable<Integer>,
37 }
38}
39
40table! {
41 transaction (id) {
42 id -> Integer,
43 payment_type -> Varchar,
44 amount -> Float,
45 customer_id -> Nullable<Integer>,
46 }
47}
48
49joinable!(cart_items -> customer (cart_id));
50joinable!(cart_items -> product (product_id));
51joinable!(rating -> customer (customer_id));
52joinable!(rating -> product (product_id));
53joinable!(transaction -> customer (customer_id));
54
55allow_tables_to_appear_in_same_query!(
56 cart_items,
57 customer,
58 product,
59 rating,
60 transaction,
61);
diff --git a/backend/tests/product/chair.json b/backend/tests/product/chair.json
new file mode 100644
index 0000000..bb13c8b
--- /dev/null
+++ b/backend/tests/product/chair.json
@@ -0,0 +1,6 @@
1{
2 "name": "Urban Ladder Teak Chair",
3 "kind": "Chair",
4 "price": 3500,
5 "description": "Sleek, modern chair for offices and workplaces"
6}
diff --git a/backend/tests/product/dumb_sofa.json b/backend/tests/product/dumb_sofa.json
new file mode 100644
index 0000000..2b09a58
--- /dev/null
+++ b/backend/tests/product/dumb_sofa.json
@@ -0,0 +1,4 @@
1{
2 "name": "Home Town Leather Sofa",
3 "price": 5400
4}
diff --git a/backend/tests/product/smart_sofa.json b/backend/tests/product/smart_sofa.json
new file mode 100644
index 0000000..5d7f7d4
--- /dev/null
+++ b/backend/tests/product/smart_sofa.json
@@ -0,0 +1,6 @@
1{
2 "name": "Home Town Leather Sofa",
3 "kind": "Sofa",
4 "description": "Comfortable, authentic leather, wooden frame sofa, for living rooms",
5 "price": 5400
6}
diff --git a/backend/tests/requests.txt b/backend/tests/requests.txt
new file mode 100644
index 0000000..7e2ca5c
--- /dev/null
+++ b/backend/tests/requests.txt
@@ -0,0 +1,21 @@
1http POST :7878/user/login username=akshay password=password
2
3http POST :7878/user/login username=akshay password=nigga
4
5http POST :7878/user/change_password Cookie: old_password=nigga new_password=nigga
6
7http :7878/user/change_password username=akshay password=password
8
9http :7878/product/catalog
10
11http :7878/product/1
12
13http POST :7878/cart/add Cookie: product_id:=1
14
15http :7878/cart/items Cookie:
16
17http POST :7878/cart/remove Cookie: product_id:=1
18
19http POST :7878/rating/add Cookie: product_id:=1 stars:=3 comment_text=Very good functional chair
20
21http :7878/product/reviews/1
diff --git a/backend/tests/users/add_akshay.json b/backend/tests/users/add_akshay.json
new file mode 100644
index 0000000..1d6c405
--- /dev/null
+++ b/backend/tests/users/add_akshay.json
@@ -0,0 +1,8 @@
1
2{
3 "username": "Akshay",
4 "password": "akshay",
5 "phone_number": "123454234",
6 "email_id": "[email protected]",
7 "address": "Rv College of Engineering, Mysuru Road, 560087, Near Metro station"
8}
diff --git a/backend/tests/users/add_user.json b/backend/tests/users/add_user.json
new file mode 100644
index 0000000..1f481e9
--- /dev/null
+++ b/backend/tests/users/add_user.json
@@ -0,0 +1,7 @@
1{
2 "username": "Ramu Kaka",
3 "password": "ramu123",
4 "phone_number": "123454234",
5 "email_id": "[email protected]",
6 "address": "RA-602, Purva Riviera"
7}