commit b44c7fe91a98a5b8be5562d6677715090044911d from: Benjamin Stürz date: Sat Jan 11 21:01:52 2025 UTC use aws s3 commit - 25c75cd07e0c46f6c4ba23c8b1ae8b2ae93e0bf2 commit + b44c7fe91a98a5b8be5562d6677715090044911d blob - 60656cec3433a3c5777f95125d0b352d0805e747 blob + 12b02702a6cee68c5ceca2ee8b6671c0688bf073 --- Cargo.lock +++ Cargo.lock @@ -96,21 +96,6 @@ dependencies = [ ] [[package]] -name = "attohttpc" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "412b79ce053cef36eda52c25664b45ec92a21769488e20d5a8bf0b3c9e1a28cb" -dependencies = [ - "http 1.2.0", - "log", - "rustls 0.23.20", - "serde", - "serde_json", - "url", - "webpki-roots", -] - -[[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -159,32 +144,6 @@ dependencies = [ ] [[package]] -name = "aws-creds" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f84143206b9c72b3c5cb65415de60c7539c79cd1559290fddec657939131be0" -dependencies = [ - "attohttpc", - "home", - "log", - "quick-xml", - "rust-ini", - "serde", - "thiserror 1.0.69", - "time", - "url", -] - -[[package]] -name = "aws-region" -version = "0.25.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aed3f9c7eac9be28662fdb3b0f4d1951e812f7c64fed4f0327ba702f459b3b" -dependencies = [ - "thiserror 1.0.69", -] - -[[package]] name = "aws-runtime" version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -193,6 +152,7 @@ dependencies = [ "aws-credential-types", "aws-sigv4", "aws-smithy-async", + "aws-smithy-eventstream", "aws-smithy-http", "aws-smithy-runtime", "aws-smithy-runtime-api", @@ -210,6 +170,40 @@ dependencies = [ ] [[package]] +name = "aws-sdk-s3" +version = "1.68.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5ddf1dc70287dc9a2f953766a1fe15e3e74aef02fd1335f2afa475c9b4f4fc" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-checksums", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "bytes", + "fastrand", + "hex", + "hmac", + "http 0.2.12", + "http-body 0.4.6", + "lru", + "once_cell", + "percent-encoding", + "regex-lite", + "sha2", + "tracing", + "url", +] + +[[package]] name = "aws-sdk-secretsmanager" version = "1.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -306,20 +300,26 @@ source = "registry+https://github.com/rust-lang/crates checksum = "7d3820e0c08d0737872ff3c7c1f21ebbb6693d832312d6152bf18ef50a5471c2" dependencies = [ "aws-credential-types", + "aws-smithy-eventstream", "aws-smithy-http", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", + "crypto-bigint 0.5.5", "form_urlencoded", "hex", "hmac", "http 0.2.12", "http 1.2.0", "once_cell", + "p256", "percent-encoding", + "ring", "sha2", + "subtle", "time", "tracing", + "zeroize", ] [[package]] @@ -334,11 +334,44 @@ dependencies = [ ] [[package]] +name = "aws-smithy-checksums" +version = "0.60.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1a71073fca26775c8b5189175ea8863afb1c9ea2cceb02a5de5ad9dfbaa795" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "bytes", + "crc32c", + "crc32fast", + "hex", + "http 0.2.12", + "http-body 0.4.6", + "md-5", + "pin-project-lite", + "sha1", + "sha2", + "tracing", +] + +[[package]] +name = "aws-smithy-eventstream" +version = "0.60.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cef7d0a272725f87e51ba2bf89f8c21e4df61b9e49ae1ac367a6d69916ef7c90" +dependencies = [ + "aws-smithy-types", + "bytes", + "crc32fast", +] + +[[package]] name = "aws-smithy-http" version = "0.60.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c8bc3e8fdc6b8d07d976e301c02fe553f72a39b7a9fea820e023268467d7ab6" dependencies = [ + "aws-smithy-eventstream", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", @@ -481,6 +514,12 @@ dependencies = [ ] [[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] name = "base64" version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -538,9 +577,9 @@ version = "0.1.0" dependencies = [ "anyhow", "aws-config", + "aws-sdk-s3", "aws-sdk-secretsmanager", "rocket", - "rust-s3", "serde", "serde_json", "sqlx", @@ -604,28 +643,8 @@ name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "const-random" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" -dependencies = [ - "const-random-macro", -] [[package]] -name = "const-random-macro" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" -dependencies = [ - "getrandom", - "once_cell", - "tiny-keccak", -] - -[[package]] name = "cookie" version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -677,6 +696,24 @@ source = "registry+https://github.com/rust-lang/crates checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] +name = "crc32c" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a47af21622d091a8f0fb295b88bc886ac74efcc613efc19f5d0b21de5c89e47" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] name = "crossbeam-queue" version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -692,12 +729,28 @@ source = "registry+https://github.com/rust-lang/crates checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] -name = "crunchy" -version = "0.2.2" +name = "crypto-bigint" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] [[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] name = "crypto-common" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -705,6 +758,16 @@ checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3 dependencies = [ "generic-array", "typenum", +] + +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", ] [[package]] @@ -725,7 +788,6 @@ source = "registry+https://github.com/rust-lang/crates checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", - "serde", ] [[package]] @@ -785,21 +847,24 @@ dependencies = [ ] [[package]] -name = "dlv-list" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" -dependencies = [ - "const-random", -] - -[[package]] name = "dotenvy" version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve", + "rfc6979", + "signature 1.6.4", +] + +[[package]] name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -809,6 +874,26 @@ dependencies = [ ] [[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest", + "ff", + "generic-array", + "group", + "pkcs8 0.9.0", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] name = "encoding_rs" version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -862,6 +947,16 @@ source = "registry+https://github.com/rust-lang/crates checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] name = "figment" version = "0.10.19" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -915,7 +1010,6 @@ checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72 dependencies = [ "futures-channel", "futures-core", - "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -965,17 +1059,6 @@ name = "futures-io" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] [[package]] name = "futures-sink" @@ -998,7 +1081,6 @@ dependencies = [ "futures-channel", "futures-core", "futures-io", - "futures-macro", "futures-sink", "futures-task", "memchr", @@ -1052,6 +1134,17 @@ name = "glob" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff", + "rand_core", + "subtle", +] [[package]] name = "h2" @@ -1074,12 +1167,6 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" @@ -1095,7 +1182,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown 0.15.2", + "hashbrown", ] [[package]] @@ -1403,7 +1490,7 @@ source = "registry+https://github.com/rust-lang/crates checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown", "serde", ] @@ -1502,6 +1589,15 @@ dependencies = [ "serde_json", "tracing", "tracing-subscriber", +] + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown", ] [[package]] @@ -1514,17 +1610,6 @@ dependencies = [ ] [[package]] -name = "maybe-async" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] name = "md-5" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1535,12 +1620,6 @@ dependencies = [ ] [[package]] -name = "md5" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" - -[[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1686,16 +1765,6 @@ source = "registry+https://github.com/rust-lang/crates checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] -name = "ordered-multimap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" -dependencies = [ - "dlv-list", - "hashbrown 0.14.5", -] - -[[package]] name = "outref" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1708,6 +1777,17 @@ source = "registry+https://github.com/rust-lang/crates checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] name = "parking" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1792,19 +1872,29 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "der", - "pkcs8", - "spki", + "der 0.7.9", + "pkcs8 0.10.2", + "spki 0.7.3", ] [[package]] name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", +] + +[[package]] +name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.9", + "spki 0.7.3", ] [[package]] @@ -1848,16 +1938,6 @@ dependencies = [ "syn", "version_check", "yansi", -] - -[[package]] -name = "quick-xml" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" -dependencies = [ - "memchr", - "serde", ] [[package]] @@ -1979,6 +2059,17 @@ source = "registry+https://github.com/rust-lang/crates checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac", + "zeroize", +] + +[[package]] name = "ring" version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2086,63 +2177,15 @@ dependencies = [ "num-integer", "num-traits", "pkcs1", - "pkcs8", + "pkcs8 0.10.2", "rand_core", - "signature", - "spki", + "signature 2.2.0", + "spki 0.7.3", "subtle", "zeroize", ] [[package]] -name = "rust-ini" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e310ef0e1b6eeb79169a1171daf9abcb87a2e17c03bee2c4bb100b55c75409f" -dependencies = [ - "cfg-if", - "ordered-multimap", - "trim-in-place", -] - -[[package]] -name = "rust-s3" -version = "0.35.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3df3f353b1f4209dcf437d777cda90279c397ab15a0cd6fd06bd32c88591533" -dependencies = [ - "async-trait", - "aws-creds", - "aws-region", - "base64 0.22.1", - "bytes", - "cfg-if", - "futures", - "hex", - "hmac", - "http 0.2.12", - "hyper", - "hyper-rustls", - "log", - "maybe-async", - "md5", - "percent-encoding", - "quick-xml", - "rustls 0.21.12", - "rustls-native-certs", - "serde", - "serde_derive", - "serde_json", - "sha2", - "thiserror 1.0.69", - "time", - "tokio", - "tokio-rustls", - "tokio-stream", - "url", -] - -[[package]] name = "rustc-demangle" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2294,6 +2337,20 @@ checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a dependencies = [ "ring", "untrusted", +] + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct", + "der 0.6.1", + "generic-array", + "pkcs8 0.9.0", + "subtle", + "zeroize", ] [[package]] @@ -2426,6 +2483,16 @@ dependencies = [ [[package]] name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "signature" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" @@ -2473,12 +2540,22 @@ dependencies = [ [[package]] name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + +[[package]] +name = "spki" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der", + "der 0.7.9", ] [[package]] @@ -2509,7 +2586,7 @@ dependencies = [ "futures-intrusive", "futures-io", "futures-util", - "hashbrown 0.15.2", + "hashbrown", "hashlink", "indexmap", "log", @@ -2522,7 +2599,7 @@ dependencies = [ "serde_json", "sha2", "smallvec", - "thiserror 2.0.10", + "thiserror", "tokio", "tokio-stream", "tracing", @@ -2606,7 +2683,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.10", + "thiserror", "tracing", "whoami", ] @@ -2643,7 +2720,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.10", + "thiserror", "tracing", "whoami", ] @@ -2750,31 +2827,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3ac7f54ca534db81081ef1c1e7f6ea8a3ef428d2fc069097c079443d24124d3" dependencies = [ - "thiserror-impl 2.0.10", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "thiserror-impl", ] [[package]] @@ -2830,15 +2887,6 @@ dependencies = [ ] [[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] name = "tinystr" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3028,12 +3076,6 @@ dependencies = [ ] [[package]] -name = "trim-in-place" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc" - -[[package]] name = "try-lock" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" blob - 57e9c02357113734251c213056e114d65adeb9a8 blob + 6b091741a7ef3a920582074fb5cd4fd43d3531bf --- Cargo.toml +++ Cargo.toml @@ -6,9 +6,9 @@ edition = "2021" [dependencies] anyhow = "1.0.95" aws-config = "1.5.13" +s3 = { package = "aws-sdk-s3", version = "1.68.0" } aws-sdk-secretsmanager = "1.57.0" rocket = "0.5.1" -s3 = { package = "rust-s3", version = "0.35.1", default-features = false, features = ["tokio-rustls-tls"] } serde = { version = "1.0.217", features = ["derive"] } serde_json = "1.0.135" sqlx = { version = "0.8.3", features = ["postgres", "runtime-tokio", "tls-rustls-ring-webpki"] } blob - 3503a72fb83f326f02535f220d4f21cd97d4f61a blob + cd88dcda985a1a595b14724daffbf38277157c1d --- src/bottle.rs +++ src/bottle.rs @@ -1,17 +1,14 @@ use rocket::response::content::RawHtml; use sqlx::postgres::{PgPool, PgPoolOptions}; use aws_config::{BehaviorVersion, Region}; -use s3::{ - bucket::Bucket, - creds::Credentials, -}; use serde::Deserialize; use crate::{html, html::Element, Html}; pub struct BottleFuck { pub db: PgPool, - pub fs: Box, + pub fs: s3::Client, pub css: String, + pub bucket: &'static str, } #[derive(Deserialize)] @@ -53,25 +50,31 @@ impl BottleFuck { .await .expect("failed to connect to database"); - let fs = Bucket::new( - "bukek", - "us-east-1".parse().expect("invalid region"), - Credentials::from_profile(Some("default")) - .expect("failed to load credentials") - ) - .expect("failed to connect to s3"); + let fs = s3::Client::new(&config); - let css = fs + /* fs + .get_object() + .bucket("bukek") + .key("style.css") + .send() + .await + .ok() + .and_then(|css| css.body().collect())*/ + + /*let css = fs .get_object("style.css") .await .ok() .and_then(|css| css.to_string().ok()) - .unwrap_or_else(|| include_str!("style.css").to_string()); + .unwrap_or_else(|| include_str!("style.css").to_string()); */ + + let css = include_str!("style.css").to_string(); Self { db, fs, css, + bucket: "bukek", } } blob - d6b33c2f37619261477c92e09c78199ab7b8ea82 blob + a919df360db4310be2fe79401d1276ac496506ee --- src/routes/pic.rs +++ src/routes/pic.rs @@ -11,12 +11,18 @@ pub async fn pic( ) -> Result<(ContentType, Vec), (Status, Html)> { let data = bottle .fs - .get_object(path) + .get_object() + .bucket(bottle.bucket) + .key(path) + .send() .await .map_err(|e| (Status::NotFound, bottle.error(e)))? + .body + .collect() + .await + .map_err(|e| (Status::InternalServerError, bottle.error(e)))? .to_vec(); - let ct = path .split_once('.') .and_then(|(_, ext)| ContentType::from_extension(ext)) blob - cd111c224986f49d259e8ce63f14caba39ba1a65 blob + d8e08852038a2de33bfd3a390f4383d60d8f91c2 --- src/routes/upload.rs +++ src/routes/upload.rs @@ -56,10 +56,13 @@ pub async fn post( let uuid = Uuid::new_v4().to_string(); let filename = format!("{uuid}.{ext}"); - bottle .fs - .put_object(&filename, &data) + .put_object() + .bucket(bottle.bucket) + .key(&filename) + .body(data.into()) + .send() .await .map_err(|e| bottle.error(e))?;