aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-10-04 08:53:46 +0100
committerAkshay <[email protected]>2020-10-04 08:53:46 +0100
commit057382f8d138c63cdc48b0facd9bf4a4a229057a (patch)
treeb30ba227c49918e0e65fc14068307cf11a9248bc
init
-rw-r--r--.gitignore2
-rw-r--r--Cargo.lock2114
-rw-r--r--Cargo.toml24
-rw-r--r--default.nix18
-rw-r--r--diesel.toml5
-rw-r--r--migrations/.gitkeep0
-rw-r--r--migrations/2020-09-22-104623_create_users/down.sql3
-rw-r--r--migrations/2020-09-22-104623_create_users/up.sql8
-rw-r--r--nix/sources.json50
-rw-r--r--nix/sources.nix148
l---------result1
-rw-r--r--rustfmt.toml15
-rw-r--r--shell.nix31
-rw-r--r--src/bin/server.rs44
-rw-r--r--src/handlers/mod.rs2
-rw-r--r--src/handlers/smoke.rs15
-rw-r--r--src/handlers/users.rs106
-rw-r--r--src/handlers/users.rs.html137
-rw-r--r--src/lib.rs10
-rw-r--r--src/models.rs21
-rw-r--r--src/schema.rs9
21 files changed, 2763 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..46b5d68
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
1/target
2.envrc
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..3dcd7dd
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,2114 @@
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",
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.4.0"
41source = "registry+https://github.com/rust-lang/crates.io-index"
42checksum = "d88ea83af46935098feec2e19a28c919b54eb3cbf0e239b330298e2e69d4b76b"
43dependencies = [
44 "actix-service",
45 "actix-web",
46 "derive_more",
47 "futures-util",
48]
49
50[[package]]
51name = "actix-http"
52version = "2.0.0"
53source = "registry+https://github.com/rust-lang/crates.io-index"
54checksum = "05dd80ba8f27c4a34357c07e338c8f5c38f8520e6d626ca1727d8fecc41b0cab"
55dependencies = [
56 "actix-codec",
57 "actix-connect",
58 "actix-rt",
59 "actix-service",
60 "actix-threadpool",
61 "actix-utils",
62 "base64",
63 "bitflags",
64 "brotli2",
65 "bytes",
66 "cookie",
67 "copyless",
68 "derive_more",
69 "either",
70 "encoding_rs",
71 "flate2",
72 "futures-channel",
73 "futures-core",
74 "futures-util",
75 "fxhash",
76 "h2",
77 "http",
78 "httparse",
79 "indexmap",
80 "itoa",
81 "language-tags",
82 "lazy_static",
83 "log",
84 "mime",
85 "percent-encoding 2.1.0",
86 "pin-project",
87 "rand",
88 "regex",
89 "serde",
90 "serde_json",
91 "serde_urlencoded",
92 "sha-1",
93 "slab",
94 "time",
95]
96
97[[package]]
98name = "actix-identity"
99version = "0.3.1"
100source = "registry+https://github.com/rust-lang/crates.io-index"
101checksum = "3263fe74cf505c6f9e18209c89fbdba5569cfd3905a7e907b42aa1c85c18fae5"
102dependencies = [
103 "actix-service",
104 "actix-web",
105 "futures-util",
106 "serde",
107 "serde_json",
108 "time",
109]
110
111[[package]]
112name = "actix-macros"
113version = "0.1.2"
114source = "registry+https://github.com/rust-lang/crates.io-index"
115checksum = "a60f9ba7c4e6df97f3aacb14bb5c0cd7d98a49dcbaed0d7f292912ad9a6a3ed2"
116dependencies = [
117 "quote",
118 "syn",
119]
120
121[[package]]
122name = "actix-router"
123version = "0.2.5"
124source = "registry+https://github.com/rust-lang/crates.io-index"
125checksum = "bbd1f7dbda1645bf7da33554db60891755f6c01c1b2169e2f4c492098d30c235"
126dependencies = [
127 "bytestring",
128 "http",
129 "log",
130 "regex",
131 "serde",
132]
133
134[[package]]
135name = "actix-rt"
136version = "1.1.1"
137source = "registry+https://github.com/rust-lang/crates.io-index"
138checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227"
139dependencies = [
140 "actix-macros",
141 "actix-threadpool",
142 "copyless",
143 "futures-channel",
144 "futures-util",
145 "smallvec",
146 "tokio",
147]
148
149[[package]]
150name = "actix-server"
151version = "1.0.4"
152source = "registry+https://github.com/rust-lang/crates.io-index"
153checksum = "45407e6e672ca24784baa667c5d32ef109ccdd8d5e0b5ebb9ef8a67f4dfb708e"
154dependencies = [
155 "actix-codec",
156 "actix-rt",
157 "actix-service",
158 "actix-utils",
159 "futures-channel",
160 "futures-util",
161 "log",
162 "mio",
163 "mio-uds",
164 "num_cpus",
165 "slab",
166 "socket2",
167]
168
169[[package]]
170name = "actix-service"
171version = "1.0.6"
172source = "registry+https://github.com/rust-lang/crates.io-index"
173checksum = "0052435d581b5be835d11f4eb3bce417c8af18d87ddf8ace99f8e67e595882bb"
174dependencies = [
175 "futures-util",
176 "pin-project",
177]
178
179[[package]]
180name = "actix-testing"
181version = "1.0.1"
182source = "registry+https://github.com/rust-lang/crates.io-index"
183checksum = "47239ca38799ab74ee6a8a94d1ce857014b2ac36f242f70f3f75a66f691e791c"
184dependencies = [
185 "actix-macros",
186 "actix-rt",
187 "actix-server",
188 "actix-service",
189 "log",
190 "socket2",
191]
192
193[[package]]
194name = "actix-threadpool"
195version = "0.3.3"
196source = "registry+https://github.com/rust-lang/crates.io-index"
197checksum = "d209f04d002854b9afd3743032a27b066158817965bf5d036824d19ac2cc0e30"
198dependencies = [
199 "derive_more",
200 "futures-channel",
201 "lazy_static",
202 "log",
203 "num_cpus",
204 "parking_lot",
205 "threadpool",
206]
207
208[[package]]
209name = "actix-tls"
210version = "2.0.0"
211source = "registry+https://github.com/rust-lang/crates.io-index"
212checksum = "24789b7d7361cf5503a504ebe1c10806896f61e96eca9a7350e23001aca715fb"
213dependencies = [
214 "actix-codec",
215 "actix-service",
216 "actix-utils",
217 "futures-util",
218]
219
220[[package]]
221name = "actix-utils"
222version = "2.0.0"
223source = "registry+https://github.com/rust-lang/crates.io-index"
224checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a"
225dependencies = [
226 "actix-codec",
227 "actix-rt",
228 "actix-service",
229 "bitflags",
230 "bytes",
231 "either",
232 "futures-channel",
233 "futures-sink",
234 "futures-util",
235 "log",
236 "pin-project",
237 "slab",
238]
239
240[[package]]
241name = "actix-web"
242version = "3.0.2"
243source = "registry+https://github.com/rust-lang/crates.io-index"
244checksum = "36de80175eb1f0a5c518024ce0d23646b54a23008279e090ca1848f6f1448bf4"
245dependencies = [
246 "actix-codec",
247 "actix-http",
248 "actix-macros",
249 "actix-router",
250 "actix-rt",
251 "actix-server",
252 "actix-service",
253 "actix-testing",
254 "actix-threadpool",
255 "actix-tls",
256 "actix-utils",
257 "actix-web-codegen",
258 "awc",
259 "bytes",
260 "derive_more",
261 "encoding_rs",
262 "futures-channel",
263 "futures-core",
264 "futures-util",
265 "fxhash",
266 "log",
267 "mime",
268 "pin-project",
269 "regex",
270 "serde",
271 "serde_json",
272 "serde_urlencoded",
273 "socket2",
274 "time",
275 "tinyvec",
276 "url 2.1.1",
277]
278
279[[package]]
280name = "actix-web-codegen"
281version = "0.3.0"
282source = "registry+https://github.com/rust-lang/crates.io-index"
283checksum = "750ca8fb60bbdc79491991650ba5d2ae7cd75f3fc00ead51390cfe9efda0d4d8"
284dependencies = [
285 "proc-macro2",
286 "quote",
287 "syn",
288]
289
290[[package]]
291name = "addr2line"
292version = "0.13.0"
293source = "registry+https://github.com/rust-lang/crates.io-index"
294checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072"
295dependencies = [
296 "gimli",
297]
298
299[[package]]
300name = "adler"
301version = "0.2.3"
302source = "registry+https://github.com/rust-lang/crates.io-index"
303checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
304
305[[package]]
306name = "aead"
307version = "0.3.2"
308source = "registry+https://github.com/rust-lang/crates.io-index"
309checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331"
310dependencies = [
311 "generic-array",
312]
313
314[[package]]
315name = "aes"
316version = "0.4.0"
317source = "registry+https://github.com/rust-lang/crates.io-index"
318checksum = "f7001367fde4c768a19d1029f0a8be5abd9308e1119846d5bd9ad26297b8faf5"
319dependencies = [
320 "aes-soft",
321 "aesni",
322 "block-cipher 0.7.1",
323]
324
325[[package]]
326name = "aes-gcm"
327version = "0.6.0"
328source = "registry+https://github.com/rust-lang/crates.io-index"
329checksum = "86f5007801316299f922a6198d1d09a0bae95786815d066d5880d13f7c45ead1"
330dependencies = [
331 "aead",
332 "aes",
333 "block-cipher 0.7.1",
334 "ghash",
335 "subtle",
336]
337
338[[package]]
339name = "aes-soft"
340version = "0.4.0"
341source = "registry+https://github.com/rust-lang/crates.io-index"
342checksum = "4925647ee64e5056cf231608957ce7c81e12d6d6e316b9ce1404778cc1d35fa7"
343dependencies = [
344 "block-cipher 0.7.1",
345 "byteorder",
346 "opaque-debug 0.2.3",
347]
348
349[[package]]
350name = "aesni"
351version = "0.7.0"
352source = "registry+https://github.com/rust-lang/crates.io-index"
353checksum = "d050d39b0b7688b3a3254394c3e30a9d66c41dcf9b05b0e2dbdc623f6505d264"
354dependencies = [
355 "block-cipher 0.7.1",
356 "opaque-debug 0.2.3",
357]
358
359[[package]]
360name = "aho-corasick"
361version = "0.7.13"
362source = "registry+https://github.com/rust-lang/crates.io-index"
363checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
364dependencies = [
365 "memchr",
366]
367
368[[package]]
369name = "arc-swap"
370version = "0.4.7"
371source = "registry+https://github.com/rust-lang/crates.io-index"
372checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
373
374[[package]]
375name = "async-trait"
376version = "0.1.40"
377source = "registry+https://github.com/rust-lang/crates.io-index"
378checksum = "687c230d85c0a52504709705fc8a53e4a692b83a2184f03dae73e38e1e93a783"
379dependencies = [
380 "proc-macro2",
381 "quote",
382 "syn",
383]
384
385[[package]]
386name = "atty"
387version = "0.2.14"
388source = "registry+https://github.com/rust-lang/crates.io-index"
389checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
390dependencies = [
391 "hermit-abi",
392 "libc",
393 "winapi 0.3.9",
394]
395
396[[package]]
397name = "autocfg"
398version = "1.0.1"
399source = "registry+https://github.com/rust-lang/crates.io-index"
400checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
401
402[[package]]
403name = "awc"
404version = "2.0.0"
405source = "registry+https://github.com/rust-lang/crates.io-index"
406checksum = "150e00c06683ab44c5f97d033950e5d87a7a042d06d77f5eecb443cbd23d0575"
407dependencies = [
408 "actix-codec",
409 "actix-http",
410 "actix-rt",
411 "actix-service",
412 "base64",
413 "bytes",
414 "derive_more",
415 "futures-core",
416 "log",
417 "mime",
418 "percent-encoding 2.1.0",
419 "rand",
420 "serde",
421 "serde_json",
422 "serde_urlencoded",
423]
424
425[[package]]
426name = "backtrace"
427version = "0.3.50"
428source = "registry+https://github.com/rust-lang/crates.io-index"
429checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293"
430dependencies = [
431 "addr2line",
432 "cfg-if",
433 "libc",
434 "miniz_oxide",
435 "object",
436 "rustc-demangle",
437]
438
439[[package]]
440name = "base-x"
441version = "0.2.6"
442source = "registry+https://github.com/rust-lang/crates.io-index"
443checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1"
444
445[[package]]
446name = "base64"
447version = "0.12.3"
448source = "registry+https://github.com/rust-lang/crates.io-index"
449checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
450
451[[package]]
452name = "bcrypt"
453version = "0.8.2"
454source = "registry+https://github.com/rust-lang/crates.io-index"
455checksum = "e2cab630912253fb9dc92c0e2fabd0a7b51f5a5a4007177cfa31e517015b7204"
456dependencies = [
457 "base64",
458 "blowfish",
459 "byteorder",
460 "getrandom",
461]
462
463[[package]]
464name = "bitflags"
465version = "1.2.1"
466source = "registry+https://github.com/rust-lang/crates.io-index"
467checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
468
469[[package]]
470name = "block-buffer"
471version = "0.9.0"
472source = "registry+https://github.com/rust-lang/crates.io-index"
473checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
474dependencies = [
475 "generic-array",
476]
477
478[[package]]
479name = "block-cipher"
480version = "0.7.1"
481source = "registry+https://github.com/rust-lang/crates.io-index"
482checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10"
483dependencies = [
484 "generic-array",
485]
486
487[[package]]
488name = "block-cipher"
489version = "0.8.0"
490source = "registry+https://github.com/rust-lang/crates.io-index"
491checksum = "f337a3e6da609650eb74e02bc9fac7b735049f7623ab12f2e4c719316fcc7e80"
492dependencies = [
493 "generic-array",
494]
495
496[[package]]
497name = "blowfish"
498version = "0.6.0"
499source = "registry+https://github.com/rust-lang/crates.io-index"
500checksum = "0f06850ba969bc59388b2cc0a4f186fc6d9d37208863b15b84ae3866ac90ac06"
501dependencies = [
502 "block-cipher 0.8.0",
503 "byteorder",
504 "opaque-debug 0.3.0",
505]
506
507[[package]]
508name = "brotli-sys"
509version = "0.3.2"
510source = "registry+https://github.com/rust-lang/crates.io-index"
511checksum = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd"
512dependencies = [
513 "cc",
514 "libc",
515]
516
517[[package]]
518name = "brotli2"
519version = "0.3.2"
520source = "registry+https://github.com/rust-lang/crates.io-index"
521checksum = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e"
522dependencies = [
523 "brotli-sys",
524 "libc",
525]
526
527[[package]]
528name = "bumpalo"
529version = "3.4.0"
530source = "registry+https://github.com/rust-lang/crates.io-index"
531checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820"
532
533[[package]]
534name = "byteorder"
535version = "1.3.4"
536source = "registry+https://github.com/rust-lang/crates.io-index"
537checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
538
539[[package]]
540name = "bytes"
541version = "0.5.6"
542source = "registry+https://github.com/rust-lang/crates.io-index"
543checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
544
545[[package]]
546name = "bytestring"
547version = "0.1.5"
548source = "registry+https://github.com/rust-lang/crates.io-index"
549checksum = "fc7c05fa5172da78a62d9949d662d2ac89d4cc7355d7b49adee5163f1fb3f363"
550dependencies = [
551 "bytes",
552]
553
554[[package]]
555name = "cc"
556version = "1.0.60"
557source = "registry+https://github.com/rust-lang/crates.io-index"
558checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c"
559
560[[package]]
561name = "cfg-if"
562version = "0.1.10"
563source = "registry+https://github.com/rust-lang/crates.io-index"
564checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
565
566[[package]]
567name = "cloudabi"
568version = "0.1.0"
569source = "registry+https://github.com/rust-lang/crates.io-index"
570checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
571dependencies = [
572 "bitflags",
573]
574
575[[package]]
576name = "const_fn"
577version = "0.4.2"
578source = "registry+https://github.com/rust-lang/crates.io-index"
579checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2"
580
581[[package]]
582name = "cookie"
583version = "0.14.2"
584source = "registry+https://github.com/rust-lang/crates.io-index"
585checksum = "1373a16a4937bc34efec7b391f9c1500c30b8478a701a4f44c9165cc0475a6e0"
586dependencies = [
587 "aes-gcm",
588 "base64",
589 "hkdf",
590 "hmac",
591 "percent-encoding 2.1.0",
592 "rand",
593 "sha2",
594 "time",
595 "version_check",
596]
597
598[[package]]
599name = "copyless"
600version = "0.1.5"
601source = "registry+https://github.com/rust-lang/crates.io-index"
602checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536"
603
604[[package]]
605name = "cpuid-bool"
606version = "0.1.2"
607source = "registry+https://github.com/rust-lang/crates.io-index"
608checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
609
610[[package]]
611name = "crc32fast"
612version = "1.2.0"
613source = "registry+https://github.com/rust-lang/crates.io-index"
614checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
615dependencies = [
616 "cfg-if",
617]
618
619[[package]]
620name = "crypto-mac"
621version = "0.8.0"
622source = "registry+https://github.com/rust-lang/crates.io-index"
623checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab"
624dependencies = [
625 "generic-array",
626 "subtle",
627]
628
629[[package]]
630name = "derive_more"
631version = "0.99.10"
632source = "registry+https://github.com/rust-lang/crates.io-index"
633checksum = "1dcfabdab475c16a93d669dddfc393027803e347d09663f524447f642fbb84ba"
634dependencies = [
635 "proc-macro2",
636 "quote",
637 "syn",
638]
639
640[[package]]
641name = "diesel"
642version = "1.4.5"
643source = "registry+https://github.com/rust-lang/crates.io-index"
644checksum = "3e2de9deab977a153492a1468d1b1c0662c1cf39e5ea87d0c060ecd59ef18d8c"
645dependencies = [
646 "byteorder",
647 "diesel_derives",
648 "mysqlclient-sys",
649 "r2d2",
650 "url 1.7.2",
651]
652
653[[package]]
654name = "diesel_derives"
655version = "1.4.1"
656source = "registry+https://github.com/rust-lang/crates.io-index"
657checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3"
658dependencies = [
659 "proc-macro2",
660 "quote",
661 "syn",
662]
663
664[[package]]
665name = "digest"
666version = "0.9.0"
667source = "registry+https://github.com/rust-lang/crates.io-index"
668checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
669dependencies = [
670 "generic-array",
671]
672
673[[package]]
674name = "discard"
675version = "1.0.4"
676source = "registry+https://github.com/rust-lang/crates.io-index"
677checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0"
678
679[[package]]
680name = "dtoa"
681version = "0.4.6"
682source = "registry+https://github.com/rust-lang/crates.io-index"
683checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b"
684
685[[package]]
686name = "either"
687version = "1.6.1"
688source = "registry+https://github.com/rust-lang/crates.io-index"
689checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
690
691[[package]]
692name = "encoding_rs"
693version = "0.8.24"
694source = "registry+https://github.com/rust-lang/crates.io-index"
695checksum = "a51b8cf747471cb9499b6d59e59b0444f4c90eba8968c4e44874e92b5b64ace2"
696dependencies = [
697 "cfg-if",
698]
699
700[[package]]
701name = "enum-as-inner"
702version = "0.3.3"
703source = "registry+https://github.com/rust-lang/crates.io-index"
704checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595"
705dependencies = [
706 "heck",
707 "proc-macro2",
708 "quote",
709 "syn",
710]
711
712[[package]]
713name = "env_logger"
714version = "0.7.1"
715source = "registry+https://github.com/rust-lang/crates.io-index"
716checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
717dependencies = [
718 "atty",
719 "humantime",
720 "log",
721 "regex",
722 "termcolor",
723]
724
725[[package]]
726name = "flate2"
727version = "1.0.17"
728source = "registry+https://github.com/rust-lang/crates.io-index"
729checksum = "766d0e77a2c1502169d4a93ff3b8c15a71fd946cd0126309752104e5f3c46d94"
730dependencies = [
731 "cfg-if",
732 "crc32fast",
733 "libc",
734 "miniz_oxide",
735]
736
737[[package]]
738name = "fnv"
739version = "1.0.7"
740source = "registry+https://github.com/rust-lang/crates.io-index"
741checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
742
743[[package]]
744name = "fuchsia-zircon"
745version = "0.3.3"
746source = "registry+https://github.com/rust-lang/crates.io-index"
747checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
748dependencies = [
749 "bitflags",
750 "fuchsia-zircon-sys",
751]
752
753[[package]]
754name = "fuchsia-zircon-sys"
755version = "0.3.3"
756source = "registry+https://github.com/rust-lang/crates.io-index"
757checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
758
759[[package]]
760name = "furby"
761version = "0.1.0"
762dependencies = [
763 "actix-cors",
764 "actix-identity",
765 "actix-web",
766 "bcrypt",
767 "diesel",
768 "log",
769 "pretty_env_logger",
770 "rand",
771 "serde",
772 "serde_derive",
773 "serde_json",
774]
775
776[[package]]
777name = "futures"
778version = "0.3.5"
779source = "registry+https://github.com/rust-lang/crates.io-index"
780checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
781dependencies = [
782 "futures-channel",
783 "futures-core",
784 "futures-io",
785 "futures-sink",
786 "futures-task",
787 "futures-util",
788]
789
790[[package]]
791name = "futures-channel"
792version = "0.3.5"
793source = "registry+https://github.com/rust-lang/crates.io-index"
794checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5"
795dependencies = [
796 "futures-core",
797 "futures-sink",
798]
799
800[[package]]
801name = "futures-core"
802version = "0.3.5"
803source = "registry+https://github.com/rust-lang/crates.io-index"
804checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399"
805
806[[package]]
807name = "futures-io"
808version = "0.3.5"
809source = "registry+https://github.com/rust-lang/crates.io-index"
810checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"
811
812[[package]]
813name = "futures-macro"
814version = "0.3.5"
815source = "registry+https://github.com/rust-lang/crates.io-index"
816checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39"
817dependencies = [
818 "proc-macro-hack",
819 "proc-macro2",
820 "quote",
821 "syn",
822]
823
824[[package]]
825name = "futures-sink"
826version = "0.3.5"
827source = "registry+https://github.com/rust-lang/crates.io-index"
828checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc"
829
830[[package]]
831name = "futures-task"
832version = "0.3.5"
833source = "registry+https://github.com/rust-lang/crates.io-index"
834checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
835dependencies = [
836 "once_cell",
837]
838
839[[package]]
840name = "futures-util"
841version = "0.3.5"
842source = "registry+https://github.com/rust-lang/crates.io-index"
843checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
844dependencies = [
845 "futures-channel",
846 "futures-core",
847 "futures-io",
848 "futures-macro",
849 "futures-sink",
850 "futures-task",
851 "memchr",
852 "pin-project",
853 "pin-utils",
854 "proc-macro-hack",
855 "proc-macro-nested",
856 "slab",
857]
858
859[[package]]
860name = "fxhash"
861version = "0.2.1"
862source = "registry+https://github.com/rust-lang/crates.io-index"
863checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
864dependencies = [
865 "byteorder",
866]
867
868[[package]]
869name = "generic-array"
870version = "0.14.4"
871source = "registry+https://github.com/rust-lang/crates.io-index"
872checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
873dependencies = [
874 "typenum",
875 "version_check",
876]
877
878[[package]]
879name = "getrandom"
880version = "0.1.15"
881source = "registry+https://github.com/rust-lang/crates.io-index"
882checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
883dependencies = [
884 "cfg-if",
885 "libc",
886 "wasi",
887]
888
889[[package]]
890name = "ghash"
891version = "0.3.0"
892source = "registry+https://github.com/rust-lang/crates.io-index"
893checksum = "d6e27f0689a6e15944bdce7e45425efb87eaa8ab0c6e87f11d0987a9133e2531"
894dependencies = [
895 "polyval",
896]
897
898[[package]]
899name = "gimli"
900version = "0.22.0"
901source = "registry+https://github.com/rust-lang/crates.io-index"
902checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724"
903
904[[package]]
905name = "h2"
906version = "0.2.6"
907source = "registry+https://github.com/rust-lang/crates.io-index"
908checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53"
909dependencies = [
910 "bytes",
911 "fnv",
912 "futures-core",
913 "futures-sink",
914 "futures-util",
915 "http",
916 "indexmap",
917 "slab",
918 "tokio",
919 "tokio-util",
920 "tracing",
921]
922
923[[package]]
924name = "hashbrown"
925version = "0.9.0"
926source = "registry+https://github.com/rust-lang/crates.io-index"
927checksum = "00d63df3d41950fb462ed38308eea019113ad1508da725bbedcd0fa5a85ef5f7"
928
929[[package]]
930name = "heck"
931version = "0.3.1"
932source = "registry+https://github.com/rust-lang/crates.io-index"
933checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
934dependencies = [
935 "unicode-segmentation",
936]
937
938[[package]]
939name = "hermit-abi"
940version = "0.1.16"
941source = "registry+https://github.com/rust-lang/crates.io-index"
942checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151"
943dependencies = [
944 "libc",
945]
946
947[[package]]
948name = "hkdf"
949version = "0.9.0"
950source = "registry+https://github.com/rust-lang/crates.io-index"
951checksum = "fe1149865383e4526a43aee8495f9a325f0b806c63ce6427d06336a590abbbc9"
952dependencies = [
953 "digest",
954 "hmac",
955]
956
957[[package]]
958name = "hmac"
959version = "0.8.1"
960source = "registry+https://github.com/rust-lang/crates.io-index"
961checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840"
962dependencies = [
963 "crypto-mac",
964 "digest",
965]
966
967[[package]]
968name = "hostname"
969version = "0.3.1"
970source = "registry+https://github.com/rust-lang/crates.io-index"
971checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867"
972dependencies = [
973 "libc",
974 "match_cfg",
975 "winapi 0.3.9",
976]
977
978[[package]]
979name = "http"
980version = "0.2.1"
981source = "registry+https://github.com/rust-lang/crates.io-index"
982checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9"
983dependencies = [
984 "bytes",
985 "fnv",
986 "itoa",
987]
988
989[[package]]
990name = "httparse"
991version = "1.3.4"
992source = "registry+https://github.com/rust-lang/crates.io-index"
993checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9"
994
995[[package]]
996name = "humantime"
997version = "1.3.0"
998source = "registry+https://github.com/rust-lang/crates.io-index"
999checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
1000dependencies = [
1001 "quick-error",
1002]
1003
1004[[package]]
1005name = "idna"
1006version = "0.1.5"
1007source = "registry+https://github.com/rust-lang/crates.io-index"
1008checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
1009dependencies = [
1010 "matches",
1011 "unicode-bidi",
1012 "unicode-normalization",
1013]
1014
1015[[package]]
1016name = "idna"
1017version = "0.2.0"
1018source = "registry+https://github.com/rust-lang/crates.io-index"
1019checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9"
1020dependencies = [
1021 "matches",
1022 "unicode-bidi",
1023 "unicode-normalization",
1024]
1025
1026[[package]]
1027name = "indexmap"
1028version = "1.6.0"
1029source = "registry+https://github.com/rust-lang/crates.io-index"
1030checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2"
1031dependencies = [
1032 "autocfg",
1033 "hashbrown",
1034]
1035
1036[[package]]
1037name = "instant"
1038version = "0.1.7"
1039source = "registry+https://github.com/rust-lang/crates.io-index"
1040checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66"
1041dependencies = [
1042 "cfg-if",
1043]
1044
1045[[package]]
1046name = "iovec"
1047version = "0.1.4"
1048source = "registry+https://github.com/rust-lang/crates.io-index"
1049checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
1050dependencies = [
1051 "libc",
1052]
1053
1054[[package]]
1055name = "ipconfig"
1056version = "0.2.2"
1057source = "registry+https://github.com/rust-lang/crates.io-index"
1058checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7"
1059dependencies = [
1060 "socket2",
1061 "widestring",
1062 "winapi 0.3.9",
1063 "winreg",
1064]
1065
1066[[package]]
1067name = "itoa"
1068version = "0.4.6"
1069source = "registry+https://github.com/rust-lang/crates.io-index"
1070checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
1071
1072[[package]]
1073name = "kernel32-sys"
1074version = "0.2.2"
1075source = "registry+https://github.com/rust-lang/crates.io-index"
1076checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
1077dependencies = [
1078 "winapi 0.2.8",
1079 "winapi-build",
1080]
1081
1082[[package]]
1083name = "language-tags"
1084version = "0.2.2"
1085source = "registry+https://github.com/rust-lang/crates.io-index"
1086checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
1087
1088[[package]]
1089name = "lazy_static"
1090version = "1.4.0"
1091source = "registry+https://github.com/rust-lang/crates.io-index"
1092checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
1093
1094[[package]]
1095name = "libc"
1096version = "0.2.77"
1097source = "registry+https://github.com/rust-lang/crates.io-index"
1098checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
1099
1100[[package]]
1101name = "linked-hash-map"
1102version = "0.5.3"
1103source = "registry+https://github.com/rust-lang/crates.io-index"
1104checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a"
1105
1106[[package]]
1107name = "lock_api"
1108version = "0.4.1"
1109source = "registry+https://github.com/rust-lang/crates.io-index"
1110checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c"
1111dependencies = [
1112 "scopeguard",
1113]
1114
1115[[package]]
1116name = "log"
1117version = "0.4.11"
1118source = "registry+https://github.com/rust-lang/crates.io-index"
1119checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
1120dependencies = [
1121 "cfg-if",
1122]
1123
1124[[package]]
1125name = "lru-cache"
1126version = "0.1.2"
1127source = "registry+https://github.com/rust-lang/crates.io-index"
1128checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c"
1129dependencies = [
1130 "linked-hash-map",
1131]
1132
1133[[package]]
1134name = "match_cfg"
1135version = "0.1.0"
1136source = "registry+https://github.com/rust-lang/crates.io-index"
1137checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4"
1138
1139[[package]]
1140name = "matches"
1141version = "0.1.8"
1142source = "registry+https://github.com/rust-lang/crates.io-index"
1143checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
1144
1145[[package]]
1146name = "memchr"
1147version = "2.3.3"
1148source = "registry+https://github.com/rust-lang/crates.io-index"
1149checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
1150
1151[[package]]
1152name = "mime"
1153version = "0.3.16"
1154source = "registry+https://github.com/rust-lang/crates.io-index"
1155checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
1156
1157[[package]]
1158name = "miniz_oxide"
1159version = "0.4.2"
1160source = "registry+https://github.com/rust-lang/crates.io-index"
1161checksum = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9"
1162dependencies = [
1163 "adler",
1164 "autocfg",
1165]
1166
1167[[package]]
1168name = "mio"
1169version = "0.6.22"
1170source = "registry+https://github.com/rust-lang/crates.io-index"
1171checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430"
1172dependencies = [
1173 "cfg-if",
1174 "fuchsia-zircon",
1175 "fuchsia-zircon-sys",
1176 "iovec",
1177 "kernel32-sys",
1178 "libc",
1179 "log",
1180 "miow",
1181 "net2",
1182 "slab",
1183 "winapi 0.2.8",
1184]
1185
1186[[package]]
1187name = "mio-uds"
1188version = "0.6.8"
1189source = "registry+https://github.com/rust-lang/crates.io-index"
1190checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0"
1191dependencies = [
1192 "iovec",
1193 "libc",
1194 "mio",
1195]
1196
1197[[package]]
1198name = "miow"
1199version = "0.2.1"
1200source = "registry+https://github.com/rust-lang/crates.io-index"
1201checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
1202dependencies = [
1203 "kernel32-sys",
1204 "net2",
1205 "winapi 0.2.8",
1206 "ws2_32-sys",
1207]
1208
1209[[package]]
1210name = "mysqlclient-sys"
1211version = "0.2.4"
1212source = "registry+https://github.com/rust-lang/crates.io-index"
1213checksum = "7e9637d93448044078aaafea7419aed69d301b4a12bcc4aa0ae856eb169bef85"
1214dependencies = [
1215 "pkg-config",
1216 "vcpkg",
1217]
1218
1219[[package]]
1220name = "net2"
1221version = "0.2.35"
1222source = "registry+https://github.com/rust-lang/crates.io-index"
1223checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853"
1224dependencies = [
1225 "cfg-if",
1226 "libc",
1227 "winapi 0.3.9",
1228]
1229
1230[[package]]
1231name = "num_cpus"
1232version = "1.13.0"
1233source = "registry+https://github.com/rust-lang/crates.io-index"
1234checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
1235dependencies = [
1236 "hermit-abi",
1237 "libc",
1238]
1239
1240[[package]]
1241name = "object"
1242version = "0.20.0"
1243source = "registry+https://github.com/rust-lang/crates.io-index"
1244checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
1245
1246[[package]]
1247name = "once_cell"
1248version = "1.4.1"
1249source = "registry+https://github.com/rust-lang/crates.io-index"
1250checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
1251
1252[[package]]
1253name = "opaque-debug"
1254version = "0.2.3"
1255source = "registry+https://github.com/rust-lang/crates.io-index"
1256checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
1257
1258[[package]]
1259name = "opaque-debug"
1260version = "0.3.0"
1261source = "registry+https://github.com/rust-lang/crates.io-index"
1262checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
1263
1264[[package]]
1265name = "parking_lot"
1266version = "0.11.0"
1267source = "registry+https://github.com/rust-lang/crates.io-index"
1268checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
1269dependencies = [
1270 "instant",
1271 "lock_api",
1272 "parking_lot_core",
1273]
1274
1275[[package]]
1276name = "parking_lot_core"
1277version = "0.8.0"
1278source = "registry+https://github.com/rust-lang/crates.io-index"
1279checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
1280dependencies = [
1281 "cfg-if",
1282 "cloudabi",
1283 "instant",
1284 "libc",
1285 "redox_syscall",
1286 "smallvec",
1287 "winapi 0.3.9",
1288]
1289
1290[[package]]
1291name = "percent-encoding"
1292version = "1.0.1"
1293source = "registry+https://github.com/rust-lang/crates.io-index"
1294checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
1295
1296[[package]]
1297name = "percent-encoding"
1298version = "2.1.0"
1299source = "registry+https://github.com/rust-lang/crates.io-index"
1300checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
1301
1302[[package]]
1303name = "pin-project"
1304version = "0.4.23"
1305source = "registry+https://github.com/rust-lang/crates.io-index"
1306checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa"
1307dependencies = [
1308 "pin-project-internal",
1309]
1310
1311[[package]]
1312name = "pin-project-internal"
1313version = "0.4.23"
1314source = "registry+https://github.com/rust-lang/crates.io-index"
1315checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f"
1316dependencies = [
1317 "proc-macro2",
1318 "quote",
1319 "syn",
1320]
1321
1322[[package]]
1323name = "pin-project-lite"
1324version = "0.1.7"
1325source = "registry+https://github.com/rust-lang/crates.io-index"
1326checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715"
1327
1328[[package]]
1329name = "pin-utils"
1330version = "0.1.0"
1331source = "registry+https://github.com/rust-lang/crates.io-index"
1332checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1333
1334[[package]]
1335name = "pkg-config"
1336version = "0.3.18"
1337source = "registry+https://github.com/rust-lang/crates.io-index"
1338checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33"
1339
1340[[package]]
1341name = "polyval"
1342version = "0.4.0"
1343source = "registry+https://github.com/rust-lang/crates.io-index"
1344checksum = "d9a50142b55ab3ed0e9f68dfb3709f1d90d29da24e91033f28b96330643107dc"
1345dependencies = [
1346 "cfg-if",
1347 "universal-hash",
1348]
1349
1350[[package]]
1351name = "ppv-lite86"
1352version = "0.2.9"
1353source = "registry+https://github.com/rust-lang/crates.io-index"
1354checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
1355
1356[[package]]
1357name = "pretty_env_logger"
1358version = "0.4.0"
1359source = "registry+https://github.com/rust-lang/crates.io-index"
1360checksum = "926d36b9553851b8b0005f1275891b392ee4d2d833852c417ed025477350fb9d"
1361dependencies = [
1362 "env_logger",
1363 "log",
1364]
1365
1366[[package]]
1367name = "proc-macro-hack"
1368version = "0.5.18"
1369source = "registry+https://github.com/rust-lang/crates.io-index"
1370checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598"
1371
1372[[package]]
1373name = "proc-macro-nested"
1374version = "0.1.6"
1375source = "registry+https://github.com/rust-lang/crates.io-index"
1376checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a"
1377
1378[[package]]
1379name = "proc-macro2"
1380version = "1.0.21"
1381source = "registry+https://github.com/rust-lang/crates.io-index"
1382checksum = "36e28516df94f3dd551a587da5357459d9b36d945a7c37c3557928c1c2ff2a2c"
1383dependencies = [
1384 "unicode-xid",
1385]
1386
1387[[package]]
1388name = "quick-error"
1389version = "1.2.3"
1390source = "registry+https://github.com/rust-lang/crates.io-index"
1391checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
1392
1393[[package]]
1394name = "quote"
1395version = "1.0.7"
1396source = "registry+https://github.com/rust-lang/crates.io-index"
1397checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
1398dependencies = [
1399 "proc-macro2",
1400]
1401
1402[[package]]
1403name = "r2d2"
1404version = "0.8.9"
1405source = "registry+https://github.com/rust-lang/crates.io-index"
1406checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f"
1407dependencies = [
1408 "log",
1409 "parking_lot",
1410 "scheduled-thread-pool",
1411]
1412
1413[[package]]
1414name = "rand"
1415version = "0.7.3"
1416source = "registry+https://github.com/rust-lang/crates.io-index"
1417checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
1418dependencies = [
1419 "getrandom",
1420 "libc",
1421 "rand_chacha",
1422 "rand_core",
1423 "rand_hc",
1424]
1425
1426[[package]]
1427name = "rand_chacha"
1428version = "0.2.2"
1429source = "registry+https://github.com/rust-lang/crates.io-index"
1430checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
1431dependencies = [
1432 "ppv-lite86",
1433 "rand_core",
1434]
1435
1436[[package]]
1437name = "rand_core"
1438version = "0.5.1"
1439source = "registry+https://github.com/rust-lang/crates.io-index"
1440checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
1441dependencies = [
1442 "getrandom",
1443]
1444
1445[[package]]
1446name = "rand_hc"
1447version = "0.2.0"
1448source = "registry+https://github.com/rust-lang/crates.io-index"
1449checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
1450dependencies = [
1451 "rand_core",
1452]
1453
1454[[package]]
1455name = "redox_syscall"
1456version = "0.1.57"
1457source = "registry+https://github.com/rust-lang/crates.io-index"
1458checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
1459
1460[[package]]
1461name = "regex"
1462version = "1.3.9"
1463source = "registry+https://github.com/rust-lang/crates.io-index"
1464checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6"
1465dependencies = [
1466 "aho-corasick",
1467 "memchr",
1468 "regex-syntax",
1469 "thread_local",
1470]
1471
1472[[package]]
1473name = "regex-syntax"
1474version = "0.6.18"
1475source = "registry+https://github.com/rust-lang/crates.io-index"
1476checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
1477
1478[[package]]
1479name = "resolv-conf"
1480version = "0.6.3"
1481source = "registry+https://github.com/rust-lang/crates.io-index"
1482checksum = "11834e137f3b14e309437a8276714eed3a80d1ef894869e510f2c0c0b98b9f4a"
1483dependencies = [
1484 "hostname",
1485 "quick-error",
1486]
1487
1488[[package]]
1489name = "rustc-demangle"
1490version = "0.1.16"
1491source = "registry+https://github.com/rust-lang/crates.io-index"
1492checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
1493
1494[[package]]
1495name = "rustc_version"
1496version = "0.2.3"
1497source = "registry+https://github.com/rust-lang/crates.io-index"
1498checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
1499dependencies = [
1500 "semver",
1501]
1502
1503[[package]]
1504name = "ryu"
1505version = "1.0.5"
1506source = "registry+https://github.com/rust-lang/crates.io-index"
1507checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
1508
1509[[package]]
1510name = "scheduled-thread-pool"
1511version = "0.2.5"
1512source = "registry+https://github.com/rust-lang/crates.io-index"
1513checksum = "dc6f74fd1204073fa02d5d5d68bec8021be4c38690b61264b2fdb48083d0e7d7"
1514dependencies = [
1515 "parking_lot",
1516]
1517
1518[[package]]
1519name = "scopeguard"
1520version = "1.1.0"
1521source = "registry+https://github.com/rust-lang/crates.io-index"
1522checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
1523
1524[[package]]
1525name = "semver"
1526version = "0.9.0"
1527source = "registry+https://github.com/rust-lang/crates.io-index"
1528checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
1529dependencies = [
1530 "semver-parser",
1531]
1532
1533[[package]]
1534name = "semver-parser"
1535version = "0.7.0"
1536source = "registry+https://github.com/rust-lang/crates.io-index"
1537checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
1538
1539[[package]]
1540name = "serde"
1541version = "1.0.116"
1542source = "registry+https://github.com/rust-lang/crates.io-index"
1543checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5"
1544dependencies = [
1545 "serde_derive",
1546]
1547
1548[[package]]
1549name = "serde_derive"
1550version = "1.0.116"
1551source = "registry+https://github.com/rust-lang/crates.io-index"
1552checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8"
1553dependencies = [
1554 "proc-macro2",
1555 "quote",
1556 "syn",
1557]
1558
1559[[package]]
1560name = "serde_json"
1561version = "1.0.57"
1562source = "registry+https://github.com/rust-lang/crates.io-index"
1563checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c"
1564dependencies = [
1565 "itoa",
1566 "ryu",
1567 "serde",
1568]
1569
1570[[package]]
1571name = "serde_urlencoded"
1572version = "0.6.1"
1573source = "registry+https://github.com/rust-lang/crates.io-index"
1574checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97"
1575dependencies = [
1576 "dtoa",
1577 "itoa",
1578 "serde",
1579 "url 2.1.1",
1580]
1581
1582[[package]]
1583name = "sha-1"
1584version = "0.9.1"
1585source = "registry+https://github.com/rust-lang/crates.io-index"
1586checksum = "170a36ea86c864a3f16dd2687712dd6646f7019f301e57537c7f4dc9f5916770"
1587dependencies = [
1588 "block-buffer",
1589 "cfg-if",
1590 "cpuid-bool",
1591 "digest",
1592 "opaque-debug 0.3.0",
1593]
1594
1595[[package]]
1596name = "sha1"
1597version = "0.6.0"
1598source = "registry+https://github.com/rust-lang/crates.io-index"
1599checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d"
1600
1601[[package]]
1602name = "sha2"
1603version = "0.9.1"
1604source = "registry+https://github.com/rust-lang/crates.io-index"
1605checksum = "2933378ddfeda7ea26f48c555bdad8bb446bf8a3d17832dc83e380d444cfb8c1"
1606dependencies = [
1607 "block-buffer",
1608 "cfg-if",
1609 "cpuid-bool",
1610 "digest",
1611 "opaque-debug 0.3.0",
1612]
1613
1614[[package]]
1615name = "signal-hook-registry"
1616version = "1.2.1"
1617source = "registry+https://github.com/rust-lang/crates.io-index"
1618checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035"
1619dependencies = [
1620 "arc-swap",
1621 "libc",
1622]
1623
1624[[package]]
1625name = "slab"
1626version = "0.4.2"
1627source = "registry+https://github.com/rust-lang/crates.io-index"
1628checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
1629
1630[[package]]
1631name = "smallvec"
1632version = "1.4.2"
1633source = "registry+https://github.com/rust-lang/crates.io-index"
1634checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
1635
1636[[package]]
1637name = "socket2"
1638version = "0.3.15"
1639source = "registry+https://github.com/rust-lang/crates.io-index"
1640checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44"
1641dependencies = [
1642 "cfg-if",
1643 "libc",
1644 "redox_syscall",
1645 "winapi 0.3.9",
1646]
1647
1648[[package]]
1649name = "standback"
1650version = "0.2.10"
1651source = "registry+https://github.com/rust-lang/crates.io-index"
1652checksum = "33a71ea1ea5f8747d1af1979bfb7e65c3a025a70609f04ceb78425bc5adad8e6"
1653dependencies = [
1654 "version_check",
1655]
1656
1657[[package]]
1658name = "stdweb"
1659version = "0.4.20"
1660source = "registry+https://github.com/rust-lang/crates.io-index"
1661checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5"
1662dependencies = [
1663 "discard",
1664 "rustc_version",
1665 "stdweb-derive",
1666 "stdweb-internal-macros",
1667 "stdweb-internal-runtime",
1668 "wasm-bindgen",
1669]
1670
1671[[package]]
1672name = "stdweb-derive"
1673version = "0.5.3"
1674source = "registry+https://github.com/rust-lang/crates.io-index"
1675checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
1676dependencies = [
1677 "proc-macro2",
1678 "quote",
1679 "serde",
1680 "serde_derive",
1681 "syn",
1682]
1683
1684[[package]]
1685name = "stdweb-internal-macros"
1686version = "0.2.9"
1687source = "registry+https://github.com/rust-lang/crates.io-index"
1688checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11"
1689dependencies = [
1690 "base-x",
1691 "proc-macro2",
1692 "quote",
1693 "serde",
1694 "serde_derive",
1695 "serde_json",
1696 "sha1",
1697 "syn",
1698]
1699
1700[[package]]
1701name = "stdweb-internal-runtime"
1702version = "0.1.5"
1703source = "registry+https://github.com/rust-lang/crates.io-index"
1704checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0"
1705
1706[[package]]
1707name = "subtle"
1708version = "2.3.0"
1709source = "registry+https://github.com/rust-lang/crates.io-index"
1710checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd"
1711
1712[[package]]
1713name = "syn"
1714version = "1.0.41"
1715source = "registry+https://github.com/rust-lang/crates.io-index"
1716checksum = "6690e3e9f692504b941dc6c3b188fd28df054f7fb8469ab40680df52fdcc842b"
1717dependencies = [
1718 "proc-macro2",
1719 "quote",
1720 "unicode-xid",
1721]
1722
1723[[package]]
1724name = "termcolor"
1725version = "1.1.0"
1726source = "registry+https://github.com/rust-lang/crates.io-index"
1727checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
1728dependencies = [
1729 "winapi-util",
1730]
1731
1732[[package]]
1733name = "thiserror"
1734version = "1.0.20"
1735source = "registry+https://github.com/rust-lang/crates.io-index"
1736checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08"
1737dependencies = [
1738 "thiserror-impl",
1739]
1740
1741[[package]]
1742name = "thiserror-impl"
1743version = "1.0.20"
1744source = "registry+https://github.com/rust-lang/crates.io-index"
1745checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793"
1746dependencies = [
1747 "proc-macro2",
1748 "quote",
1749 "syn",
1750]
1751
1752[[package]]
1753name = "thread_local"
1754version = "1.0.1"
1755source = "registry+https://github.com/rust-lang/crates.io-index"
1756checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
1757dependencies = [
1758 "lazy_static",
1759]
1760
1761[[package]]
1762name = "threadpool"
1763version = "1.8.1"
1764source = "registry+https://github.com/rust-lang/crates.io-index"
1765checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa"
1766dependencies = [
1767 "num_cpus",
1768]
1769
1770[[package]]
1771name = "time"
1772version = "0.2.21"
1773source = "registry+https://github.com/rust-lang/crates.io-index"
1774checksum = "2c2e31fb28e2a9f01f5ed6901b066c1ba2333c04b64dc61254142bafcb3feb2c"
1775dependencies = [
1776 "const_fn",
1777 "libc",
1778 "standback",
1779 "stdweb",
1780 "time-macros",
1781 "version_check",
1782 "winapi 0.3.9",
1783]
1784
1785[[package]]
1786name = "time-macros"
1787version = "0.1.0"
1788source = "registry+https://github.com/rust-lang/crates.io-index"
1789checksum = "9ae9b6e9f095bc105e183e3cd493d72579be3181ad4004fceb01adbe9eecab2d"
1790dependencies = [
1791 "proc-macro-hack",
1792 "time-macros-impl",
1793]
1794
1795[[package]]
1796name = "time-macros-impl"
1797version = "0.1.1"
1798source = "registry+https://github.com/rust-lang/crates.io-index"
1799checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa"
1800dependencies = [
1801 "proc-macro-hack",
1802 "proc-macro2",
1803 "quote",
1804 "standback",
1805 "syn",
1806]
1807
1808[[package]]
1809name = "tinyvec"
1810version = "0.3.4"
1811source = "registry+https://github.com/rust-lang/crates.io-index"
1812checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117"
1813
1814[[package]]
1815name = "tokio"
1816version = "0.2.22"
1817source = "registry+https://github.com/rust-lang/crates.io-index"
1818checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd"
1819dependencies = [
1820 "bytes",
1821 "futures-core",
1822 "iovec",
1823 "lazy_static",
1824 "libc",
1825 "memchr",
1826 "mio",
1827 "mio-uds",
1828 "pin-project-lite",
1829 "signal-hook-registry",
1830 "slab",
1831 "winapi 0.3.9",
1832]
1833
1834[[package]]
1835name = "tokio-util"
1836version = "0.3.1"
1837source = "registry+https://github.com/rust-lang/crates.io-index"
1838checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499"
1839dependencies = [
1840 "bytes",
1841 "futures-core",
1842 "futures-sink",
1843 "log",
1844 "pin-project-lite",
1845 "tokio",
1846]
1847
1848[[package]]
1849name = "tracing"
1850version = "0.1.19"
1851source = "registry+https://github.com/rust-lang/crates.io-index"
1852checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c"
1853dependencies = [
1854 "cfg-if",
1855 "log",
1856 "tracing-core",
1857]
1858
1859[[package]]
1860name = "tracing-core"
1861version = "0.1.16"
1862source = "registry+https://github.com/rust-lang/crates.io-index"
1863checksum = "5bcf46c1f1f06aeea2d6b81f3c863d0930a596c86ad1920d4e5bad6dd1d7119a"
1864dependencies = [
1865 "lazy_static",
1866]
1867
1868[[package]]
1869name = "trust-dns-proto"
1870version = "0.19.5"
1871source = "registry+https://github.com/rust-lang/crates.io-index"
1872checksum = "cdd7061ba6f4d4d9721afedffbfd403f20f39a4301fee1b70d6fcd09cca69f28"
1873dependencies = [
1874 "async-trait",
1875 "backtrace",
1876 "enum-as-inner",
1877 "futures",
1878 "idna 0.2.0",
1879 "lazy_static",
1880 "log",
1881 "rand",
1882 "smallvec",
1883 "thiserror",
1884 "tokio",
1885 "url 2.1.1",
1886]
1887
1888[[package]]
1889name = "trust-dns-resolver"
1890version = "0.19.5"
1891source = "registry+https://github.com/rust-lang/crates.io-index"
1892checksum = "0f23cdfdc3d8300b3c50c9e84302d3bd6d860fb9529af84ace6cf9665f181b77"
1893dependencies = [
1894 "backtrace",
1895 "cfg-if",
1896 "futures",
1897 "ipconfig",
1898 "lazy_static",
1899 "log",
1900 "lru-cache",
1901 "resolv-conf",
1902 "smallvec",
1903 "thiserror",
1904 "tokio",
1905 "trust-dns-proto",
1906]
1907
1908[[package]]
1909name = "typenum"
1910version = "1.12.0"
1911source = "registry+https://github.com/rust-lang/crates.io-index"
1912checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
1913
1914[[package]]
1915name = "unicode-bidi"
1916version = "0.3.4"
1917source = "registry+https://github.com/rust-lang/crates.io-index"
1918checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
1919dependencies = [
1920 "matches",
1921]
1922
1923[[package]]
1924name = "unicode-normalization"
1925version = "0.1.13"
1926source = "registry+https://github.com/rust-lang/crates.io-index"
1927checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977"
1928dependencies = [
1929 "tinyvec",
1930]
1931
1932[[package]]
1933name = "unicode-segmentation"
1934version = "1.6.0"
1935source = "registry+https://github.com/rust-lang/crates.io-index"
1936checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
1937
1938[[package]]
1939name = "unicode-xid"
1940version = "0.2.1"
1941source = "registry+https://github.com/rust-lang/crates.io-index"
1942checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
1943
1944[[package]]
1945name = "universal-hash"
1946version = "0.4.0"
1947source = "registry+https://github.com/rust-lang/crates.io-index"
1948checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402"
1949dependencies = [
1950 "generic-array",
1951 "subtle",
1952]
1953
1954[[package]]
1955name = "url"
1956version = "1.7.2"
1957source = "registry+https://github.com/rust-lang/crates.io-index"
1958checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a"
1959dependencies = [
1960 "idna 0.1.5",
1961 "matches",
1962 "percent-encoding 1.0.1",
1963]
1964
1965[[package]]
1966name = "url"
1967version = "2.1.1"
1968source = "registry+https://github.com/rust-lang/crates.io-index"
1969checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb"
1970dependencies = [
1971 "idna 0.2.0",
1972 "matches",
1973 "percent-encoding 2.1.0",
1974]
1975
1976[[package]]
1977name = "vcpkg"
1978version = "0.2.10"
1979source = "registry+https://github.com/rust-lang/crates.io-index"
1980checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
1981
1982[[package]]
1983name = "version_check"
1984version = "0.9.2"
1985source = "registry+https://github.com/rust-lang/crates.io-index"
1986checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
1987
1988[[package]]
1989name = "wasi"
1990version = "0.9.0+wasi-snapshot-preview1"
1991source = "registry+https://github.com/rust-lang/crates.io-index"
1992checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
1993
1994[[package]]
1995name = "wasm-bindgen"
1996version = "0.2.68"
1997source = "registry+https://github.com/rust-lang/crates.io-index"
1998checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42"
1999dependencies = [
2000 "cfg-if",
2001 "wasm-bindgen-macro",
2002]
2003
2004[[package]]
2005name = "wasm-bindgen-backend"
2006version = "0.2.68"
2007source = "registry+https://github.com/rust-lang/crates.io-index"
2008checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68"
2009dependencies = [
2010 "bumpalo",
2011 "lazy_static",
2012 "log",
2013 "proc-macro2",
2014 "quote",
2015 "syn",
2016 "wasm-bindgen-shared",
2017]
2018
2019[[package]]
2020name = "wasm-bindgen-macro"
2021version = "0.2.68"
2022source = "registry+https://github.com/rust-lang/crates.io-index"
2023checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038"
2024dependencies = [
2025 "quote",
2026 "wasm-bindgen-macro-support",
2027]
2028
2029[[package]]
2030name = "wasm-bindgen-macro-support"
2031version = "0.2.68"
2032source = "registry+https://github.com/rust-lang/crates.io-index"
2033checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe"
2034dependencies = [
2035 "proc-macro2",
2036 "quote",
2037 "syn",
2038 "wasm-bindgen-backend",
2039 "wasm-bindgen-shared",
2040]
2041
2042[[package]]
2043name = "wasm-bindgen-shared"
2044version = "0.2.68"
2045source = "registry+https://github.com/rust-lang/crates.io-index"
2046checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307"
2047
2048[[package]]
2049name = "widestring"
2050version = "0.4.2"
2051source = "registry+https://github.com/rust-lang/crates.io-index"
2052checksum = "a763e303c0e0f23b0da40888724762e802a8ffefbc22de4127ef42493c2ea68c"
2053
2054[[package]]
2055name = "winapi"
2056version = "0.2.8"
2057source = "registry+https://github.com/rust-lang/crates.io-index"
2058checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
2059
2060[[package]]
2061name = "winapi"
2062version = "0.3.9"
2063source = "registry+https://github.com/rust-lang/crates.io-index"
2064checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
2065dependencies = [
2066 "winapi-i686-pc-windows-gnu",
2067 "winapi-x86_64-pc-windows-gnu",
2068]
2069
2070[[package]]
2071name = "winapi-build"
2072version = "0.1.1"
2073source = "registry+https://github.com/rust-lang/crates.io-index"
2074checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
2075
2076[[package]]
2077name = "winapi-i686-pc-windows-gnu"
2078version = "0.4.0"
2079source = "registry+https://github.com/rust-lang/crates.io-index"
2080checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
2081
2082[[package]]
2083name = "winapi-util"
2084version = "0.1.5"
2085source = "registry+https://github.com/rust-lang/crates.io-index"
2086checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
2087dependencies = [
2088 "winapi 0.3.9",
2089]
2090
2091[[package]]
2092name = "winapi-x86_64-pc-windows-gnu"
2093version = "0.4.0"
2094source = "registry+https://github.com/rust-lang/crates.io-index"
2095checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
2096
2097[[package]]
2098name = "winreg"
2099version = "0.6.2"
2100source = "registry+https://github.com/rust-lang/crates.io-index"
2101checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9"
2102dependencies = [
2103 "winapi 0.3.9",
2104]
2105
2106[[package]]
2107name = "ws2_32-sys"
2108version = "0.2.1"
2109source = "registry+https://github.com/rust-lang/crates.io-index"
2110checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
2111dependencies = [
2112 "winapi 0.2.8",
2113 "winapi-build",
2114]
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..b7f1012
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,24 @@
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.4.0"
19rand = "0.7"
20
21[dependencies.diesel]
22version = "1.4"
23features = ["mysql", "r2d2"]
24default-features = false
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..11d6ca7
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,18 @@
1let
2 sources = import ./nix/sources.nix;
3 nixpkgs-mozilla = import sources.nixpkgs-mozilla;
4 pkgs = import sources.nixpkgs {
5 overlays =
6 [
7 nixpkgs-mozilla
8 (self: super:
9 {
10 rustc = self.latest.rustChannels.nightly.rust;
11 cargo = self.latest.rustChannels.nightly.rust;
12 }
13 )
14 ];
15 };
16 naersk = pkgs.callPackage sources.naersk {};
17in
18 naersk.buildPackage ./.
diff --git a/diesel.toml b/diesel.toml
new file mode 100644
index 0000000..92267c8
--- /dev/null
+++ b/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/migrations/.gitkeep b/migrations/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/migrations/.gitkeep
diff --git a/migrations/2020-09-22-104623_create_users/down.sql b/migrations/2020-09-22-104623_create_users/down.sql
new file mode 100644
index 0000000..2c92cb7
--- /dev/null
+++ b/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/migrations/2020-09-22-104623_create_users/up.sql b/migrations/2020-09-22-104623_create_users/up.sql
new file mode 100644
index 0000000..dfd27d9
--- /dev/null
+++ b/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/nix/sources.json b/nix/sources.json
new file mode 100644
index 0000000..e2299f7
--- /dev/null
+++ b/nix/sources.json
@@ -0,0 +1,50 @@
1{
2 "naersk": {
3 "branch": "master",
4 "description": "Build rust crates in Nix. No configuration, no code generation, no IFD. Sandbox friendly.",
5 "homepage": "",
6 "owner": "nmattia",
7 "repo": "naersk",
8 "rev": "529e910a3f423a8211f8739290014b754b2555b6",
9 "sha256": "0bcy9nmyaan5jvp0wg80wkizc9j166ns685rdr1kbhkvdpywv46y",
10 "type": "tarball",
11 "url": "https://github.com/nmattia/naersk/archive/529e910a3f423a8211f8739290014b754b2555b6.tar.gz",
12 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
13 },
14 "niv": {
15 "branch": "master",
16 "description": "Easy dependency management for Nix projects",
17 "homepage": "https://github.com/nmattia/niv",
18 "owner": "nmattia",
19 "repo": "niv",
20 "rev": "29ddaaf4e099c3ac0647f5b652469dfc79cd3b53",
21 "sha256": "1va6myp07gkspgxfch8z3rs9nyvys6jmgzkys6a2c4j09qxp1bs0",
22 "type": "tarball",
23 "url": "https://github.com/nmattia/niv/archive/29ddaaf4e099c3ac0647f5b652469dfc79cd3b53.tar.gz",
24 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
25 },
26 "nixpkgs": {
27 "branch": "release-20.03",
28 "description": "Nix Packages collection",
29 "homepage": null,
30 "owner": "NixOS",
31 "repo": "nixpkgs",
32 "rev": "13a15f262a2b348d6aa976017f2cd88e3a18405d",
33 "sha256": "1xcfwqhvs8ai45dahlmqvvkhjf0gdk7nlnxrf7wvmzc50l90akgn",
34 "type": "tarball",
35 "url": "https://github.com/NixOS/nixpkgs/archive/13a15f262a2b348d6aa976017f2cd88e3a18405d.tar.gz",
36 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
37 },
38 "nixpkgs-mozilla": {
39 "branch": "master",
40 "description": "mozilla related nixpkgs (extends nixos/nixpkgs repo)",
41 "homepage": null,
42 "owner": "mozilla",
43 "repo": "nixpkgs-mozilla",
44 "rev": "efda5b357451dbb0431f983cca679ae3cd9b9829",
45 "sha256": "11wqrg86g3qva67vnk81ynvqyfj0zxk83cbrf0p9hsvxiwxs8469",
46 "type": "tarball",
47 "url": "https://github.com/mozilla/nixpkgs-mozilla/archive/efda5b357451dbb0431f983cca679ae3cd9b9829.tar.gz",
48 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
49 }
50}
diff --git a/nix/sources.nix b/nix/sources.nix
new file mode 100644
index 0000000..b64b8f8
--- /dev/null
+++ b/nix/sources.nix
@@ -0,0 +1,148 @@
1# This file has been generated by Niv.
2
3let
4
5 #
6 # The fetchers. fetch_<type> fetches specs of type <type>.
7 #
8
9 fetch_file = pkgs: spec:
10 if spec.builtin or true then
11 builtins_fetchurl { inherit (spec) url sha256; }
12 else
13 pkgs.fetchurl { inherit (spec) url sha256; };
14
15 fetch_tarball = pkgs: name: spec:
16 let
17 ok = str: ! builtins.isNull (builtins.match "[a-zA-Z0-9+-._?=]" str);
18 # sanitize the name, though nix will still fail if name starts with period
19 name' = stringAsChars (x: if ! ok x then "-" else x) "${name}-src";
20 in
21 if spec.builtin or true then
22 builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
23 else
24 pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
25
26 fetch_git = spec:
27 builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; };
28
29 fetch_local = spec: spec.path;
30
31 fetch_builtin-tarball = name: throw
32 ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
33 $ niv modify ${name} -a type=tarball -a builtin=true'';
34
35 fetch_builtin-url = name: throw
36 ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
37 $ niv modify ${name} -a type=file -a builtin=true'';
38
39 #
40 # Various helpers
41 #
42
43 # The set of packages used when specs are fetched using non-builtins.
44 mkPkgs = sources:
45 let
46 sourcesNixpkgs =
47 import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {};
48 hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
49 hasThisAsNixpkgsPath = <nixpkgs> == ./.;
50 in
51 if builtins.hasAttr "nixpkgs" sources
52 then sourcesNixpkgs
53 else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
54 import <nixpkgs> {}
55 else
56 abort
57 ''
58 Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
59 add a package called "nixpkgs" to your sources.json.
60 '';
61
62 # The actual fetching function.
63 fetch = pkgs: name: spec:
64
65 if ! builtins.hasAttr "type" spec then
66 abort "ERROR: niv spec ${name} does not have a 'type' attribute"
67 else if spec.type == "file" then fetch_file pkgs spec
68 else if spec.type == "tarball" then fetch_tarball pkgs name spec
69 else if spec.type == "git" then fetch_git spec
70 else if spec.type == "local" then fetch_local spec
71 else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
72 else if spec.type == "builtin-url" then fetch_builtin-url name
73 else
74 abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
75
76 # If the environment variable NIV_OVERRIDE_${name} is set, then use
77 # the path directly as opposed to the fetched source.
78 replace = name: drv:
79 let
80 saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
81 ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
82 in
83 if ersatz == "" then drv else ersatz;
84
85 # Ports of functions for older nix versions
86
87 # a Nix version of mapAttrs if the built-in doesn't exist
88 mapAttrs = builtins.mapAttrs or (
89 f: set: with builtins;
90 listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
91 );
92
93 # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
94 range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
95
96 # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
97 stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
98
99 # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
100 stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
101 concatStrings = builtins.concatStringsSep "";
102
103 # fetchTarball version that is compatible between all the versions of Nix
104 builtins_fetchTarball = { url, name, sha256 }@attrs:
105 let
106 inherit (builtins) lessThan nixVersion fetchTarball;
107 in
108 if lessThan nixVersion "1.12" then
109 fetchTarball { inherit name url; }
110 else
111 fetchTarball attrs;
112
113 # fetchurl version that is compatible between all the versions of Nix
114 builtins_fetchurl = { url, sha256 }@attrs:
115 let
116 inherit (builtins) lessThan nixVersion fetchurl;
117 in
118 if lessThan nixVersion "1.12" then
119 fetchurl { inherit url; }
120 else
121 fetchurl attrs;
122
123 # Create the final "sources" from the config
124 mkSources = config:
125 mapAttrs (
126 name: spec:
127 if builtins.hasAttr "outPath" spec
128 then abort
129 "The values in sources.json should not have an 'outPath' attribute"
130 else
131 spec // { outPath = replace name (fetch config.pkgs name spec); }
132 ) config.sources;
133
134 # The "config" used by the fetchers
135 mkConfig =
136 { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
137 , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
138 , pkgs ? mkPkgs sources
139 }: rec {
140 # The sources, i.e. the attribute set of spec name to spec
141 inherit sources;
142
143 # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
144 inherit pkgs;
145 };
146
147in
148mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
diff --git a/result b/result
new file mode 120000
index 0000000..bb4c718
--- /dev/null
+++ b/result
@@ -0,0 +1 @@
/nix/store/kmgq2yng4785g1b6l06agg8jk5hwykxi-actix-tests-0.1.0 \ No newline at end of file
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 100644
index 0000000..be4296e
--- /dev/null
+++ b/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/shell.nix b/shell.nix
new file mode 100644
index 0000000..5779d87
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,31 @@
1{ pkgs ? import <nixpkgs> {} }:
2
3let
4 sources = import ./nix/sources.nix;
5 nixpkgs-mozilla = import sources.nixpkgs-mozilla;
6 pkgs = import sources.nixpkgs {
7 overlays =
8 [
9 nixpkgs-mozilla
10 (self: super:
11 {
12 rustc = self.latest.rustChannels.nightly.rust;
13 cargo = self.latest.rustChannels.nightly.rust;
14 }
15 )
16 ];
17 };
18in
19 pkgs.mkShell {
20 buildInputs = with pkgs; [
21 cargo
22 rustc
23 rustfmt
24 pkg-config
25 openssl
26 httpie
27 curl
28 diesel-cli
29 libmysqlclient
30 ];
31 }
diff --git a/src/bin/server.rs b/src/bin/server.rs
new file mode 100644
index 0000000..eb290db
--- /dev/null
+++ b/src/bin/server.rs
@@ -0,0 +1,44 @@
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::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 .secure(false),
28 ))
29 .wrap(Cors::new().supports_credentials().finish())
30 .wrap(middleware::Logger::default())
31 .data(pool.clone())
32 .service(
33 web::scope("/user")
34 .route("/existing", web::post().to(users::name_exists))
35 .route("/login", web::post().to(users::login))
36 .route("/{uname}", web::get().to(users::user_details))
37 .route("/new", web::post().to(users::new_user)),
38 )
39 .route("/hey", web::get().to(manual_hello))
40 })
41 .bind("127.0.0.1:7878")?
42 .run()
43 .await
44}
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
new file mode 100644
index 0000000..65d3519
--- /dev/null
+++ b/src/handlers/mod.rs
@@ -0,0 +1,2 @@
1pub mod smoke;
2pub mod users;
diff --git a/src/handlers/smoke.rs b/src/handlers/smoke.rs
new file mode 100644
index 0000000..d0a1038
--- /dev/null
+++ b/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/src/handlers/users.rs b/src/handlers/users.rs
new file mode 100644
index 0000000..e6b0415
--- /dev/null
+++ b/src/handlers/users.rs
@@ -0,0 +1,106 @@
1use crate::models::{Member, NewMember};
2use crate::schema::members::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<NewMember>,
15) -> impl Responder {
16 let conn = pool.get().unwrap();
17 let hashed_item = NewMember {
18 password: hash(&item.password, DEFAULT_COST).unwrap(),
19 ..(item.into_inner())
20 };
21 diesel::insert_into(members)
22 .values(hashed_item)
23 .execute(&conn)
24 .expect("Coundn't connect to DB");
25 HttpResponse::Ok().body("Inserted successfully!")
26}
27
28pub async fn name_exists(
29 pool: web::Data<TPool>,
30 item: String,
31) -> impl Responder {
32 let conn = pool.get().unwrap();
33 info!("target: {:?}", item);
34 if (members
35 .filter(username.eq(&item))
36 .limit(1)
37 .load::<Member>(&conn)
38 .expect("Coundn't connect to DB"))
39 .len()
40 > 0
41 {
42 HttpResponse::Ok().body("true")
43 } else {
44 HttpResponse::Ok().body("false")
45 }
46}
47
48#[derive(Deserialize)]
49pub struct Login {
50 username: String,
51 password: String,
52}
53
54pub async fn login(
55 pool: web::Data<TPool>,
56 cookie: Identity,
57 login_details: web::Json<Login>,
58) -> impl Responder {
59 info!("Login hit");
60 let conn = pool.get().unwrap();
61 let entered_pass = &login_details.password;
62 let selected_user = members
63 .filter(username.eq(&login_details.username))
64 .limit(1)
65 .first::<Member>(&conn)
66 .expect("Couldn't connect to DB");
67 let hashed_pass = selected_user.password;
68 if verify(entered_pass, &hashed_pass).unwrap() {
69 cookie.remember(login_details.username.clone());
70 info!(
71 "Successful login: {} {}",
72 selected_user.username, selected_user.email_id
73 );
74 HttpResponse::Ok().finish()
75 } else {
76 HttpResponse::Unauthorized().finish()
77 }
78}
79
80pub async fn logout(cookie: Identity) -> impl Responder {
81 cookie.forget();
82 HttpResponse::Found().header("location", "/").finish()
83}
84
85pub async fn user_details(
86 uname: web::Path<String>,
87 pool: web::Data<TPool>,
88) -> impl Responder {
89 let conn = pool.get().unwrap();
90 let uname = uname.into_inner();
91 info!("Fetching info for: \"{}\"", uname);
92 let selected_user = members
93 .filter(username.eq(&uname))
94 .limit(1)
95 .first::<Member>(&conn);
96 match selected_user {
97 Ok(m) => {
98 info!("Found user: {}", uname);
99 HttpResponse::Ok().json(m)
100 }
101 Err(_) => {
102 error!("User not found: {}", uname);
103 HttpResponse::NotFound().finish()
104 }
105 }
106}
diff --git a/src/handlers/users.rs.html b/src/handlers/users.rs.html
new file mode 100644
index 0000000..a233b04
--- /dev/null
+++ b/src/handlers/users.rs.html
@@ -0,0 +1,137 @@
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3<head>
4<meta http-equiv="content-type" content="text/html; charset=UTF-8">
5<title>~/code/rust/actix-tests/src/handlers/users.rs.html</title>
6<meta name="Generator" content="Vim/8.0">
7<meta name="plugin-version" content="vim8.1_v1">
8<meta name="syntax" content="rust">
9<meta name="settings" content="use_css,no_foldcolumn,expand_tabs,prevent_copy=">
10<meta name="colorscheme" content="plain">
11<style type="text/css">
12<!--
13pre { font-family: monospace; color: #c0c0c0; background-color: #000000; }
14body { font-family: monospace; color: #c0c0c0; background-color: #000000; }
15* { font-size: 1em; }
16.Statement { color: #c0c0c0; background-color: #000000; padding-bottom: 1px; font-weight: bold; }
17.Normal { color: #c0c0c0; background-color: #000000; padding-bottom: 1px; }
18.Function { color: #c0c0c0; font-weight: bold; }
19.secondAccent { color: #c000c0; background-color: #000000; padding-bottom: 1px; }
20.Noise { color: #8080ff; background-color: #000000; padding-bottom: 1px; }
21.rustModPath { color: #ff40ff; background-color: #000000; padding-bottom: 1px; }
22.Constant { color: #008080; background-color: #000000; padding-bottom: 1px; }
23.StatusLine { color: #808080; background-color: #000000; padding-bottom: 1px; }
24-->
25</style>
26</head>
27<body>
28<pre id='vimCodeElement'>
29<span class="Noise">use</span> <span class="rustModPath">crate</span><span class="StatusLine">::</span><span class="rustModPath">models</span><span class="StatusLine">::</span>{Member, NewMember};
30<span class="Noise">use</span> <span class="rustModPath">crate</span><span class="StatusLine">::</span><span class="rustModPath">schema</span><span class="StatusLine">::</span><span class="rustModPath">members</span><span class="StatusLine">::</span><span class="rustModPath">dsl</span><span class="StatusLine">::</span><span class="Statement">*</span>;
31<span class="Noise">use</span> <span class="rustModPath">crate</span><span class="StatusLine">::</span>TPool;
32
33<span class="Noise">use</span> <span class="rustModPath">actix_identity</span><span class="StatusLine">::</span>Identity;
34<span class="Noise">use</span> <span class="rustModPath">actix_web</span><span class="StatusLine">::</span>{web, HttpResponse, Responder};
35<span class="Noise">use</span> <span class="rustModPath">bcrypt</span><span class="StatusLine">::</span>{hash, verify, DEFAULT_COST};
36<span class="Noise">use</span> <span class="rustModPath">diesel</span><span class="StatusLine">::</span><span class="rustModPath">prelude</span><span class="StatusLine">::</span><span class="Statement">*</span>;
37<span class="Noise">use</span> <span class="rustModPath">log</span><span class="StatusLine">::</span>{error, info};
38<span class="Noise">use</span> <span class="rustModPath">serde</span><span class="StatusLine">::</span>Deserialize;
39
40<span class="Noise">pub</span> <span class="Noise">async</span> <span class="Noise">fn</span> <span class="Function">new_user</span>(
41 pool: <span class="rustModPath">web</span><span class="StatusLine">::</span>Data<span class="Noise">&lt;</span>TPool<span class="Noise">&gt;</span>,
42 item: <span class="rustModPath">web</span><span class="StatusLine">::</span>Json<span class="Noise">&lt;</span>NewMember<span class="Noise">&gt;</span>,
43) <span class="Noise">-&gt;</span> <span class="Noise">impl</span> Responder {
44 <span class="Noise">let</span> conn <span class="Noise">=</span> pool.<span class="Function">get</span>().<span class="Function">unwrap</span>();
45 <span class="Noise">let</span> hashed_item <span class="Noise">=</span> NewMember {
46 password: <span class="Function">hash</span>(<span class="Statement">&amp;</span>item.password, DEFAULT_COST).<span class="Function">unwrap</span>(),
47 ..(item.<span class="Function">into_inner</span>())
48 };
49 <span class="rustModPath">diesel</span><span class="StatusLine">::</span><span class="Function">insert_into</span>(members)
50 .<span class="Function">values</span>(hashed_item)
51 .<span class="Function">execute</span>(<span class="Statement">&amp;</span>conn)
52 .<span class="Function">expect</span>(<span class="Constant">&quot;</span><span class="Constant">Coundn't connect to DB</span><span class="Constant">&quot;</span>);
53 <span class="rustModPath">HttpResponse</span><span class="StatusLine">::</span><span class="Constant">Ok</span>().<span class="Function">body</span>(<span class="Constant">&quot;</span><span class="Constant">Inserted successfully!</span><span class="Constant">&quot;</span>)
54}
55
56<span class="Noise">pub</span> <span class="Noise">async</span> <span class="Noise">fn</span> <span class="Function">name_exists</span>(
57 pool: <span class="rustModPath">web</span><span class="StatusLine">::</span>Data<span class="Noise">&lt;</span>TPool<span class="Noise">&gt;</span>,
58 item: <span class="Normal">String</span>,
59) <span class="Noise">-&gt;</span> <span class="Noise">impl</span> Responder {
60 <span class="Noise">let</span> conn <span class="Noise">=</span> pool.<span class="Function">get</span>().<span class="Function">unwrap</span>();
61 <span class="secondAccent">info!</span>(<span class="Constant">&quot;</span><span class="Constant">target: {:?}</span><span class="Constant">&quot;</span>, item);
62 <span class="Statement">if</span> (members
63 .<span class="Function">filter</span>(username.<span class="Function">eq</span>(<span class="Statement">&amp;</span>item))
64 .<span class="Function">limit</span>(<span class="Constant">1</span>)
65 .<span class="Function">load</span><span class="StatusLine">::</span><span class="Noise">&lt;</span>Member<span class="Noise">&gt;</span>(<span class="Statement">&amp;</span>conn)
66 .<span class="Function">expect</span>(<span class="Constant">&quot;</span><span class="Constant">Coundn't connect to DB</span><span class="Constant">&quot;</span>))
67 .<span class="Function">len</span>()
68 <span class="Noise">&gt;</span> <span class="Constant">0</span>
69 {
70 <span class="rustModPath">HttpResponse</span><span class="StatusLine">::</span><span class="Constant">Ok</span>().<span class="Function">body</span>(<span class="Constant">&quot;</span><span class="Constant">true</span><span class="Constant">&quot;</span>)
71 } <span class="Statement">else</span> {
72 <span class="rustModPath">HttpResponse</span><span class="StatusLine">::</span><span class="Constant">Ok</span>().<span class="Function">body</span>(<span class="Constant">&quot;</span><span class="Constant">false</span><span class="Constant">&quot;</span>)
73 }
74}
75
76<span class="secondAccent">#[</span><span class="secondAccent">derive(Deserialize)</span><span class="secondAccent">]</span>
77<span class="Noise">pub</span> <span class="Statement">struct</span> <span class="Normal">Login</span> {
78 username: <span class="Normal">String</span>,
79 password: <span class="Normal">String</span>,
80}
81
82<span class="Noise">pub</span> <span class="Noise">async</span> <span class="Noise">fn</span> <span class="Function">login</span>(
83 pool: <span class="rustModPath">web</span><span class="StatusLine">::</span>Data<span class="Noise">&lt;</span>TPool<span class="Noise">&gt;</span>,
84 cookie: Identity,
85 login_details: <span class="rustModPath">web</span><span class="StatusLine">::</span>Form<span class="Noise">&lt;</span>Login<span class="Noise">&gt;</span>,
86) <span class="Noise">-&gt;</span> <span class="Noise">impl</span> Responder {
87 <span class="Noise">let</span> conn <span class="Noise">=</span> pool.<span class="Function">get</span>().<span class="Function">unwrap</span>();
88 <span class="Noise">let</span> entered_pass <span class="Noise">=</span> <span class="Statement">&amp;</span>login_details.password;
89 <span class="Noise">let</span> selected_user <span class="Noise">=</span> members
90 .<span class="Function">filter</span>(username.<span class="Function">eq</span>(<span class="Statement">&amp;</span>login_details.username))
91 .<span class="Function">limit</span>(<span class="Constant">1</span>)
92 .<span class="Function">first</span><span class="StatusLine">::</span><span class="Noise">&lt;</span>Member<span class="Noise">&gt;</span>(<span class="Statement">&amp;</span>conn)
93 .<span class="Function">expect</span>(<span class="Constant">&quot;</span><span class="Constant">Couldn't connect to DB</span><span class="Constant">&quot;</span>);
94 <span class="Noise">let</span> hashed_pass <span class="Noise">=</span> selected_user.password;
95 <span class="Statement">if</span> <span class="Function">verify</span>(entered_pass, <span class="Statement">&amp;</span>hashed_pass).<span class="Function">unwrap</span>() {
96 cookie.<span class="Function">remember</span>(login_details.username.<span class="Function">clone</span>());
97 <span class="secondAccent">info!</span>(
98 <span class="Constant">&quot;</span><span class="Constant">Successful login: {} {}</span><span class="Constant">&quot;</span>,
99 selected_user.username, selected_user.email_id
100 );
101 <span class="rustModPath">HttpResponse</span><span class="StatusLine">::</span><span class="Function">Found</span>().<span class="Function">header</span>(<span class="Constant">&quot;</span><span class="Constant">location</span><span class="Constant">&quot;</span>, <span class="Constant">&quot;</span><span class="Constant">/</span><span class="Constant">&quot;</span>).<span class="Function">finish</span>()
102 } <span class="Statement">else</span> {
103 <span class="rustModPath">HttpResponse</span><span class="StatusLine">::</span><span class="Function">Unauthorized</span>().<span class="Function">finish</span>()
104 }
105}
106
107<span class="Noise">pub</span> <span class="Noise">async</span> <span class="Noise">fn</span> <span class="Function">logout</span>(cookie: Identity) <span class="Noise">-&gt;</span> <span class="Noise">impl</span> Responder {
108 cookie.<span class="Function">forget</span>();
109 <span class="rustModPath">HttpResponse</span><span class="StatusLine">::</span><span class="Function">Found</span>().<span class="Function">header</span>(<span class="Constant">&quot;</span><span class="Constant">location</span><span class="Constant">&quot;</span>, <span class="Constant">&quot;</span><span class="Constant">/</span><span class="Constant">&quot;</span>).<span class="Function">finish</span>()
110}
111
112<span class="Noise">pub</span> <span class="Noise">async</span> <span class="Noise">fn</span> <span class="Function">user_details</span>(
113 uname: <span class="rustModPath">web</span><span class="StatusLine">::</span>Path<span class="Noise">&lt;</span><span class="Normal">String</span><span class="Noise">&gt;</span>,
114 pool: <span class="rustModPath">web</span><span class="StatusLine">::</span>Data<span class="Noise">&lt;</span>TPool<span class="Noise">&gt;</span>,
115) <span class="Noise">-&gt;</span> <span class="Noise">impl</span> Responder {
116 <span class="Noise">let</span> conn <span class="Noise">=</span> pool.<span class="Function">get</span>().<span class="Function">unwrap</span>();
117 <span class="Noise">let</span> uname <span class="Noise">=</span> uname.<span class="Function">into_inner</span>();
118 <span class="secondAccent">info!</span>(<span class="Constant">&quot;</span><span class="Constant">Fetching info for: </span><span class="StatusLine">\&quot;</span><span class="Constant">{}</span><span class="StatusLine">\&quot;</span><span class="Constant">&quot;</span>, uname);
119 <span class="Noise">let</span> selected_user <span class="Noise">=</span> members
120 .<span class="Function">filter</span>(username.<span class="Function">eq</span>(<span class="Statement">&amp;</span>uname))
121 .<span class="Function">limit</span>(<span class="Constant">1</span>)
122 .<span class="Function">first</span><span class="StatusLine">::</span><span class="Noise">&lt;</span>Member<span class="Noise">&gt;</span>(<span class="Statement">&amp;</span>conn);
123 <span class="Statement">match</span> selected_user {
124 <span class="Constant">Ok</span>(m) <span class="Noise">=&gt;</span> {
125 <span class="secondAccent">info!</span>(<span class="Constant">&quot;</span><span class="Constant">Found user: {}</span><span class="Constant">&quot;</span>, uname);
126 <span class="rustModPath">HttpResponse</span><span class="StatusLine">::</span><span class="Constant">Ok</span>().<span class="Function">json</span>(m)
127 }
128 <span class="Constant">Err</span>(_) <span class="Noise">=&gt;</span> {
129 <span class="secondAccent">error!</span>(<span class="Constant">&quot;</span><span class="Constant">User not found: {}</span><span class="Constant">&quot;</span>, uname);
130 <span class="rustModPath">HttpResponse</span><span class="StatusLine">::</span><span class="Function">NotFound</span>().<span class="Function">finish</span>()
131 }
132 }
133}
134</pre>
135</body>
136</html>
137<!-- vim: set foldmethod=manual : -->
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..d956a3f
--- /dev/null
+++ b/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/src/models.rs b/src/models.rs
new file mode 100644
index 0000000..ce28ac8
--- /dev/null
+++ b/src/models.rs
@@ -0,0 +1,21 @@
1use super::schema::members;
2use diesel::{Insertable, Queryable};
3use serde::{Deserialize, Serialize};
4
5#[derive(Queryable, Serialize)]
6pub struct Member {
7 pub id: i32,
8 pub username: String,
9 pub password: String,
10 pub phone_number: String,
11 pub email_id: String,
12}
13
14#[derive(Insertable, Deserialize)]
15#[table_name = "members"]
16pub struct NewMember {
17 pub username: String,
18 pub password: String,
19 pub phone_number: String,
20 pub email_id: String,
21}
diff --git a/src/schema.rs b/src/schema.rs
new file mode 100644
index 0000000..8ed6e58
--- /dev/null
+++ b/src/schema.rs
@@ -0,0 +1,9 @@
1table! {
2 members (id) {
3 id -> Integer,
4 username -> Varchar,
5 password -> Varchar,
6 phone_number -> Varchar,
7 email_id -> Varchar,
8 }
9}