├── .env.example ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src ├── articles.sql ├── main.rs ├── services.rs └── users.sql /.env.example: -------------------------------------------------------------------------------- 1 | DATABASE_URL=postgresql://[USERNAME]:[PASSWORD]@[HOST]/[DB] 2 | JWT_SECRET=supersecretjwt 3 | HASH_SECRET=supersecrethash -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .env -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "actix" 7 | version = "0.13.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "f728064aca1c318585bf4bb04ffcfac9e75e508ab4e8b1bd9ba5dfe04e2cbed5" 10 | dependencies = [ 11 | "actix-rt", 12 | "actix_derive", 13 | "bitflags", 14 | "bytes", 15 | "crossbeam-channel", 16 | "futures-core", 17 | "futures-sink", 18 | "futures-task", 19 | "futures-util", 20 | "log", 21 | "once_cell", 22 | "parking_lot", 23 | "pin-project-lite", 24 | "smallvec", 25 | "tokio", 26 | "tokio-util", 27 | ] 28 | 29 | [[package]] 30 | name = "actix-codec" 31 | version = "0.5.0" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe" 34 | dependencies = [ 35 | "bitflags", 36 | "bytes", 37 | "futures-core", 38 | "futures-sink", 39 | "log", 40 | "memchr", 41 | "pin-project-lite", 42 | "tokio", 43 | "tokio-util", 44 | ] 45 | 46 | [[package]] 47 | name = "actix-http" 48 | version = "3.2.2" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "0c83abf9903e1f0ad9973cc4f7b9767fd5a03a583f51a5b7a339e07987cd2724" 51 | dependencies = [ 52 | "actix-codec", 53 | "actix-rt", 54 | "actix-service", 55 | "actix-utils", 56 | "ahash", 57 | "base64 0.13.1", 58 | "bitflags", 59 | "brotli", 60 | "bytes", 61 | "bytestring", 62 | "derive_more", 63 | "encoding_rs", 64 | "flate2", 65 | "futures-core", 66 | "h2", 67 | "http", 68 | "httparse", 69 | "httpdate", 70 | "itoa", 71 | "language-tags", 72 | "local-channel", 73 | "mime", 74 | "percent-encoding", 75 | "pin-project-lite", 76 | "rand 0.8.5", 77 | "sha1", 78 | "smallvec", 79 | "tracing", 80 | "zstd", 81 | ] 82 | 83 | [[package]] 84 | name = "actix-macros" 85 | version = "0.2.3" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" 88 | dependencies = [ 89 | "quote 1.0.21", 90 | "syn", 91 | ] 92 | 93 | [[package]] 94 | name = "actix-router" 95 | version = "0.5.1" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" 98 | dependencies = [ 99 | "bytestring", 100 | "http", 101 | "regex", 102 | "serde", 103 | "tracing", 104 | ] 105 | 106 | [[package]] 107 | name = "actix-rt" 108 | version = "2.7.0" 109 | source = "registry+https://github.com/rust-lang/crates.io-index" 110 | checksum = "7ea16c295198e958ef31930a6ef37d0fb64e9ca3b6116e6b93a8bdae96ee1000" 111 | dependencies = [ 112 | "futures-core", 113 | "tokio", 114 | ] 115 | 116 | [[package]] 117 | name = "actix-server" 118 | version = "2.1.1" 119 | source = "registry+https://github.com/rust-lang/crates.io-index" 120 | checksum = "0da34f8e659ea1b077bb4637948b815cd3768ad5a188fdcd74ff4d84240cd824" 121 | dependencies = [ 122 | "actix-rt", 123 | "actix-service", 124 | "actix-utils", 125 | "futures-core", 126 | "futures-util", 127 | "mio", 128 | "num_cpus", 129 | "socket2", 130 | "tokio", 131 | "tracing", 132 | ] 133 | 134 | [[package]] 135 | name = "actix-service" 136 | version = "2.0.2" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" 139 | dependencies = [ 140 | "futures-core", 141 | "paste", 142 | "pin-project-lite", 143 | ] 144 | 145 | [[package]] 146 | name = "actix-utils" 147 | version = "3.0.1" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" 150 | dependencies = [ 151 | "local-waker", 152 | "pin-project-lite", 153 | ] 154 | 155 | [[package]] 156 | name = "actix-web" 157 | version = "4.2.1" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "d48f7b6534e06c7bfc72ee91db7917d4af6afe23e7d223b51e68fffbb21e96b9" 160 | dependencies = [ 161 | "actix-codec", 162 | "actix-http", 163 | "actix-macros", 164 | "actix-router", 165 | "actix-rt", 166 | "actix-server", 167 | "actix-service", 168 | "actix-utils", 169 | "actix-web-codegen", 170 | "ahash", 171 | "bytes", 172 | "bytestring", 173 | "cfg-if 1.0.0", 174 | "cookie", 175 | "derive_more", 176 | "encoding_rs", 177 | "futures-core", 178 | "futures-util", 179 | "http", 180 | "itoa", 181 | "language-tags", 182 | "log", 183 | "mime", 184 | "once_cell", 185 | "pin-project-lite", 186 | "regex", 187 | "serde", 188 | "serde_json", 189 | "serde_urlencoded", 190 | "smallvec", 191 | "socket2", 192 | "time 0.3.16", 193 | "url", 194 | ] 195 | 196 | [[package]] 197 | name = "actix-web-codegen" 198 | version = "4.1.0" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "1fa9362663c8643d67b2d5eafba49e4cb2c8a053a29ed00a0bea121f17c76b13" 201 | dependencies = [ 202 | "actix-router", 203 | "proc-macro2 1.0.47", 204 | "quote 1.0.21", 205 | "syn", 206 | ] 207 | 208 | [[package]] 209 | name = "actix-web-httpauth" 210 | version = "0.8.0" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "6dda62cf04bc3a9ad2ea8f314f721951cfdb4cdacec4e984d20e77c7bb170991" 213 | dependencies = [ 214 | "actix-utils", 215 | "actix-web", 216 | "base64 0.13.1", 217 | "futures-core", 218 | "futures-util", 219 | "log", 220 | "pin-project-lite", 221 | ] 222 | 223 | [[package]] 224 | name = "actix_derive" 225 | version = "0.6.0" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7" 228 | dependencies = [ 229 | "proc-macro2 1.0.47", 230 | "quote 1.0.21", 231 | "syn", 232 | ] 233 | 234 | [[package]] 235 | name = "addr2line" 236 | version = "0.17.0" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" 239 | dependencies = [ 240 | "gimli", 241 | ] 242 | 243 | [[package]] 244 | name = "adler" 245 | version = "1.0.2" 246 | source = "registry+https://github.com/rust-lang/crates.io-index" 247 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 248 | 249 | [[package]] 250 | name = "ahash" 251 | version = "0.7.6" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 254 | dependencies = [ 255 | "getrandom", 256 | "once_cell", 257 | "version_check 0.9.4", 258 | ] 259 | 260 | [[package]] 261 | name = "aho-corasick" 262 | version = "0.7.19" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" 265 | dependencies = [ 266 | "memchr", 267 | ] 268 | 269 | [[package]] 270 | name = "alloc-no-stdlib" 271 | version = "2.0.4" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" 274 | 275 | [[package]] 276 | name = "alloc-stdlib" 277 | version = "0.2.2" 278 | source = "registry+https://github.com/rust-lang/crates.io-index" 279 | checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" 280 | dependencies = [ 281 | "alloc-no-stdlib", 282 | ] 283 | 284 | [[package]] 285 | name = "android_system_properties" 286 | version = "0.1.5" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 289 | dependencies = [ 290 | "libc", 291 | ] 292 | 293 | [[package]] 294 | name = "ansi_term" 295 | version = "0.12.1" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 298 | dependencies = [ 299 | "winapi", 300 | ] 301 | 302 | [[package]] 303 | name = "argonautica" 304 | version = "0.2.0" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "b765e206f4ab068271148430e0799aa84d81b8a13680c680f29f6c1d67da5f37" 307 | dependencies = [ 308 | "base64 0.10.1", 309 | "bindgen", 310 | "bitflags", 311 | "cc", 312 | "cfg-if 0.1.10", 313 | "failure", 314 | "futures", 315 | "futures-cpupool", 316 | "libc", 317 | "log", 318 | "nom 4.2.3", 319 | "num_cpus", 320 | "rand 0.6.5", 321 | "scopeguard 1.1.0", 322 | "tempdir", 323 | ] 324 | 325 | [[package]] 326 | name = "async-channel" 327 | version = "1.7.1" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" 330 | dependencies = [ 331 | "concurrent-queue", 332 | "event-listener", 333 | "futures-core", 334 | ] 335 | 336 | [[package]] 337 | name = "async-executor" 338 | version = "1.4.1" 339 | source = "registry+https://github.com/rust-lang/crates.io-index" 340 | checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" 341 | dependencies = [ 342 | "async-task", 343 | "concurrent-queue", 344 | "fastrand", 345 | "futures-lite", 346 | "once_cell", 347 | "slab", 348 | ] 349 | 350 | [[package]] 351 | name = "async-global-executor" 352 | version = "2.3.0" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "0da5b41ee986eed3f524c380e6d64965aea573882a8907682ad100f7859305ca" 355 | dependencies = [ 356 | "async-channel", 357 | "async-executor", 358 | "async-io", 359 | "async-lock", 360 | "blocking", 361 | "futures-lite", 362 | "once_cell", 363 | ] 364 | 365 | [[package]] 366 | name = "async-io" 367 | version = "1.10.0" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "e8121296a9f05be7f34aa4196b1747243b3b62e048bb7906f644f3fbfc490cf7" 370 | dependencies = [ 371 | "async-lock", 372 | "autocfg 1.1.0", 373 | "concurrent-queue", 374 | "futures-lite", 375 | "libc", 376 | "log", 377 | "parking", 378 | "polling", 379 | "slab", 380 | "socket2", 381 | "waker-fn", 382 | "winapi", 383 | ] 384 | 385 | [[package]] 386 | name = "async-lock" 387 | version = "2.6.0" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" 390 | dependencies = [ 391 | "event-listener", 392 | "futures-lite", 393 | ] 394 | 395 | [[package]] 396 | name = "async-native-tls" 397 | version = "0.4.0" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | checksum = "d57d4cec3c647232e1094dc013546c0b33ce785d8aeb251e1f20dfaf8a9a13fe" 400 | dependencies = [ 401 | "futures-util", 402 | "native-tls", 403 | "thiserror", 404 | "url", 405 | ] 406 | 407 | [[package]] 408 | name = "async-process" 409 | version = "1.5.0" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c" 412 | dependencies = [ 413 | "async-io", 414 | "autocfg 1.1.0", 415 | "blocking", 416 | "cfg-if 1.0.0", 417 | "event-listener", 418 | "futures-lite", 419 | "libc", 420 | "once_cell", 421 | "signal-hook", 422 | "winapi", 423 | ] 424 | 425 | [[package]] 426 | name = "async-std" 427 | version = "1.12.0" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" 430 | dependencies = [ 431 | "async-channel", 432 | "async-global-executor", 433 | "async-io", 434 | "async-lock", 435 | "async-process", 436 | "crossbeam-utils", 437 | "futures-channel", 438 | "futures-core", 439 | "futures-io", 440 | "futures-lite", 441 | "gloo-timers", 442 | "kv-log-macro", 443 | "log", 444 | "memchr", 445 | "once_cell", 446 | "pin-project-lite", 447 | "pin-utils", 448 | "slab", 449 | "wasm-bindgen-futures", 450 | ] 451 | 452 | [[package]] 453 | name = "async-task" 454 | version = "4.3.0" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" 457 | 458 | [[package]] 459 | name = "atoi" 460 | version = "1.0.0" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" 463 | dependencies = [ 464 | "num-traits", 465 | ] 466 | 467 | [[package]] 468 | name = "atomic-waker" 469 | version = "1.0.0" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" 472 | 473 | [[package]] 474 | name = "atty" 475 | version = "0.2.14" 476 | source = "registry+https://github.com/rust-lang/crates.io-index" 477 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 478 | dependencies = [ 479 | "hermit-abi", 480 | "libc", 481 | "winapi", 482 | ] 483 | 484 | [[package]] 485 | name = "autocfg" 486 | version = "0.1.8" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" 489 | dependencies = [ 490 | "autocfg 1.1.0", 491 | ] 492 | 493 | [[package]] 494 | name = "autocfg" 495 | version = "1.1.0" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 498 | 499 | [[package]] 500 | name = "backtrace" 501 | version = "0.3.66" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" 504 | dependencies = [ 505 | "addr2line", 506 | "cc", 507 | "cfg-if 1.0.0", 508 | "libc", 509 | "miniz_oxide", 510 | "object", 511 | "rustc-demangle", 512 | ] 513 | 514 | [[package]] 515 | name = "base64" 516 | version = "0.10.1" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" 519 | dependencies = [ 520 | "byteorder", 521 | ] 522 | 523 | [[package]] 524 | name = "base64" 525 | version = "0.13.1" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 528 | 529 | [[package]] 530 | name = "bindgen" 531 | version = "0.48.1" 532 | source = "registry+https://github.com/rust-lang/crates.io-index" 533 | checksum = "9d3d411fd93fd296e613bdac1d16755a6a922a4738e1c8f6a5e13542c905f3ca" 534 | dependencies = [ 535 | "bitflags", 536 | "cexpr", 537 | "cfg-if 0.1.10", 538 | "clang-sys", 539 | "clap", 540 | "env_logger", 541 | "hashbrown 0.1.8", 542 | "lazy_static", 543 | "log", 544 | "peeking_take_while", 545 | "proc-macro2 0.4.30", 546 | "quote 0.6.13", 547 | "regex", 548 | "which", 549 | ] 550 | 551 | [[package]] 552 | name = "bitflags" 553 | version = "1.3.2" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 556 | 557 | [[package]] 558 | name = "block-buffer" 559 | version = "0.10.3" 560 | source = "registry+https://github.com/rust-lang/crates.io-index" 561 | checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" 562 | dependencies = [ 563 | "generic-array", 564 | ] 565 | 566 | [[package]] 567 | name = "blocking" 568 | version = "1.2.0" 569 | source = "registry+https://github.com/rust-lang/crates.io-index" 570 | checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" 571 | dependencies = [ 572 | "async-channel", 573 | "async-task", 574 | "atomic-waker", 575 | "fastrand", 576 | "futures-lite", 577 | "once_cell", 578 | ] 579 | 580 | [[package]] 581 | name = "brotli" 582 | version = "3.3.4" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" 585 | dependencies = [ 586 | "alloc-no-stdlib", 587 | "alloc-stdlib", 588 | "brotli-decompressor", 589 | ] 590 | 591 | [[package]] 592 | name = "brotli-decompressor" 593 | version = "2.3.2" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" 596 | dependencies = [ 597 | "alloc-no-stdlib", 598 | "alloc-stdlib", 599 | ] 600 | 601 | [[package]] 602 | name = "bumpalo" 603 | version = "3.11.1" 604 | source = "registry+https://github.com/rust-lang/crates.io-index" 605 | checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" 606 | 607 | [[package]] 608 | name = "byteorder" 609 | version = "1.4.3" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 612 | 613 | [[package]] 614 | name = "bytes" 615 | version = "1.2.1" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" 618 | 619 | [[package]] 620 | name = "bytestring" 621 | version = "1.1.0" 622 | source = "registry+https://github.com/rust-lang/crates.io-index" 623 | checksum = "86b6a75fd3048808ef06af5cd79712be8111960adaf89d90250974b38fc3928a" 624 | dependencies = [ 625 | "bytes", 626 | ] 627 | 628 | [[package]] 629 | name = "cache-padded" 630 | version = "1.2.0" 631 | source = "registry+https://github.com/rust-lang/crates.io-index" 632 | checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" 633 | 634 | [[package]] 635 | name = "cc" 636 | version = "1.0.73" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 639 | dependencies = [ 640 | "jobserver", 641 | ] 642 | 643 | [[package]] 644 | name = "cexpr" 645 | version = "0.3.6" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" 648 | dependencies = [ 649 | "nom 4.2.3", 650 | ] 651 | 652 | [[package]] 653 | name = "cfg-if" 654 | version = "0.1.10" 655 | source = "registry+https://github.com/rust-lang/crates.io-index" 656 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 657 | 658 | [[package]] 659 | name = "cfg-if" 660 | version = "1.0.0" 661 | source = "registry+https://github.com/rust-lang/crates.io-index" 662 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 663 | 664 | [[package]] 665 | name = "chrono" 666 | version = "0.4.22" 667 | source = "registry+https://github.com/rust-lang/crates.io-index" 668 | checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" 669 | dependencies = [ 670 | "iana-time-zone", 671 | "js-sys", 672 | "num-integer", 673 | "num-traits", 674 | "serde", 675 | "time 0.1.44", 676 | "wasm-bindgen", 677 | "winapi", 678 | ] 679 | 680 | [[package]] 681 | name = "clang-sys" 682 | version = "0.26.4" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "6ef0c1bcf2e99c649104bd7a7012d8f8802684400e03db0ec0af48583c6fa0e4" 685 | dependencies = [ 686 | "glob", 687 | "libc", 688 | "libloading", 689 | ] 690 | 691 | [[package]] 692 | name = "clap" 693 | version = "2.34.0" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" 696 | dependencies = [ 697 | "ansi_term", 698 | "atty", 699 | "bitflags", 700 | "strsim", 701 | "textwrap", 702 | "unicode-width", 703 | "vec_map", 704 | ] 705 | 706 | [[package]] 707 | name = "cloudabi" 708 | version = "0.0.3" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 711 | dependencies = [ 712 | "bitflags", 713 | ] 714 | 715 | [[package]] 716 | name = "codespan-reporting" 717 | version = "0.11.1" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 720 | dependencies = [ 721 | "termcolor", 722 | "unicode-width", 723 | ] 724 | 725 | [[package]] 726 | name = "concurrent-queue" 727 | version = "1.2.4" 728 | source = "registry+https://github.com/rust-lang/crates.io-index" 729 | checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" 730 | dependencies = [ 731 | "cache-padded", 732 | ] 733 | 734 | [[package]] 735 | name = "convert_case" 736 | version = "0.4.0" 737 | source = "registry+https://github.com/rust-lang/crates.io-index" 738 | checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" 739 | 740 | [[package]] 741 | name = "cookie" 742 | version = "0.16.1" 743 | source = "registry+https://github.com/rust-lang/crates.io-index" 744 | checksum = "344adc371239ef32293cb1c4fe519592fcf21206c79c02854320afcdf3ab4917" 745 | dependencies = [ 746 | "percent-encoding", 747 | "time 0.3.16", 748 | "version_check 0.9.4", 749 | ] 750 | 751 | [[package]] 752 | name = "core-foundation" 753 | version = "0.9.3" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 756 | dependencies = [ 757 | "core-foundation-sys", 758 | "libc", 759 | ] 760 | 761 | [[package]] 762 | name = "core-foundation-sys" 763 | version = "0.8.3" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 766 | 767 | [[package]] 768 | name = "cpufeatures" 769 | version = "0.2.5" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" 772 | dependencies = [ 773 | "libc", 774 | ] 775 | 776 | [[package]] 777 | name = "crc" 778 | version = "3.0.0" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" 781 | dependencies = [ 782 | "crc-catalog", 783 | ] 784 | 785 | [[package]] 786 | name = "crc-catalog" 787 | version = "2.1.0" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" 790 | 791 | [[package]] 792 | name = "crc32fast" 793 | version = "1.3.2" 794 | source = "registry+https://github.com/rust-lang/crates.io-index" 795 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 796 | dependencies = [ 797 | "cfg-if 1.0.0", 798 | ] 799 | 800 | [[package]] 801 | name = "crossbeam-channel" 802 | version = "0.5.6" 803 | source = "registry+https://github.com/rust-lang/crates.io-index" 804 | checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" 805 | dependencies = [ 806 | "cfg-if 1.0.0", 807 | "crossbeam-utils", 808 | ] 809 | 810 | [[package]] 811 | name = "crossbeam-queue" 812 | version = "0.3.6" 813 | source = "registry+https://github.com/rust-lang/crates.io-index" 814 | checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" 815 | dependencies = [ 816 | "cfg-if 1.0.0", 817 | "crossbeam-utils", 818 | ] 819 | 820 | [[package]] 821 | name = "crossbeam-utils" 822 | version = "0.8.12" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" 825 | dependencies = [ 826 | "cfg-if 1.0.0", 827 | ] 828 | 829 | [[package]] 830 | name = "crypto-common" 831 | version = "0.1.6" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 834 | dependencies = [ 835 | "generic-array", 836 | "typenum", 837 | ] 838 | 839 | [[package]] 840 | name = "ctor" 841 | version = "0.1.26" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" 844 | dependencies = [ 845 | "quote 1.0.21", 846 | "syn", 847 | ] 848 | 849 | [[package]] 850 | name = "cxx" 851 | version = "1.0.80" 852 | source = "registry+https://github.com/rust-lang/crates.io-index" 853 | checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" 854 | dependencies = [ 855 | "cc", 856 | "cxxbridge-flags", 857 | "cxxbridge-macro", 858 | "link-cplusplus", 859 | ] 860 | 861 | [[package]] 862 | name = "cxx-build" 863 | version = "1.0.80" 864 | source = "registry+https://github.com/rust-lang/crates.io-index" 865 | checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" 866 | dependencies = [ 867 | "cc", 868 | "codespan-reporting", 869 | "once_cell", 870 | "proc-macro2 1.0.47", 871 | "quote 1.0.21", 872 | "scratch", 873 | "syn", 874 | ] 875 | 876 | [[package]] 877 | name = "cxxbridge-flags" 878 | version = "1.0.80" 879 | source = "registry+https://github.com/rust-lang/crates.io-index" 880 | checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" 881 | 882 | [[package]] 883 | name = "cxxbridge-macro" 884 | version = "1.0.80" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" 887 | dependencies = [ 888 | "proc-macro2 1.0.47", 889 | "quote 1.0.21", 890 | "syn", 891 | ] 892 | 893 | [[package]] 894 | name = "derive_more" 895 | version = "0.99.17" 896 | source = "registry+https://github.com/rust-lang/crates.io-index" 897 | checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 898 | dependencies = [ 899 | "convert_case", 900 | "proc-macro2 1.0.47", 901 | "quote 1.0.21", 902 | "rustc_version", 903 | "syn", 904 | ] 905 | 906 | [[package]] 907 | name = "digest" 908 | version = "0.10.5" 909 | source = "registry+https://github.com/rust-lang/crates.io-index" 910 | checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" 911 | dependencies = [ 912 | "block-buffer", 913 | "crypto-common", 914 | "subtle", 915 | ] 916 | 917 | [[package]] 918 | name = "dirs" 919 | version = "4.0.0" 920 | source = "registry+https://github.com/rust-lang/crates.io-index" 921 | checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" 922 | dependencies = [ 923 | "dirs-sys", 924 | ] 925 | 926 | [[package]] 927 | name = "dirs-sys" 928 | version = "0.3.7" 929 | source = "registry+https://github.com/rust-lang/crates.io-index" 930 | checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" 931 | dependencies = [ 932 | "libc", 933 | "redox_users", 934 | "winapi", 935 | ] 936 | 937 | [[package]] 938 | name = "dotenv" 939 | version = "0.15.0" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" 942 | 943 | [[package]] 944 | name = "dotenvy" 945 | version = "0.15.6" 946 | source = "registry+https://github.com/rust-lang/crates.io-index" 947 | checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" 948 | 949 | [[package]] 950 | name = "either" 951 | version = "1.8.0" 952 | source = "registry+https://github.com/rust-lang/crates.io-index" 953 | checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" 954 | 955 | [[package]] 956 | name = "encoding_rs" 957 | version = "0.8.31" 958 | source = "registry+https://github.com/rust-lang/crates.io-index" 959 | checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" 960 | dependencies = [ 961 | "cfg-if 1.0.0", 962 | ] 963 | 964 | [[package]] 965 | name = "env_logger" 966 | version = "0.6.2" 967 | source = "registry+https://github.com/rust-lang/crates.io-index" 968 | checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" 969 | dependencies = [ 970 | "atty", 971 | "humantime", 972 | "log", 973 | "regex", 974 | "termcolor", 975 | ] 976 | 977 | [[package]] 978 | name = "event-listener" 979 | version = "2.5.3" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" 982 | 983 | [[package]] 984 | name = "failure" 985 | version = "0.1.8" 986 | source = "registry+https://github.com/rust-lang/crates.io-index" 987 | checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" 988 | dependencies = [ 989 | "backtrace", 990 | "failure_derive", 991 | ] 992 | 993 | [[package]] 994 | name = "failure_derive" 995 | version = "0.1.8" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" 998 | dependencies = [ 999 | "proc-macro2 1.0.47", 1000 | "quote 1.0.21", 1001 | "syn", 1002 | "synstructure", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "fastrand" 1007 | version = "1.8.0" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" 1010 | dependencies = [ 1011 | "instant", 1012 | ] 1013 | 1014 | [[package]] 1015 | name = "flate2" 1016 | version = "1.0.24" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" 1019 | dependencies = [ 1020 | "crc32fast", 1021 | "miniz_oxide", 1022 | ] 1023 | 1024 | [[package]] 1025 | name = "fnv" 1026 | version = "1.0.7" 1027 | source = "registry+https://github.com/rust-lang/crates.io-index" 1028 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 1029 | 1030 | [[package]] 1031 | name = "foreign-types" 1032 | version = "0.3.2" 1033 | source = "registry+https://github.com/rust-lang/crates.io-index" 1034 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 1035 | dependencies = [ 1036 | "foreign-types-shared", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "foreign-types-shared" 1041 | version = "0.1.1" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 1044 | 1045 | [[package]] 1046 | name = "form_urlencoded" 1047 | version = "1.1.0" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 1050 | dependencies = [ 1051 | "percent-encoding", 1052 | ] 1053 | 1054 | [[package]] 1055 | name = "fuchsia-cprng" 1056 | version = "0.1.1" 1057 | source = "registry+https://github.com/rust-lang/crates.io-index" 1058 | checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 1059 | 1060 | [[package]] 1061 | name = "futures" 1062 | version = "0.1.31" 1063 | source = "registry+https://github.com/rust-lang/crates.io-index" 1064 | checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" 1065 | 1066 | [[package]] 1067 | name = "futures-channel" 1068 | version = "0.3.25" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" 1071 | dependencies = [ 1072 | "futures-core", 1073 | "futures-sink", 1074 | ] 1075 | 1076 | [[package]] 1077 | name = "futures-core" 1078 | version = "0.3.25" 1079 | source = "registry+https://github.com/rust-lang/crates.io-index" 1080 | checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" 1081 | 1082 | [[package]] 1083 | name = "futures-cpupool" 1084 | version = "0.1.8" 1085 | source = "registry+https://github.com/rust-lang/crates.io-index" 1086 | checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" 1087 | dependencies = [ 1088 | "futures", 1089 | "num_cpus", 1090 | ] 1091 | 1092 | [[package]] 1093 | name = "futures-intrusive" 1094 | version = "0.4.1" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "1b6bdbb8c5a42b2bb5ee8dd9dc2c7d73ce3e15d26dfe100fb347ffa3f58c672b" 1097 | dependencies = [ 1098 | "futures-core", 1099 | "lock_api", 1100 | "parking_lot", 1101 | ] 1102 | 1103 | [[package]] 1104 | name = "futures-io" 1105 | version = "0.3.25" 1106 | source = "registry+https://github.com/rust-lang/crates.io-index" 1107 | checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" 1108 | 1109 | [[package]] 1110 | name = "futures-lite" 1111 | version = "1.12.0" 1112 | source = "registry+https://github.com/rust-lang/crates.io-index" 1113 | checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" 1114 | dependencies = [ 1115 | "fastrand", 1116 | "futures-core", 1117 | "futures-io", 1118 | "memchr", 1119 | "parking", 1120 | "pin-project-lite", 1121 | "waker-fn", 1122 | ] 1123 | 1124 | [[package]] 1125 | name = "futures-macro" 1126 | version = "0.3.25" 1127 | source = "registry+https://github.com/rust-lang/crates.io-index" 1128 | checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" 1129 | dependencies = [ 1130 | "proc-macro2 1.0.47", 1131 | "quote 1.0.21", 1132 | "syn", 1133 | ] 1134 | 1135 | [[package]] 1136 | name = "futures-sink" 1137 | version = "0.3.25" 1138 | source = "registry+https://github.com/rust-lang/crates.io-index" 1139 | checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" 1140 | 1141 | [[package]] 1142 | name = "futures-task" 1143 | version = "0.3.25" 1144 | source = "registry+https://github.com/rust-lang/crates.io-index" 1145 | checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" 1146 | 1147 | [[package]] 1148 | name = "futures-util" 1149 | version = "0.3.25" 1150 | source = "registry+https://github.com/rust-lang/crates.io-index" 1151 | checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" 1152 | dependencies = [ 1153 | "futures-core", 1154 | "futures-io", 1155 | "futures-macro", 1156 | "futures-sink", 1157 | "futures-task", 1158 | "memchr", 1159 | "pin-project-lite", 1160 | "pin-utils", 1161 | "slab", 1162 | ] 1163 | 1164 | [[package]] 1165 | name = "generic-array" 1166 | version = "0.14.6" 1167 | source = "registry+https://github.com/rust-lang/crates.io-index" 1168 | checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" 1169 | dependencies = [ 1170 | "typenum", 1171 | "version_check 0.9.4", 1172 | ] 1173 | 1174 | [[package]] 1175 | name = "getrandom" 1176 | version = "0.2.8" 1177 | source = "registry+https://github.com/rust-lang/crates.io-index" 1178 | checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" 1179 | dependencies = [ 1180 | "cfg-if 1.0.0", 1181 | "libc", 1182 | "wasi 0.11.0+wasi-snapshot-preview1", 1183 | ] 1184 | 1185 | [[package]] 1186 | name = "gimli" 1187 | version = "0.26.2" 1188 | source = "registry+https://github.com/rust-lang/crates.io-index" 1189 | checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" 1190 | 1191 | [[package]] 1192 | name = "glob" 1193 | version = "0.2.11" 1194 | source = "registry+https://github.com/rust-lang/crates.io-index" 1195 | checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" 1196 | 1197 | [[package]] 1198 | name = "gloo-timers" 1199 | version = "0.2.4" 1200 | source = "registry+https://github.com/rust-lang/crates.io-index" 1201 | checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" 1202 | dependencies = [ 1203 | "futures-channel", 1204 | "futures-core", 1205 | "js-sys", 1206 | "wasm-bindgen", 1207 | ] 1208 | 1209 | [[package]] 1210 | name = "h2" 1211 | version = "0.3.15" 1212 | source = "registry+https://github.com/rust-lang/crates.io-index" 1213 | checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" 1214 | dependencies = [ 1215 | "bytes", 1216 | "fnv", 1217 | "futures-core", 1218 | "futures-sink", 1219 | "futures-util", 1220 | "http", 1221 | "indexmap", 1222 | "slab", 1223 | "tokio", 1224 | "tokio-util", 1225 | "tracing", 1226 | ] 1227 | 1228 | [[package]] 1229 | name = "hashbrown" 1230 | version = "0.1.8" 1231 | source = "registry+https://github.com/rust-lang/crates.io-index" 1232 | checksum = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" 1233 | dependencies = [ 1234 | "byteorder", 1235 | "scopeguard 0.3.3", 1236 | ] 1237 | 1238 | [[package]] 1239 | name = "hashbrown" 1240 | version = "0.12.3" 1241 | source = "registry+https://github.com/rust-lang/crates.io-index" 1242 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 1243 | dependencies = [ 1244 | "ahash", 1245 | ] 1246 | 1247 | [[package]] 1248 | name = "hashlink" 1249 | version = "0.8.1" 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" 1251 | checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" 1252 | dependencies = [ 1253 | "hashbrown 0.12.3", 1254 | ] 1255 | 1256 | [[package]] 1257 | name = "heck" 1258 | version = "0.4.0" 1259 | source = "registry+https://github.com/rust-lang/crates.io-index" 1260 | checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" 1261 | dependencies = [ 1262 | "unicode-segmentation", 1263 | ] 1264 | 1265 | [[package]] 1266 | name = "hermit-abi" 1267 | version = "0.1.19" 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" 1269 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 1270 | dependencies = [ 1271 | "libc", 1272 | ] 1273 | 1274 | [[package]] 1275 | name = "hex" 1276 | version = "0.4.3" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 1279 | 1280 | [[package]] 1281 | name = "hkdf" 1282 | version = "0.12.3" 1283 | source = "registry+https://github.com/rust-lang/crates.io-index" 1284 | checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" 1285 | dependencies = [ 1286 | "hmac", 1287 | ] 1288 | 1289 | [[package]] 1290 | name = "hmac" 1291 | version = "0.12.1" 1292 | source = "registry+https://github.com/rust-lang/crates.io-index" 1293 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 1294 | dependencies = [ 1295 | "digest", 1296 | ] 1297 | 1298 | [[package]] 1299 | name = "http" 1300 | version = "0.2.8" 1301 | source = "registry+https://github.com/rust-lang/crates.io-index" 1302 | checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" 1303 | dependencies = [ 1304 | "bytes", 1305 | "fnv", 1306 | "itoa", 1307 | ] 1308 | 1309 | [[package]] 1310 | name = "httparse" 1311 | version = "1.8.0" 1312 | source = "registry+https://github.com/rust-lang/crates.io-index" 1313 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 1314 | 1315 | [[package]] 1316 | name = "httpdate" 1317 | version = "1.0.2" 1318 | source = "registry+https://github.com/rust-lang/crates.io-index" 1319 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 1320 | 1321 | [[package]] 1322 | name = "humantime" 1323 | version = "1.3.0" 1324 | source = "registry+https://github.com/rust-lang/crates.io-index" 1325 | checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" 1326 | dependencies = [ 1327 | "quick-error", 1328 | ] 1329 | 1330 | [[package]] 1331 | name = "iana-time-zone" 1332 | version = "0.1.53" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" 1335 | dependencies = [ 1336 | "android_system_properties", 1337 | "core-foundation-sys", 1338 | "iana-time-zone-haiku", 1339 | "js-sys", 1340 | "wasm-bindgen", 1341 | "winapi", 1342 | ] 1343 | 1344 | [[package]] 1345 | name = "iana-time-zone-haiku" 1346 | version = "0.1.1" 1347 | source = "registry+https://github.com/rust-lang/crates.io-index" 1348 | checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" 1349 | dependencies = [ 1350 | "cxx", 1351 | "cxx-build", 1352 | ] 1353 | 1354 | [[package]] 1355 | name = "idna" 1356 | version = "0.3.0" 1357 | source = "registry+https://github.com/rust-lang/crates.io-index" 1358 | checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" 1359 | dependencies = [ 1360 | "unicode-bidi", 1361 | "unicode-normalization", 1362 | ] 1363 | 1364 | [[package]] 1365 | name = "indexmap" 1366 | version = "1.9.1" 1367 | source = "registry+https://github.com/rust-lang/crates.io-index" 1368 | checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" 1369 | dependencies = [ 1370 | "autocfg 1.1.0", 1371 | "hashbrown 0.12.3", 1372 | ] 1373 | 1374 | [[package]] 1375 | name = "instant" 1376 | version = "0.1.12" 1377 | source = "registry+https://github.com/rust-lang/crates.io-index" 1378 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 1379 | dependencies = [ 1380 | "cfg-if 1.0.0", 1381 | ] 1382 | 1383 | [[package]] 1384 | name = "itertools" 1385 | version = "0.10.5" 1386 | source = "registry+https://github.com/rust-lang/crates.io-index" 1387 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 1388 | dependencies = [ 1389 | "either", 1390 | ] 1391 | 1392 | [[package]] 1393 | name = "itoa" 1394 | version = "1.0.4" 1395 | source = "registry+https://github.com/rust-lang/crates.io-index" 1396 | checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" 1397 | 1398 | [[package]] 1399 | name = "jobserver" 1400 | version = "0.1.25" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" 1403 | dependencies = [ 1404 | "libc", 1405 | ] 1406 | 1407 | [[package]] 1408 | name = "js-sys" 1409 | version = "0.3.60" 1410 | source = "registry+https://github.com/rust-lang/crates.io-index" 1411 | checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" 1412 | dependencies = [ 1413 | "wasm-bindgen", 1414 | ] 1415 | 1416 | [[package]] 1417 | name = "jwt" 1418 | version = "0.16.0" 1419 | source = "registry+https://github.com/rust-lang/crates.io-index" 1420 | checksum = "6204285f77fe7d9784db3fdc449ecce1a0114927a51d5a41c4c7a292011c015f" 1421 | dependencies = [ 1422 | "base64 0.13.1", 1423 | "crypto-common", 1424 | "digest", 1425 | "hmac", 1426 | "serde", 1427 | "serde_json", 1428 | "sha2", 1429 | ] 1430 | 1431 | [[package]] 1432 | name = "kv-log-macro" 1433 | version = "1.0.7" 1434 | source = "registry+https://github.com/rust-lang/crates.io-index" 1435 | checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" 1436 | dependencies = [ 1437 | "log", 1438 | ] 1439 | 1440 | [[package]] 1441 | name = "language-tags" 1442 | version = "0.3.2" 1443 | source = "registry+https://github.com/rust-lang/crates.io-index" 1444 | checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" 1445 | 1446 | [[package]] 1447 | name = "lazy_static" 1448 | version = "1.4.0" 1449 | source = "registry+https://github.com/rust-lang/crates.io-index" 1450 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 1451 | 1452 | [[package]] 1453 | name = "libc" 1454 | version = "0.2.137" 1455 | source = "registry+https://github.com/rust-lang/crates.io-index" 1456 | checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" 1457 | 1458 | [[package]] 1459 | name = "libloading" 1460 | version = "0.5.2" 1461 | source = "registry+https://github.com/rust-lang/crates.io-index" 1462 | checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" 1463 | dependencies = [ 1464 | "cc", 1465 | "winapi", 1466 | ] 1467 | 1468 | [[package]] 1469 | name = "link-cplusplus" 1470 | version = "1.0.7" 1471 | source = "registry+https://github.com/rust-lang/crates.io-index" 1472 | checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" 1473 | dependencies = [ 1474 | "cc", 1475 | ] 1476 | 1477 | [[package]] 1478 | name = "local-channel" 1479 | version = "0.1.3" 1480 | source = "registry+https://github.com/rust-lang/crates.io-index" 1481 | checksum = "7f303ec0e94c6c54447f84f3b0ef7af769858a9c4ef56ef2a986d3dcd4c3fc9c" 1482 | dependencies = [ 1483 | "futures-core", 1484 | "futures-sink", 1485 | "futures-util", 1486 | "local-waker", 1487 | ] 1488 | 1489 | [[package]] 1490 | name = "local-waker" 1491 | version = "0.1.3" 1492 | source = "registry+https://github.com/rust-lang/crates.io-index" 1493 | checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" 1494 | 1495 | [[package]] 1496 | name = "lock_api" 1497 | version = "0.4.9" 1498 | source = "registry+https://github.com/rust-lang/crates.io-index" 1499 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 1500 | dependencies = [ 1501 | "autocfg 1.1.0", 1502 | "scopeguard 1.1.0", 1503 | ] 1504 | 1505 | [[package]] 1506 | name = "log" 1507 | version = "0.4.17" 1508 | source = "registry+https://github.com/rust-lang/crates.io-index" 1509 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 1510 | dependencies = [ 1511 | "cfg-if 1.0.0", 1512 | "value-bag", 1513 | ] 1514 | 1515 | [[package]] 1516 | name = "md-5" 1517 | version = "0.10.5" 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" 1519 | checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" 1520 | dependencies = [ 1521 | "digest", 1522 | ] 1523 | 1524 | [[package]] 1525 | name = "memchr" 1526 | version = "2.5.0" 1527 | source = "registry+https://github.com/rust-lang/crates.io-index" 1528 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 1529 | 1530 | [[package]] 1531 | name = "mime" 1532 | version = "0.3.16" 1533 | source = "registry+https://github.com/rust-lang/crates.io-index" 1534 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 1535 | 1536 | [[package]] 1537 | name = "minimal-lexical" 1538 | version = "0.2.1" 1539 | source = "registry+https://github.com/rust-lang/crates.io-index" 1540 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 1541 | 1542 | [[package]] 1543 | name = "miniz_oxide" 1544 | version = "0.5.4" 1545 | source = "registry+https://github.com/rust-lang/crates.io-index" 1546 | checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" 1547 | dependencies = [ 1548 | "adler", 1549 | ] 1550 | 1551 | [[package]] 1552 | name = "mio" 1553 | version = "0.8.5" 1554 | source = "registry+https://github.com/rust-lang/crates.io-index" 1555 | checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" 1556 | dependencies = [ 1557 | "libc", 1558 | "log", 1559 | "wasi 0.11.0+wasi-snapshot-preview1", 1560 | "windows-sys 0.42.0", 1561 | ] 1562 | 1563 | [[package]] 1564 | name = "native-tls" 1565 | version = "0.2.10" 1566 | source = "registry+https://github.com/rust-lang/crates.io-index" 1567 | checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" 1568 | dependencies = [ 1569 | "lazy_static", 1570 | "libc", 1571 | "log", 1572 | "openssl", 1573 | "openssl-probe", 1574 | "openssl-sys", 1575 | "schannel", 1576 | "security-framework", 1577 | "security-framework-sys", 1578 | "tempfile", 1579 | ] 1580 | 1581 | [[package]] 1582 | name = "nom" 1583 | version = "4.2.3" 1584 | source = "registry+https://github.com/rust-lang/crates.io-index" 1585 | checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" 1586 | dependencies = [ 1587 | "memchr", 1588 | "version_check 0.1.5", 1589 | ] 1590 | 1591 | [[package]] 1592 | name = "nom" 1593 | version = "7.1.1" 1594 | source = "registry+https://github.com/rust-lang/crates.io-index" 1595 | checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" 1596 | dependencies = [ 1597 | "memchr", 1598 | "minimal-lexical", 1599 | ] 1600 | 1601 | [[package]] 1602 | name = "num-integer" 1603 | version = "0.1.45" 1604 | source = "registry+https://github.com/rust-lang/crates.io-index" 1605 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 1606 | dependencies = [ 1607 | "autocfg 1.1.0", 1608 | "num-traits", 1609 | ] 1610 | 1611 | [[package]] 1612 | name = "num-traits" 1613 | version = "0.2.15" 1614 | source = "registry+https://github.com/rust-lang/crates.io-index" 1615 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 1616 | dependencies = [ 1617 | "autocfg 1.1.0", 1618 | ] 1619 | 1620 | [[package]] 1621 | name = "num_cpus" 1622 | version = "1.13.1" 1623 | source = "registry+https://github.com/rust-lang/crates.io-index" 1624 | checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 1625 | dependencies = [ 1626 | "hermit-abi", 1627 | "libc", 1628 | ] 1629 | 1630 | [[package]] 1631 | name = "num_threads" 1632 | version = "0.1.6" 1633 | source = "registry+https://github.com/rust-lang/crates.io-index" 1634 | checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" 1635 | dependencies = [ 1636 | "libc", 1637 | ] 1638 | 1639 | [[package]] 1640 | name = "object" 1641 | version = "0.29.0" 1642 | source = "registry+https://github.com/rust-lang/crates.io-index" 1643 | checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" 1644 | dependencies = [ 1645 | "memchr", 1646 | ] 1647 | 1648 | [[package]] 1649 | name = "once_cell" 1650 | version = "1.15.0" 1651 | source = "registry+https://github.com/rust-lang/crates.io-index" 1652 | checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" 1653 | 1654 | [[package]] 1655 | name = "openssl" 1656 | version = "0.10.42" 1657 | source = "registry+https://github.com/rust-lang/crates.io-index" 1658 | checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" 1659 | dependencies = [ 1660 | "bitflags", 1661 | "cfg-if 1.0.0", 1662 | "foreign-types", 1663 | "libc", 1664 | "once_cell", 1665 | "openssl-macros", 1666 | "openssl-sys", 1667 | ] 1668 | 1669 | [[package]] 1670 | name = "openssl-macros" 1671 | version = "0.1.0" 1672 | source = "registry+https://github.com/rust-lang/crates.io-index" 1673 | checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" 1674 | dependencies = [ 1675 | "proc-macro2 1.0.47", 1676 | "quote 1.0.21", 1677 | "syn", 1678 | ] 1679 | 1680 | [[package]] 1681 | name = "openssl-probe" 1682 | version = "0.1.5" 1683 | source = "registry+https://github.com/rust-lang/crates.io-index" 1684 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 1685 | 1686 | [[package]] 1687 | name = "openssl-sys" 1688 | version = "0.9.77" 1689 | source = "registry+https://github.com/rust-lang/crates.io-index" 1690 | checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" 1691 | dependencies = [ 1692 | "autocfg 1.1.0", 1693 | "cc", 1694 | "libc", 1695 | "pkg-config", 1696 | "vcpkg", 1697 | ] 1698 | 1699 | [[package]] 1700 | name = "parking" 1701 | version = "2.0.0" 1702 | source = "registry+https://github.com/rust-lang/crates.io-index" 1703 | checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" 1704 | 1705 | [[package]] 1706 | name = "parking_lot" 1707 | version = "0.12.1" 1708 | source = "registry+https://github.com/rust-lang/crates.io-index" 1709 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 1710 | dependencies = [ 1711 | "lock_api", 1712 | "parking_lot_core", 1713 | ] 1714 | 1715 | [[package]] 1716 | name = "parking_lot_core" 1717 | version = "0.9.4" 1718 | source = "registry+https://github.com/rust-lang/crates.io-index" 1719 | checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" 1720 | dependencies = [ 1721 | "cfg-if 1.0.0", 1722 | "libc", 1723 | "redox_syscall", 1724 | "smallvec", 1725 | "windows-sys 0.42.0", 1726 | ] 1727 | 1728 | [[package]] 1729 | name = "paste" 1730 | version = "1.0.9" 1731 | source = "registry+https://github.com/rust-lang/crates.io-index" 1732 | checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" 1733 | 1734 | [[package]] 1735 | name = "peeking_take_while" 1736 | version = "0.1.2" 1737 | source = "registry+https://github.com/rust-lang/crates.io-index" 1738 | checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" 1739 | 1740 | [[package]] 1741 | name = "percent-encoding" 1742 | version = "2.2.0" 1743 | source = "registry+https://github.com/rust-lang/crates.io-index" 1744 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 1745 | 1746 | [[package]] 1747 | name = "pin-project-lite" 1748 | version = "0.2.9" 1749 | source = "registry+https://github.com/rust-lang/crates.io-index" 1750 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 1751 | 1752 | [[package]] 1753 | name = "pin-utils" 1754 | version = "0.1.0" 1755 | source = "registry+https://github.com/rust-lang/crates.io-index" 1756 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1757 | 1758 | [[package]] 1759 | name = "pkg-config" 1760 | version = "0.3.26" 1761 | source = "registry+https://github.com/rust-lang/crates.io-index" 1762 | checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" 1763 | 1764 | [[package]] 1765 | name = "polling" 1766 | version = "2.4.0" 1767 | source = "registry+https://github.com/rust-lang/crates.io-index" 1768 | checksum = "ab4609a838d88b73d8238967b60dd115cc08d38e2bbaf51ee1e4b695f89122e2" 1769 | dependencies = [ 1770 | "autocfg 1.1.0", 1771 | "cfg-if 1.0.0", 1772 | "libc", 1773 | "log", 1774 | "wepoll-ffi", 1775 | "winapi", 1776 | ] 1777 | 1778 | [[package]] 1779 | name = "ppv-lite86" 1780 | version = "0.2.16" 1781 | source = "registry+https://github.com/rust-lang/crates.io-index" 1782 | checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" 1783 | 1784 | [[package]] 1785 | name = "proc-macro2" 1786 | version = "0.4.30" 1787 | source = "registry+https://github.com/rust-lang/crates.io-index" 1788 | checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" 1789 | dependencies = [ 1790 | "unicode-xid 0.1.0", 1791 | ] 1792 | 1793 | [[package]] 1794 | name = "proc-macro2" 1795 | version = "1.0.47" 1796 | source = "registry+https://github.com/rust-lang/crates.io-index" 1797 | checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" 1798 | dependencies = [ 1799 | "unicode-ident", 1800 | ] 1801 | 1802 | [[package]] 1803 | name = "quick-error" 1804 | version = "1.2.3" 1805 | source = "registry+https://github.com/rust-lang/crates.io-index" 1806 | checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" 1807 | 1808 | [[package]] 1809 | name = "quote" 1810 | version = "0.6.13" 1811 | source = "registry+https://github.com/rust-lang/crates.io-index" 1812 | checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" 1813 | dependencies = [ 1814 | "proc-macro2 0.4.30", 1815 | ] 1816 | 1817 | [[package]] 1818 | name = "quote" 1819 | version = "1.0.21" 1820 | source = "registry+https://github.com/rust-lang/crates.io-index" 1821 | checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" 1822 | dependencies = [ 1823 | "proc-macro2 1.0.47", 1824 | ] 1825 | 1826 | [[package]] 1827 | name = "rand" 1828 | version = "0.4.6" 1829 | source = "registry+https://github.com/rust-lang/crates.io-index" 1830 | checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" 1831 | dependencies = [ 1832 | "fuchsia-cprng", 1833 | "libc", 1834 | "rand_core 0.3.1", 1835 | "rdrand", 1836 | "winapi", 1837 | ] 1838 | 1839 | [[package]] 1840 | name = "rand" 1841 | version = "0.6.5" 1842 | source = "registry+https://github.com/rust-lang/crates.io-index" 1843 | checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" 1844 | dependencies = [ 1845 | "autocfg 0.1.8", 1846 | "libc", 1847 | "rand_chacha 0.1.1", 1848 | "rand_core 0.4.2", 1849 | "rand_hc", 1850 | "rand_isaac", 1851 | "rand_jitter", 1852 | "rand_os", 1853 | "rand_pcg", 1854 | "rand_xorshift", 1855 | "winapi", 1856 | ] 1857 | 1858 | [[package]] 1859 | name = "rand" 1860 | version = "0.8.5" 1861 | source = "registry+https://github.com/rust-lang/crates.io-index" 1862 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1863 | dependencies = [ 1864 | "libc", 1865 | "rand_chacha 0.3.1", 1866 | "rand_core 0.6.4", 1867 | ] 1868 | 1869 | [[package]] 1870 | name = "rand_chacha" 1871 | version = "0.1.1" 1872 | source = "registry+https://github.com/rust-lang/crates.io-index" 1873 | checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" 1874 | dependencies = [ 1875 | "autocfg 0.1.8", 1876 | "rand_core 0.3.1", 1877 | ] 1878 | 1879 | [[package]] 1880 | name = "rand_chacha" 1881 | version = "0.3.1" 1882 | source = "registry+https://github.com/rust-lang/crates.io-index" 1883 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1884 | dependencies = [ 1885 | "ppv-lite86", 1886 | "rand_core 0.6.4", 1887 | ] 1888 | 1889 | [[package]] 1890 | name = "rand_core" 1891 | version = "0.3.1" 1892 | source = "registry+https://github.com/rust-lang/crates.io-index" 1893 | checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 1894 | dependencies = [ 1895 | "rand_core 0.4.2", 1896 | ] 1897 | 1898 | [[package]] 1899 | name = "rand_core" 1900 | version = "0.4.2" 1901 | source = "registry+https://github.com/rust-lang/crates.io-index" 1902 | checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 1903 | 1904 | [[package]] 1905 | name = "rand_core" 1906 | version = "0.6.4" 1907 | source = "registry+https://github.com/rust-lang/crates.io-index" 1908 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1909 | dependencies = [ 1910 | "getrandom", 1911 | ] 1912 | 1913 | [[package]] 1914 | name = "rand_hc" 1915 | version = "0.1.0" 1916 | source = "registry+https://github.com/rust-lang/crates.io-index" 1917 | checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" 1918 | dependencies = [ 1919 | "rand_core 0.3.1", 1920 | ] 1921 | 1922 | [[package]] 1923 | name = "rand_isaac" 1924 | version = "0.1.1" 1925 | source = "registry+https://github.com/rust-lang/crates.io-index" 1926 | checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" 1927 | dependencies = [ 1928 | "rand_core 0.3.1", 1929 | ] 1930 | 1931 | [[package]] 1932 | name = "rand_jitter" 1933 | version = "0.1.4" 1934 | source = "registry+https://github.com/rust-lang/crates.io-index" 1935 | checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" 1936 | dependencies = [ 1937 | "libc", 1938 | "rand_core 0.4.2", 1939 | "winapi", 1940 | ] 1941 | 1942 | [[package]] 1943 | name = "rand_os" 1944 | version = "0.1.3" 1945 | source = "registry+https://github.com/rust-lang/crates.io-index" 1946 | checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" 1947 | dependencies = [ 1948 | "cloudabi", 1949 | "fuchsia-cprng", 1950 | "libc", 1951 | "rand_core 0.4.2", 1952 | "rdrand", 1953 | "winapi", 1954 | ] 1955 | 1956 | [[package]] 1957 | name = "rand_pcg" 1958 | version = "0.1.2" 1959 | source = "registry+https://github.com/rust-lang/crates.io-index" 1960 | checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" 1961 | dependencies = [ 1962 | "autocfg 0.1.8", 1963 | "rand_core 0.4.2", 1964 | ] 1965 | 1966 | [[package]] 1967 | name = "rand_xorshift" 1968 | version = "0.1.1" 1969 | source = "registry+https://github.com/rust-lang/crates.io-index" 1970 | checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" 1971 | dependencies = [ 1972 | "rand_core 0.3.1", 1973 | ] 1974 | 1975 | [[package]] 1976 | name = "rdrand" 1977 | version = "0.4.0" 1978 | source = "registry+https://github.com/rust-lang/crates.io-index" 1979 | checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 1980 | dependencies = [ 1981 | "rand_core 0.3.1", 1982 | ] 1983 | 1984 | [[package]] 1985 | name = "redox_syscall" 1986 | version = "0.2.16" 1987 | source = "registry+https://github.com/rust-lang/crates.io-index" 1988 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 1989 | dependencies = [ 1990 | "bitflags", 1991 | ] 1992 | 1993 | [[package]] 1994 | name = "redox_users" 1995 | version = "0.4.3" 1996 | source = "registry+https://github.com/rust-lang/crates.io-index" 1997 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1998 | dependencies = [ 1999 | "getrandom", 2000 | "redox_syscall", 2001 | "thiserror", 2002 | ] 2003 | 2004 | [[package]] 2005 | name = "regex" 2006 | version = "1.6.0" 2007 | source = "registry+https://github.com/rust-lang/crates.io-index" 2008 | checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" 2009 | dependencies = [ 2010 | "aho-corasick", 2011 | "memchr", 2012 | "regex-syntax", 2013 | ] 2014 | 2015 | [[package]] 2016 | name = "regex-syntax" 2017 | version = "0.6.27" 2018 | source = "registry+https://github.com/rust-lang/crates.io-index" 2019 | checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" 2020 | 2021 | [[package]] 2022 | name = "remove_dir_all" 2023 | version = "0.5.3" 2024 | source = "registry+https://github.com/rust-lang/crates.io-index" 2025 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 2026 | dependencies = [ 2027 | "winapi", 2028 | ] 2029 | 2030 | [[package]] 2031 | name = "rust-auth" 2032 | version = "0.1.0" 2033 | dependencies = [ 2034 | "actix", 2035 | "actix-web", 2036 | "actix-web-httpauth", 2037 | "argonautica", 2038 | "chrono", 2039 | "dotenv", 2040 | "hmac", 2041 | "jwt", 2042 | "serde", 2043 | "serde_json", 2044 | "sha2", 2045 | "sqlx", 2046 | ] 2047 | 2048 | [[package]] 2049 | name = "rustc-demangle" 2050 | version = "0.1.21" 2051 | source = "registry+https://github.com/rust-lang/crates.io-index" 2052 | checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" 2053 | 2054 | [[package]] 2055 | name = "rustc_version" 2056 | version = "0.4.0" 2057 | source = "registry+https://github.com/rust-lang/crates.io-index" 2058 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 2059 | dependencies = [ 2060 | "semver", 2061 | ] 2062 | 2063 | [[package]] 2064 | name = "ryu" 2065 | version = "1.0.11" 2066 | source = "registry+https://github.com/rust-lang/crates.io-index" 2067 | checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" 2068 | 2069 | [[package]] 2070 | name = "schannel" 2071 | version = "0.1.20" 2072 | source = "registry+https://github.com/rust-lang/crates.io-index" 2073 | checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" 2074 | dependencies = [ 2075 | "lazy_static", 2076 | "windows-sys 0.36.1", 2077 | ] 2078 | 2079 | [[package]] 2080 | name = "scopeguard" 2081 | version = "0.3.3" 2082 | source = "registry+https://github.com/rust-lang/crates.io-index" 2083 | checksum = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" 2084 | 2085 | [[package]] 2086 | name = "scopeguard" 2087 | version = "1.1.0" 2088 | source = "registry+https://github.com/rust-lang/crates.io-index" 2089 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 2090 | 2091 | [[package]] 2092 | name = "scratch" 2093 | version = "1.0.2" 2094 | source = "registry+https://github.com/rust-lang/crates.io-index" 2095 | checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" 2096 | 2097 | [[package]] 2098 | name = "security-framework" 2099 | version = "2.7.0" 2100 | source = "registry+https://github.com/rust-lang/crates.io-index" 2101 | checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" 2102 | dependencies = [ 2103 | "bitflags", 2104 | "core-foundation", 2105 | "core-foundation-sys", 2106 | "libc", 2107 | "security-framework-sys", 2108 | ] 2109 | 2110 | [[package]] 2111 | name = "security-framework-sys" 2112 | version = "2.6.1" 2113 | source = "registry+https://github.com/rust-lang/crates.io-index" 2114 | checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" 2115 | dependencies = [ 2116 | "core-foundation-sys", 2117 | "libc", 2118 | ] 2119 | 2120 | [[package]] 2121 | name = "semver" 2122 | version = "1.0.14" 2123 | source = "registry+https://github.com/rust-lang/crates.io-index" 2124 | checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" 2125 | 2126 | [[package]] 2127 | name = "serde" 2128 | version = "1.0.147" 2129 | source = "registry+https://github.com/rust-lang/crates.io-index" 2130 | checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" 2131 | dependencies = [ 2132 | "serde_derive", 2133 | ] 2134 | 2135 | [[package]] 2136 | name = "serde_derive" 2137 | version = "1.0.147" 2138 | source = "registry+https://github.com/rust-lang/crates.io-index" 2139 | checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" 2140 | dependencies = [ 2141 | "proc-macro2 1.0.47", 2142 | "quote 1.0.21", 2143 | "syn", 2144 | ] 2145 | 2146 | [[package]] 2147 | name = "serde_json" 2148 | version = "1.0.87" 2149 | source = "registry+https://github.com/rust-lang/crates.io-index" 2150 | checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" 2151 | dependencies = [ 2152 | "itoa", 2153 | "ryu", 2154 | "serde", 2155 | ] 2156 | 2157 | [[package]] 2158 | name = "serde_urlencoded" 2159 | version = "0.7.1" 2160 | source = "registry+https://github.com/rust-lang/crates.io-index" 2161 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 2162 | dependencies = [ 2163 | "form_urlencoded", 2164 | "itoa", 2165 | "ryu", 2166 | "serde", 2167 | ] 2168 | 2169 | [[package]] 2170 | name = "sha1" 2171 | version = "0.10.5" 2172 | source = "registry+https://github.com/rust-lang/crates.io-index" 2173 | checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" 2174 | dependencies = [ 2175 | "cfg-if 1.0.0", 2176 | "cpufeatures", 2177 | "digest", 2178 | ] 2179 | 2180 | [[package]] 2181 | name = "sha2" 2182 | version = "0.10.6" 2183 | source = "registry+https://github.com/rust-lang/crates.io-index" 2184 | checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" 2185 | dependencies = [ 2186 | "cfg-if 1.0.0", 2187 | "cpufeatures", 2188 | "digest", 2189 | ] 2190 | 2191 | [[package]] 2192 | name = "signal-hook" 2193 | version = "0.3.14" 2194 | source = "registry+https://github.com/rust-lang/crates.io-index" 2195 | checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" 2196 | dependencies = [ 2197 | "libc", 2198 | "signal-hook-registry", 2199 | ] 2200 | 2201 | [[package]] 2202 | name = "signal-hook-registry" 2203 | version = "1.4.0" 2204 | source = "registry+https://github.com/rust-lang/crates.io-index" 2205 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 2206 | dependencies = [ 2207 | "libc", 2208 | ] 2209 | 2210 | [[package]] 2211 | name = "slab" 2212 | version = "0.4.7" 2213 | source = "registry+https://github.com/rust-lang/crates.io-index" 2214 | checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" 2215 | dependencies = [ 2216 | "autocfg 1.1.0", 2217 | ] 2218 | 2219 | [[package]] 2220 | name = "smallvec" 2221 | version = "1.10.0" 2222 | source = "registry+https://github.com/rust-lang/crates.io-index" 2223 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 2224 | 2225 | [[package]] 2226 | name = "socket2" 2227 | version = "0.4.7" 2228 | source = "registry+https://github.com/rust-lang/crates.io-index" 2229 | checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" 2230 | dependencies = [ 2231 | "libc", 2232 | "winapi", 2233 | ] 2234 | 2235 | [[package]] 2236 | name = "sqlformat" 2237 | version = "0.2.0" 2238 | source = "registry+https://github.com/rust-lang/crates.io-index" 2239 | checksum = "f87e292b4291f154971a43c3774364e2cbcaec599d3f5bf6fa9d122885dbc38a" 2240 | dependencies = [ 2241 | "itertools", 2242 | "nom 7.1.1", 2243 | "unicode_categories", 2244 | ] 2245 | 2246 | [[package]] 2247 | name = "sqlx" 2248 | version = "0.6.2" 2249 | source = "registry+https://github.com/rust-lang/crates.io-index" 2250 | checksum = "9249290c05928352f71c077cc44a464d880c63f26f7534728cca008e135c0428" 2251 | dependencies = [ 2252 | "sqlx-core", 2253 | "sqlx-macros", 2254 | ] 2255 | 2256 | [[package]] 2257 | name = "sqlx-core" 2258 | version = "0.6.2" 2259 | source = "registry+https://github.com/rust-lang/crates.io-index" 2260 | checksum = "dcbc16ddba161afc99e14d1713a453747a2b07fc097d2009f4c300ec99286105" 2261 | dependencies = [ 2262 | "ahash", 2263 | "atoi", 2264 | "base64 0.13.1", 2265 | "bitflags", 2266 | "byteorder", 2267 | "bytes", 2268 | "chrono", 2269 | "crc", 2270 | "crossbeam-queue", 2271 | "dirs", 2272 | "dotenvy", 2273 | "either", 2274 | "event-listener", 2275 | "futures-channel", 2276 | "futures-core", 2277 | "futures-intrusive", 2278 | "futures-util", 2279 | "hashlink", 2280 | "hex", 2281 | "hkdf", 2282 | "hmac", 2283 | "indexmap", 2284 | "itoa", 2285 | "libc", 2286 | "log", 2287 | "md-5", 2288 | "memchr", 2289 | "once_cell", 2290 | "paste", 2291 | "percent-encoding", 2292 | "rand 0.8.5", 2293 | "serde", 2294 | "serde_json", 2295 | "sha1", 2296 | "sha2", 2297 | "smallvec", 2298 | "sqlformat", 2299 | "sqlx-rt", 2300 | "stringprep", 2301 | "thiserror", 2302 | "url", 2303 | "whoami", 2304 | ] 2305 | 2306 | [[package]] 2307 | name = "sqlx-macros" 2308 | version = "0.6.2" 2309 | source = "registry+https://github.com/rust-lang/crates.io-index" 2310 | checksum = "b850fa514dc11f2ee85be9d055c512aa866746adfacd1cb42d867d68e6a5b0d9" 2311 | dependencies = [ 2312 | "dotenvy", 2313 | "either", 2314 | "heck", 2315 | "once_cell", 2316 | "proc-macro2 1.0.47", 2317 | "quote 1.0.21", 2318 | "sha2", 2319 | "sqlx-core", 2320 | "sqlx-rt", 2321 | "syn", 2322 | "url", 2323 | ] 2324 | 2325 | [[package]] 2326 | name = "sqlx-rt" 2327 | version = "0.6.2" 2328 | source = "registry+https://github.com/rust-lang/crates.io-index" 2329 | checksum = "24c5b2d25fa654cc5f841750b8e1cdedbe21189bf9a9382ee90bfa9dd3562396" 2330 | dependencies = [ 2331 | "async-native-tls", 2332 | "async-std", 2333 | "native-tls", 2334 | ] 2335 | 2336 | [[package]] 2337 | name = "stringprep" 2338 | version = "0.1.2" 2339 | source = "registry+https://github.com/rust-lang/crates.io-index" 2340 | checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" 2341 | dependencies = [ 2342 | "unicode-bidi", 2343 | "unicode-normalization", 2344 | ] 2345 | 2346 | [[package]] 2347 | name = "strsim" 2348 | version = "0.8.0" 2349 | source = "registry+https://github.com/rust-lang/crates.io-index" 2350 | checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 2351 | 2352 | [[package]] 2353 | name = "subtle" 2354 | version = "2.4.1" 2355 | source = "registry+https://github.com/rust-lang/crates.io-index" 2356 | checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" 2357 | 2358 | [[package]] 2359 | name = "syn" 2360 | version = "1.0.103" 2361 | source = "registry+https://github.com/rust-lang/crates.io-index" 2362 | checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" 2363 | dependencies = [ 2364 | "proc-macro2 1.0.47", 2365 | "quote 1.0.21", 2366 | "unicode-ident", 2367 | ] 2368 | 2369 | [[package]] 2370 | name = "synstructure" 2371 | version = "0.12.6" 2372 | source = "registry+https://github.com/rust-lang/crates.io-index" 2373 | checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" 2374 | dependencies = [ 2375 | "proc-macro2 1.0.47", 2376 | "quote 1.0.21", 2377 | "syn", 2378 | "unicode-xid 0.2.4", 2379 | ] 2380 | 2381 | [[package]] 2382 | name = "tempdir" 2383 | version = "0.3.7" 2384 | source = "registry+https://github.com/rust-lang/crates.io-index" 2385 | checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" 2386 | dependencies = [ 2387 | "rand 0.4.6", 2388 | "remove_dir_all", 2389 | ] 2390 | 2391 | [[package]] 2392 | name = "tempfile" 2393 | version = "3.3.0" 2394 | source = "registry+https://github.com/rust-lang/crates.io-index" 2395 | checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" 2396 | dependencies = [ 2397 | "cfg-if 1.0.0", 2398 | "fastrand", 2399 | "libc", 2400 | "redox_syscall", 2401 | "remove_dir_all", 2402 | "winapi", 2403 | ] 2404 | 2405 | [[package]] 2406 | name = "termcolor" 2407 | version = "1.1.3" 2408 | source = "registry+https://github.com/rust-lang/crates.io-index" 2409 | checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" 2410 | dependencies = [ 2411 | "winapi-util", 2412 | ] 2413 | 2414 | [[package]] 2415 | name = "textwrap" 2416 | version = "0.11.0" 2417 | source = "registry+https://github.com/rust-lang/crates.io-index" 2418 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 2419 | dependencies = [ 2420 | "unicode-width", 2421 | ] 2422 | 2423 | [[package]] 2424 | name = "thiserror" 2425 | version = "1.0.37" 2426 | source = "registry+https://github.com/rust-lang/crates.io-index" 2427 | checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" 2428 | dependencies = [ 2429 | "thiserror-impl", 2430 | ] 2431 | 2432 | [[package]] 2433 | name = "thiserror-impl" 2434 | version = "1.0.37" 2435 | source = "registry+https://github.com/rust-lang/crates.io-index" 2436 | checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" 2437 | dependencies = [ 2438 | "proc-macro2 1.0.47", 2439 | "quote 1.0.21", 2440 | "syn", 2441 | ] 2442 | 2443 | [[package]] 2444 | name = "time" 2445 | version = "0.1.44" 2446 | source = "registry+https://github.com/rust-lang/crates.io-index" 2447 | checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" 2448 | dependencies = [ 2449 | "libc", 2450 | "wasi 0.10.0+wasi-snapshot-preview1", 2451 | "winapi", 2452 | ] 2453 | 2454 | [[package]] 2455 | name = "time" 2456 | version = "0.3.16" 2457 | source = "registry+https://github.com/rust-lang/crates.io-index" 2458 | checksum = "0fab5c8b9980850e06d92ddbe3ab839c062c801f3927c0fb8abd6fc8e918fbca" 2459 | dependencies = [ 2460 | "itoa", 2461 | "libc", 2462 | "num_threads", 2463 | "serde", 2464 | "time-core", 2465 | "time-macros", 2466 | ] 2467 | 2468 | [[package]] 2469 | name = "time-core" 2470 | version = "0.1.0" 2471 | source = "registry+https://github.com/rust-lang/crates.io-index" 2472 | checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" 2473 | 2474 | [[package]] 2475 | name = "time-macros" 2476 | version = "0.2.5" 2477 | source = "registry+https://github.com/rust-lang/crates.io-index" 2478 | checksum = "65bb801831d812c562ae7d2bfb531f26e66e4e1f6b17307ba4149c5064710e5b" 2479 | dependencies = [ 2480 | "time-core", 2481 | ] 2482 | 2483 | [[package]] 2484 | name = "tinyvec" 2485 | version = "1.6.0" 2486 | source = "registry+https://github.com/rust-lang/crates.io-index" 2487 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 2488 | dependencies = [ 2489 | "tinyvec_macros", 2490 | ] 2491 | 2492 | [[package]] 2493 | name = "tinyvec_macros" 2494 | version = "0.1.0" 2495 | source = "registry+https://github.com/rust-lang/crates.io-index" 2496 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 2497 | 2498 | [[package]] 2499 | name = "tokio" 2500 | version = "1.21.2" 2501 | source = "registry+https://github.com/rust-lang/crates.io-index" 2502 | checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" 2503 | dependencies = [ 2504 | "autocfg 1.1.0", 2505 | "bytes", 2506 | "libc", 2507 | "memchr", 2508 | "mio", 2509 | "parking_lot", 2510 | "pin-project-lite", 2511 | "signal-hook-registry", 2512 | "socket2", 2513 | "winapi", 2514 | ] 2515 | 2516 | [[package]] 2517 | name = "tokio-util" 2518 | version = "0.7.4" 2519 | source = "registry+https://github.com/rust-lang/crates.io-index" 2520 | checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" 2521 | dependencies = [ 2522 | "bytes", 2523 | "futures-core", 2524 | "futures-sink", 2525 | "pin-project-lite", 2526 | "tokio", 2527 | "tracing", 2528 | ] 2529 | 2530 | [[package]] 2531 | name = "tracing" 2532 | version = "0.1.37" 2533 | source = "registry+https://github.com/rust-lang/crates.io-index" 2534 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 2535 | dependencies = [ 2536 | "cfg-if 1.0.0", 2537 | "log", 2538 | "pin-project-lite", 2539 | "tracing-core", 2540 | ] 2541 | 2542 | [[package]] 2543 | name = "tracing-core" 2544 | version = "0.1.30" 2545 | source = "registry+https://github.com/rust-lang/crates.io-index" 2546 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 2547 | dependencies = [ 2548 | "once_cell", 2549 | ] 2550 | 2551 | [[package]] 2552 | name = "typenum" 2553 | version = "1.15.0" 2554 | source = "registry+https://github.com/rust-lang/crates.io-index" 2555 | checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 2556 | 2557 | [[package]] 2558 | name = "unicode-bidi" 2559 | version = "0.3.8" 2560 | source = "registry+https://github.com/rust-lang/crates.io-index" 2561 | checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" 2562 | 2563 | [[package]] 2564 | name = "unicode-ident" 2565 | version = "1.0.5" 2566 | source = "registry+https://github.com/rust-lang/crates.io-index" 2567 | checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" 2568 | 2569 | [[package]] 2570 | name = "unicode-normalization" 2571 | version = "0.1.22" 2572 | source = "registry+https://github.com/rust-lang/crates.io-index" 2573 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 2574 | dependencies = [ 2575 | "tinyvec", 2576 | ] 2577 | 2578 | [[package]] 2579 | name = "unicode-segmentation" 2580 | version = "1.10.0" 2581 | source = "registry+https://github.com/rust-lang/crates.io-index" 2582 | checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" 2583 | 2584 | [[package]] 2585 | name = "unicode-width" 2586 | version = "0.1.10" 2587 | source = "registry+https://github.com/rust-lang/crates.io-index" 2588 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 2589 | 2590 | [[package]] 2591 | name = "unicode-xid" 2592 | version = "0.1.0" 2593 | source = "registry+https://github.com/rust-lang/crates.io-index" 2594 | checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 2595 | 2596 | [[package]] 2597 | name = "unicode-xid" 2598 | version = "0.2.4" 2599 | source = "registry+https://github.com/rust-lang/crates.io-index" 2600 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 2601 | 2602 | [[package]] 2603 | name = "unicode_categories" 2604 | version = "0.1.1" 2605 | source = "registry+https://github.com/rust-lang/crates.io-index" 2606 | checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" 2607 | 2608 | [[package]] 2609 | name = "url" 2610 | version = "2.3.1" 2611 | source = "registry+https://github.com/rust-lang/crates.io-index" 2612 | checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" 2613 | dependencies = [ 2614 | "form_urlencoded", 2615 | "idna", 2616 | "percent-encoding", 2617 | ] 2618 | 2619 | [[package]] 2620 | name = "value-bag" 2621 | version = "1.0.0-alpha.9" 2622 | source = "registry+https://github.com/rust-lang/crates.io-index" 2623 | checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" 2624 | dependencies = [ 2625 | "ctor", 2626 | "version_check 0.9.4", 2627 | ] 2628 | 2629 | [[package]] 2630 | name = "vcpkg" 2631 | version = "0.2.15" 2632 | source = "registry+https://github.com/rust-lang/crates.io-index" 2633 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 2634 | 2635 | [[package]] 2636 | name = "vec_map" 2637 | version = "0.8.2" 2638 | source = "registry+https://github.com/rust-lang/crates.io-index" 2639 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" 2640 | 2641 | [[package]] 2642 | name = "version_check" 2643 | version = "0.1.5" 2644 | source = "registry+https://github.com/rust-lang/crates.io-index" 2645 | checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" 2646 | 2647 | [[package]] 2648 | name = "version_check" 2649 | version = "0.9.4" 2650 | source = "registry+https://github.com/rust-lang/crates.io-index" 2651 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 2652 | 2653 | [[package]] 2654 | name = "waker-fn" 2655 | version = "1.1.0" 2656 | source = "registry+https://github.com/rust-lang/crates.io-index" 2657 | checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" 2658 | 2659 | [[package]] 2660 | name = "wasi" 2661 | version = "0.10.0+wasi-snapshot-preview1" 2662 | source = "registry+https://github.com/rust-lang/crates.io-index" 2663 | checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" 2664 | 2665 | [[package]] 2666 | name = "wasi" 2667 | version = "0.11.0+wasi-snapshot-preview1" 2668 | source = "registry+https://github.com/rust-lang/crates.io-index" 2669 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 2670 | 2671 | [[package]] 2672 | name = "wasm-bindgen" 2673 | version = "0.2.83" 2674 | source = "registry+https://github.com/rust-lang/crates.io-index" 2675 | checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" 2676 | dependencies = [ 2677 | "cfg-if 1.0.0", 2678 | "wasm-bindgen-macro", 2679 | ] 2680 | 2681 | [[package]] 2682 | name = "wasm-bindgen-backend" 2683 | version = "0.2.83" 2684 | source = "registry+https://github.com/rust-lang/crates.io-index" 2685 | checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" 2686 | dependencies = [ 2687 | "bumpalo", 2688 | "log", 2689 | "once_cell", 2690 | "proc-macro2 1.0.47", 2691 | "quote 1.0.21", 2692 | "syn", 2693 | "wasm-bindgen-shared", 2694 | ] 2695 | 2696 | [[package]] 2697 | name = "wasm-bindgen-futures" 2698 | version = "0.4.33" 2699 | source = "registry+https://github.com/rust-lang/crates.io-index" 2700 | checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" 2701 | dependencies = [ 2702 | "cfg-if 1.0.0", 2703 | "js-sys", 2704 | "wasm-bindgen", 2705 | "web-sys", 2706 | ] 2707 | 2708 | [[package]] 2709 | name = "wasm-bindgen-macro" 2710 | version = "0.2.83" 2711 | source = "registry+https://github.com/rust-lang/crates.io-index" 2712 | checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" 2713 | dependencies = [ 2714 | "quote 1.0.21", 2715 | "wasm-bindgen-macro-support", 2716 | ] 2717 | 2718 | [[package]] 2719 | name = "wasm-bindgen-macro-support" 2720 | version = "0.2.83" 2721 | source = "registry+https://github.com/rust-lang/crates.io-index" 2722 | checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" 2723 | dependencies = [ 2724 | "proc-macro2 1.0.47", 2725 | "quote 1.0.21", 2726 | "syn", 2727 | "wasm-bindgen-backend", 2728 | "wasm-bindgen-shared", 2729 | ] 2730 | 2731 | [[package]] 2732 | name = "wasm-bindgen-shared" 2733 | version = "0.2.83" 2734 | source = "registry+https://github.com/rust-lang/crates.io-index" 2735 | checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" 2736 | 2737 | [[package]] 2738 | name = "web-sys" 2739 | version = "0.3.60" 2740 | source = "registry+https://github.com/rust-lang/crates.io-index" 2741 | checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" 2742 | dependencies = [ 2743 | "js-sys", 2744 | "wasm-bindgen", 2745 | ] 2746 | 2747 | [[package]] 2748 | name = "wepoll-ffi" 2749 | version = "0.1.2" 2750 | source = "registry+https://github.com/rust-lang/crates.io-index" 2751 | checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" 2752 | dependencies = [ 2753 | "cc", 2754 | ] 2755 | 2756 | [[package]] 2757 | name = "which" 2758 | version = "2.0.1" 2759 | source = "registry+https://github.com/rust-lang/crates.io-index" 2760 | checksum = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164" 2761 | dependencies = [ 2762 | "failure", 2763 | "libc", 2764 | ] 2765 | 2766 | [[package]] 2767 | name = "whoami" 2768 | version = "1.2.3" 2769 | source = "registry+https://github.com/rust-lang/crates.io-index" 2770 | checksum = "d6631b6a2fd59b1841b622e8f1a7ad241ef0a46f2d580464ce8140ac94cbd571" 2771 | dependencies = [ 2772 | "bumpalo", 2773 | "wasm-bindgen", 2774 | "web-sys", 2775 | ] 2776 | 2777 | [[package]] 2778 | name = "winapi" 2779 | version = "0.3.9" 2780 | source = "registry+https://github.com/rust-lang/crates.io-index" 2781 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2782 | dependencies = [ 2783 | "winapi-i686-pc-windows-gnu", 2784 | "winapi-x86_64-pc-windows-gnu", 2785 | ] 2786 | 2787 | [[package]] 2788 | name = "winapi-i686-pc-windows-gnu" 2789 | version = "0.4.0" 2790 | source = "registry+https://github.com/rust-lang/crates.io-index" 2791 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2792 | 2793 | [[package]] 2794 | name = "winapi-util" 2795 | version = "0.1.5" 2796 | source = "registry+https://github.com/rust-lang/crates.io-index" 2797 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2798 | dependencies = [ 2799 | "winapi", 2800 | ] 2801 | 2802 | [[package]] 2803 | name = "winapi-x86_64-pc-windows-gnu" 2804 | version = "0.4.0" 2805 | source = "registry+https://github.com/rust-lang/crates.io-index" 2806 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2807 | 2808 | [[package]] 2809 | name = "windows-sys" 2810 | version = "0.36.1" 2811 | source = "registry+https://github.com/rust-lang/crates.io-index" 2812 | checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" 2813 | dependencies = [ 2814 | "windows_aarch64_msvc 0.36.1", 2815 | "windows_i686_gnu 0.36.1", 2816 | "windows_i686_msvc 0.36.1", 2817 | "windows_x86_64_gnu 0.36.1", 2818 | "windows_x86_64_msvc 0.36.1", 2819 | ] 2820 | 2821 | [[package]] 2822 | name = "windows-sys" 2823 | version = "0.42.0" 2824 | source = "registry+https://github.com/rust-lang/crates.io-index" 2825 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 2826 | dependencies = [ 2827 | "windows_aarch64_gnullvm", 2828 | "windows_aarch64_msvc 0.42.0", 2829 | "windows_i686_gnu 0.42.0", 2830 | "windows_i686_msvc 0.42.0", 2831 | "windows_x86_64_gnu 0.42.0", 2832 | "windows_x86_64_gnullvm", 2833 | "windows_x86_64_msvc 0.42.0", 2834 | ] 2835 | 2836 | [[package]] 2837 | name = "windows_aarch64_gnullvm" 2838 | version = "0.42.0" 2839 | source = "registry+https://github.com/rust-lang/crates.io-index" 2840 | checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" 2841 | 2842 | [[package]] 2843 | name = "windows_aarch64_msvc" 2844 | version = "0.36.1" 2845 | source = "registry+https://github.com/rust-lang/crates.io-index" 2846 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" 2847 | 2848 | [[package]] 2849 | name = "windows_aarch64_msvc" 2850 | version = "0.42.0" 2851 | source = "registry+https://github.com/rust-lang/crates.io-index" 2852 | checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" 2853 | 2854 | [[package]] 2855 | name = "windows_i686_gnu" 2856 | version = "0.36.1" 2857 | source = "registry+https://github.com/rust-lang/crates.io-index" 2858 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" 2859 | 2860 | [[package]] 2861 | name = "windows_i686_gnu" 2862 | version = "0.42.0" 2863 | source = "registry+https://github.com/rust-lang/crates.io-index" 2864 | checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" 2865 | 2866 | [[package]] 2867 | name = "windows_i686_msvc" 2868 | version = "0.36.1" 2869 | source = "registry+https://github.com/rust-lang/crates.io-index" 2870 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" 2871 | 2872 | [[package]] 2873 | name = "windows_i686_msvc" 2874 | version = "0.42.0" 2875 | source = "registry+https://github.com/rust-lang/crates.io-index" 2876 | checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" 2877 | 2878 | [[package]] 2879 | name = "windows_x86_64_gnu" 2880 | version = "0.36.1" 2881 | source = "registry+https://github.com/rust-lang/crates.io-index" 2882 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" 2883 | 2884 | [[package]] 2885 | name = "windows_x86_64_gnu" 2886 | version = "0.42.0" 2887 | source = "registry+https://github.com/rust-lang/crates.io-index" 2888 | checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" 2889 | 2890 | [[package]] 2891 | name = "windows_x86_64_gnullvm" 2892 | version = "0.42.0" 2893 | source = "registry+https://github.com/rust-lang/crates.io-index" 2894 | checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" 2895 | 2896 | [[package]] 2897 | name = "windows_x86_64_msvc" 2898 | version = "0.36.1" 2899 | source = "registry+https://github.com/rust-lang/crates.io-index" 2900 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" 2901 | 2902 | [[package]] 2903 | name = "windows_x86_64_msvc" 2904 | version = "0.42.0" 2905 | source = "registry+https://github.com/rust-lang/crates.io-index" 2906 | checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" 2907 | 2908 | [[package]] 2909 | name = "zstd" 2910 | version = "0.11.2+zstd.1.5.2" 2911 | source = "registry+https://github.com/rust-lang/crates.io-index" 2912 | checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" 2913 | dependencies = [ 2914 | "zstd-safe", 2915 | ] 2916 | 2917 | [[package]] 2918 | name = "zstd-safe" 2919 | version = "5.0.2+zstd.1.5.2" 2920 | source = "registry+https://github.com/rust-lang/crates.io-index" 2921 | checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" 2922 | dependencies = [ 2923 | "libc", 2924 | "zstd-sys", 2925 | ] 2926 | 2927 | [[package]] 2928 | name = "zstd-sys" 2929 | version = "2.0.1+zstd.1.5.2" 2930 | source = "registry+https://github.com/rust-lang/crates.io-index" 2931 | checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" 2932 | dependencies = [ 2933 | "cc", 2934 | "libc", 2935 | ] 2936 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-auth" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | actix = "0.13.0" 10 | actix-web = "4.2.1" 11 | chrono = { version = "0.4.22", features = ["serde"] } 12 | dotenv = "0.15.0" 13 | serde = { version = "1.0.145", features = ["derive"] } 14 | serde_json = "1.0.86" 15 | sqlx = { version = "0.6.2", features = ["runtime-async-std-native-tls", "postgres", "chrono"] } 16 | 17 | # DEPENDENCIES SPECIFIC TO AUTH 18 | actix-web-httpauth = "0.8.0" 19 | argonautica = "0.2.0" 20 | hmac = "0.12.1" 21 | jwt = "0.16.0" 22 | sha2 = "0.10.6" 23 | -------------------------------------------------------------------------------- /src/articles.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE articles ( 2 | id SERIAL PRIMARY KEY, 3 | title VARCHAR(255), 4 | content TEXT, 5 | published_by INT, 6 | published_on TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 7 | CONSTRAINT fk_articles_users FOREIGN KEY (published_by) REFERENCES users (id), 8 | ); -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use actix_web::{ 2 | dev::ServiceRequest, 3 | error::Error, 4 | web::{self, Data}, 5 | App, HttpMessage, HttpServer, 6 | }; 7 | use dotenv::dotenv; 8 | use sqlx::{postgres::PgPoolOptions, Pool, Postgres}; 9 | 10 | use actix_web_httpauth::{ 11 | extractors::{ 12 | bearer::{self, BearerAuth}, 13 | AuthenticationError, 14 | }, 15 | middleware::HttpAuthentication, 16 | }; 17 | use hmac::{Hmac, Mac}; 18 | use jwt::VerifyWithKey; 19 | use serde::{Deserialize, Serialize}; 20 | use sha2::Sha256; 21 | 22 | mod services; 23 | use services::{basic_auth, create_article, create_user}; 24 | 25 | pub struct AppState { 26 | db: Pool, 27 | } 28 | 29 | #[derive(Serialize, Deserialize, Clone)] 30 | pub struct TokenClaims { 31 | id: i32, 32 | } 33 | 34 | async fn validator( 35 | req: ServiceRequest, 36 | credentials: BearerAuth, 37 | ) -> Result { 38 | let jwt_secret: String = std::env::var("JWT_SECRET").expect("JWT_SECRET must be set!"); 39 | let key: Hmac = Hmac::new_from_slice(jwt_secret.as_bytes()).unwrap(); 40 | let token_string = credentials.token(); 41 | 42 | let claims: Result = token_string 43 | .verify_with_key(&key) 44 | .map_err(|_| "Invalid token"); 45 | 46 | match claims { 47 | Ok(value) => { 48 | req.extensions_mut().insert(value); 49 | Ok(req) 50 | } 51 | Err(_) => { 52 | let config = req 53 | .app_data::() 54 | .cloned() 55 | .unwrap_or_default() 56 | .scope(""); 57 | 58 | Err((AuthenticationError::from(config).into(), req)) 59 | } 60 | } 61 | } 62 | 63 | #[actix_web::main] 64 | async fn main() -> std::io::Result<()> { 65 | dotenv().ok(); 66 | let database_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set"); 67 | let pool = PgPoolOptions::new() 68 | .max_connections(5) 69 | .connect(&database_url) 70 | .await 71 | .expect("Error building a connection pool"); 72 | 73 | HttpServer::new(move || { 74 | let bearer_middleware = HttpAuthentication::bearer(validator); 75 | App::new() 76 | .app_data(Data::new(AppState { db: pool.clone() })) 77 | .service(basic_auth) 78 | .service(create_user) 79 | .service( 80 | web::scope("") 81 | .wrap(bearer_middleware) 82 | .service(create_article), 83 | ) 84 | }) 85 | .bind(("127.0.0.1", 8080))? 86 | .run() 87 | .await 88 | } 89 | -------------------------------------------------------------------------------- /src/services.rs: -------------------------------------------------------------------------------- 1 | use crate::{AppState, TokenClaims}; 2 | use actix_web::{ 3 | get, post, 4 | web::{Data, Json, ReqData}, 5 | HttpResponse, Responder, 6 | }; 7 | use actix_web_httpauth::extractors::basic::BasicAuth; 8 | use argonautica::{Hasher, Verifier}; 9 | use chrono::NaiveDateTime; 10 | use hmac::{Hmac, Mac}; 11 | use jwt::SignWithKey; 12 | use serde::{Deserialize, Serialize}; 13 | use sha2::Sha256; 14 | use sqlx::{self, FromRow}; 15 | 16 | #[derive(Deserialize)] 17 | struct CreateUserBody { 18 | username: String, 19 | password: String, 20 | } 21 | 22 | #[derive(Serialize, FromRow)] 23 | struct UserNoPassword { 24 | id: i32, 25 | username: String, 26 | } 27 | 28 | #[derive(Serialize, FromRow)] 29 | struct AuthUser { 30 | id: i32, 31 | username: String, 32 | password: String, 33 | } 34 | 35 | #[derive(Deserialize)] 36 | struct CreateArticleBody { 37 | title: String, 38 | content: String, 39 | } 40 | 41 | #[derive(Serialize, FromRow)] 42 | struct Article { 43 | id: i32, 44 | title: String, 45 | content: String, 46 | published_by: i32, 47 | published_on: Option, 48 | } 49 | 50 | #[post("/user")] 51 | async fn create_user(state: Data, body: Json) -> impl Responder { 52 | let user: CreateUserBody = body.into_inner(); 53 | 54 | let hash_secret = std::env::var("HASH_SECRET").expect("HASH_SECRET must be set!"); 55 | let mut hasher = Hasher::default(); 56 | let hash = hasher 57 | .with_password(user.password) 58 | .with_secret_key(hash_secret) 59 | .hash() 60 | .unwrap(); 61 | 62 | match sqlx::query_as::<_, UserNoPassword>( 63 | "INSERT INTO users (username, password) 64 | VALUES ($1, $2) 65 | RETURNING id, username", 66 | ) 67 | .bind(user.username) 68 | .bind(hash) 69 | .fetch_one(&state.db) 70 | .await 71 | { 72 | Ok(user) => HttpResponse::Ok().json(user), 73 | Err(error) => HttpResponse::InternalServerError().json(format!("{:?}", error)), 74 | } 75 | } 76 | 77 | #[get("/auth")] 78 | async fn basic_auth(state: Data, credentials: BasicAuth) -> impl Responder { 79 | let jwt_secret: Hmac = Hmac::new_from_slice( 80 | std::env::var("JWT_SECRET") 81 | .expect("JWT_SECRET must be set!") 82 | .as_bytes(), 83 | ) 84 | .unwrap(); 85 | let username = credentials.user_id(); 86 | let password = credentials.password(); 87 | 88 | match password { 89 | None => HttpResponse::Unauthorized().json("Must provide username and password"), 90 | Some(pass) => { 91 | match sqlx::query_as::<_, AuthUser>( 92 | "SELECT id, username, password FROM users WHERE username = $1", 93 | ) 94 | .bind(username.to_string()) 95 | .fetch_one(&state.db) 96 | .await 97 | { 98 | Ok(user) => { 99 | let hash_secret = 100 | std::env::var("HASH_SECRET").expect("HASH_SECRET must be set!"); 101 | let mut verifier = Verifier::default(); 102 | let is_valid = verifier 103 | .with_hash(user.password) 104 | .with_password(pass) 105 | .with_secret_key(hash_secret) 106 | .verify() 107 | .unwrap(); 108 | 109 | if is_valid { 110 | let claims = TokenClaims { id: user.id }; 111 | let token_str = claims.sign_with_key(&jwt_secret).unwrap(); 112 | HttpResponse::Ok().json(token_str) 113 | } else { 114 | HttpResponse::Unauthorized().json("Incorrect username or password") 115 | } 116 | } 117 | Err(error) => HttpResponse::InternalServerError().json(format!("{:?}", error)), 118 | } 119 | } 120 | } 121 | } 122 | 123 | #[post("/article")] 124 | async fn create_article( 125 | state: Data, 126 | req_user: Option>, 127 | body: Json, 128 | ) -> impl Responder { 129 | match req_user { 130 | Some(user) => { 131 | let article: CreateArticleBody = body.into_inner(); 132 | 133 | match sqlx::query_as::<_, Article>( 134 | "INSERT INTO articles (title, content, published_by) 135 | VALUES ($1, $2, $3) 136 | RETURNING id, title, content, published_by, published_on", 137 | ) 138 | .bind(article.title) 139 | .bind(article.content) 140 | .bind(user.id) 141 | .fetch_one(&state.db) 142 | .await 143 | { 144 | Ok(articles) => HttpResponse::Ok().json(articles), 145 | Err(error) => HttpResponse::InternalServerError().json(format!("{:?}", error)), 146 | } 147 | } 148 | _ => HttpResponse::Unauthorized().json("Unable to verify identity"), 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /src/users.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE users ( 2 | id SERIAL PRIMARY KEY, 3 | username VARCHAR(255), 4 | password VARCHAR(255), 5 | ); --------------------------------------------------------------------------------