Update AWS SNS SDK crate.

This commit is contained in:
Orne Brocaar 2023-04-11 14:57:03 +01:00
parent 31e359b314
commit e93d3bc534
3 changed files with 123 additions and 147 deletions

254
Cargo.lock generated
View File

@ -361,10 +361,11 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "aws-config"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b309b2154d224728d845a958c580834f24213037ed61b195da80c0b0fc7469fa"
checksum = "1854be4730cc87602316707045a5c0585287419d54f293bbb52a82c895d9086a"
dependencies = [
"aws-credential-types",
"aws-http",
"aws-sdk-sso",
"aws-sdk-sts",
@ -376,6 +377,7 @@ dependencies = [
"aws-smithy-types",
"aws-types",
"bytes",
"fastrand",
"hex",
"http",
"hyper",
@ -388,10 +390,24 @@ dependencies = [
]
[[package]]
name = "aws-endpoint"
version = "0.49.0"
name = "aws-credential-types"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76f35c8f5877ad60db4f0d9dcdfbcb2233a8cc539f9e568df39ee0581ec62e89"
checksum = "77e37e62f59cf3284067337da7467d842df8cfe3f5e5c06487ac7521819cf16d"
dependencies = [
"aws-smithy-async",
"aws-smithy-types",
"fastrand",
"tokio",
"tracing",
"zeroize",
]
[[package]]
name = "aws-endpoint"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f38276d5875b19a9bb2b4ae049fd776c932fcc62068f78b71ce475093ccb4c8"
dependencies = [
"aws-smithy-http",
"aws-smithy-types",
@ -403,10 +419,11 @@ dependencies = [
[[package]]
name = "aws-http"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f5422c9632d887968ccb66e2871a6d190d6104e276034912bee72ef58a5d890"
checksum = "67224bfece71e21a63ae82b1ebbfda05be28678a0fab06def03229c7a445d3fb"
dependencies = [
"aws-credential-types",
"aws-smithy-http",
"aws-smithy-types",
"aws-types",
@ -421,10 +438,11 @@ dependencies = [
[[package]]
name = "aws-sdk-sns"
version = "0.19.0"
version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfdba3a74bd5b4d0bc4708f6670d05ed1fd8d1e7c96e099dc783a52f7edfa273"
checksum = "91c4ef356fc0978551baece1fc808b10e2c6ce1fe98394d241329a404ef16f0a"
dependencies = [
"aws-credential-types",
"aws-endpoint",
"aws-http",
"aws-sig-auth",
@ -432,22 +450,26 @@ dependencies = [
"aws-smithy-client",
"aws-smithy-http",
"aws-smithy-http-tower",
"aws-smithy-json",
"aws-smithy-query",
"aws-smithy-types",
"aws-smithy-xml",
"aws-types",
"bytes",
"http",
"regex",
"tokio-stream",
"tower",
"tracing",
]
[[package]]
name = "aws-sdk-sso"
version = "0.19.0"
version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2cc8b50281e1350d0b5c7207c2ce53c6721186ad196472caff4f20fa4b42e96"
checksum = "aad0ad03c4ba802906340847aaea796d4158317864276864acbb281155bdcf4d"
dependencies = [
"aws-credential-types",
"aws-endpoint",
"aws-http",
"aws-sig-auth",
@ -460,16 +482,19 @@ dependencies = [
"aws-types",
"bytes",
"http",
"regex",
"tokio-stream",
"tower",
"tracing",
]
[[package]]
name = "aws-sdk-sts"
version = "0.19.0"
version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6179f13c9fbab3226860f377354dece860e34ff129b69c7c1b0fa828d1e9c76"
checksum = "2493efc64aa1c6469a252c221c335ccdcebfcc556c81b1efaee051c6ddc3dd99"
dependencies = [
"aws-credential-types",
"aws-endpoint",
"aws-http",
"aws-sig-auth",
@ -477,21 +502,25 @@ dependencies = [
"aws-smithy-client",
"aws-smithy-http",
"aws-smithy-http-tower",
"aws-smithy-json",
"aws-smithy-query",
"aws-smithy-types",
"aws-smithy-xml",
"aws-types",
"bytes",
"http",
"regex",
"tower",
"tracing",
]
[[package]]
name = "aws-sig-auth"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b16f4d70c9c865af392eb40cacfe2bec3fa18f651fbdf49919cfc1dda13b189e"
checksum = "cebfa0f118afd7197185d5e097bfcdfca9f8410dca50435d67784405f1fd5a05"
dependencies = [
"aws-credential-types",
"aws-sigv4",
"aws-smithy-http",
"aws-types",
@ -501,27 +530,28 @@ dependencies = [
[[package]]
name = "aws-sigv4"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d33790cecae42b999d197074c8a19e9b96b9e346284a6f93989e7489c9fa0f5"
checksum = "19a4f5c05c8646d12b7bb3f18c04edc5ac5e8928ab80e1649e568190f2bc7b79"
dependencies = [
"aws-smithy-http",
"form_urlencoded",
"hex",
"hmac",
"http",
"once_cell",
"percent-encoding",
"regex",
"ring",
"sha2",
"time 0.3.20",
"tracing",
]
[[package]]
name = "aws-smithy-async"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc604f278bae64bbd15854baa9c46ed69a56dfb0669d04aab80974749f2d6599"
checksum = "8cd4b9b7d99263f75304fc1fcd752361cbc4cbf068b832acd8daeaaff44267eb"
dependencies = [
"futures-util",
"pin-project-lite",
@ -531,9 +561,9 @@ dependencies = [
[[package]]
name = "aws-smithy-client"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec39585f8274fa543ad5c63cc09cbd435666be16b2cf99e4e07be5cf798bc050"
checksum = "748298b60bbd0594223ea136ceed2ed4b6d50970bcefa69a5ff6d710ce593854"
dependencies = [
"aws-smithy-async",
"aws-smithy-http",
@ -544,9 +574,10 @@ dependencies = [
"http",
"http-body",
"hyper",
"hyper-rustls 0.22.1",
"hyper-rustls",
"lazy_static",
"pin-project-lite",
"rustls",
"tokio",
"tower",
"tracing",
@ -554,9 +585,9 @@ dependencies = [
[[package]]
name = "aws-smithy-http"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "014a0ef5c4508fc2f6a9d3925c214725af19f020ea388db48e20196cc4cc9d6d"
checksum = "d78510732b81040689dc146e3693bfbcf388ab88cbda667d3ef67f8869b0744a"
dependencies = [
"aws-smithy-types",
"bytes",
@ -568,6 +599,7 @@ dependencies = [
"once_cell",
"percent-encoding",
"pin-project-lite",
"pin-utils",
"tokio",
"tokio-util",
"tracing",
@ -575,11 +607,12 @@ dependencies = [
[[package]]
name = "aws-smithy-http-tower"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "deecb478dc3cc40203e0e97ac0fb92947e0719754bbafd0026bdc49318e2fd03"
checksum = "dc33689c27bbd8184412b45c4d1ab795d9a35402562d9fde6c53695a90969740"
dependencies = [
"aws-smithy-http",
"aws-smithy-types",
"bytes",
"http",
"http-body",
@ -590,18 +623,18 @@ dependencies = [
[[package]]
name = "aws-smithy-json"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6593456af93c4a39724f7dc9d239833102ab96c1d1e94c35ea79f0e55f9fd54c"
checksum = "ada31cab1b1d1f0abc5c4d1183de5b278597704851aa703801b82feabf19aa74"
dependencies = [
"aws-smithy-types",
]
[[package]]
name = "aws-smithy-query"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b803460b71645dfa9f6be47c4f00f91632f01e5bb01f9dc43890cd6cba983f08"
checksum = "b55358401b657d192f70f093927f01d73cc4859e2907956b20c4043c76624006"
dependencies = [
"aws-smithy-types",
"urlencoding",
@ -609,10 +642,11 @@ dependencies = [
[[package]]
name = "aws-smithy-types"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e93b0c93a3b963da946a0b8ef3853a7252298eb75cdbfb21dad60f5ed0ded861"
checksum = "474d145c2e0f82892841d2502bd546ca0dbc1e4e242c3563d96e7061054c268f"
dependencies = [
"base64-simd",
"itoa",
"num-integer",
"ryu",
@ -621,19 +655,20 @@ dependencies = [
[[package]]
name = "aws-smithy-xml"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36b9efb4855b4acb29961a776d45680f3cbdd7c4783cbbae078da54c342575dd"
checksum = "bb159921734d090b01c586a4fef73964f42fcb7eb53a8184b2db374bd6a6fc99"
dependencies = [
"xmlparser",
]
[[package]]
name = "aws-types"
version = "0.49.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93f3f349b39781849261db1c727369923bb97007cf7bd0deb3a6e9e461c8d38f"
checksum = "81fb02591b5075d318e0083dcb76df0e151db4ce48f987ecd00e5b53c7a6ba59"
dependencies = [
"aws-credential-types",
"aws-smithy-async",
"aws-smithy-client",
"aws-smithy-http",
@ -641,7 +676,6 @@ dependencies = [
"http",
"rustc_version",
"tracing",
"zeroize",
]
[[package]]
@ -725,6 +759,16 @@ version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
[[package]]
name = "base64-simd"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195"
dependencies = [
"outref",
"vsimd",
]
[[package]]
name = "base64ct"
version = "1.6.0"
@ -903,6 +947,7 @@ dependencies = [
"async-recursion",
"async-trait",
"aws-config",
"aws-credential-types",
"aws-sdk-sns",
"aws-types",
"backend",
@ -1229,15 +1274,6 @@ dependencies = [
"typenum",
]
[[package]]
name = "ct-logs"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8"
dependencies = [
"sct 0.6.1",
]
[[package]]
name = "ctor"
version = "0.1.26"
@ -1720,9 +1756,9 @@ dependencies = [
"base64 0.21.0",
"dirs-next",
"hyper",
"hyper-rustls 0.23.2",
"hyper-rustls",
"ring",
"rustls 0.20.8",
"rustls",
"rustls-pemfile",
"serde",
"serde_json",
@ -2014,23 +2050,6 @@ dependencies = [
"want",
]
[[package]]
name = "hyper-rustls"
version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64"
dependencies = [
"ct-logs",
"futures-util",
"hyper",
"log",
"rustls 0.19.1",
"rustls-native-certs 0.5.0",
"tokio",
"tokio-rustls 0.22.0",
"webpki 0.21.4",
]
[[package]]
name = "hyper-rustls"
version = "0.23.2"
@ -2039,10 +2058,11 @@ checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c"
dependencies = [
"http",
"hyper",
"rustls 0.20.8",
"rustls-native-certs 0.6.2",
"log",
"rustls",
"rustls-native-certs",
"tokio",
"tokio-rustls 0.23.4",
"tokio-rustls",
]
[[package]]
@ -2694,6 +2714,12 @@ version = "6.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267"
[[package]]
name = "outref"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a"
[[package]]
name = "overload"
version = "0.1.1"
@ -3325,7 +3351,7 @@ dependencies = [
"http",
"http-body",
"hyper",
"hyper-rustls 0.23.2",
"hyper-rustls",
"ipnet",
"js-sys",
"log",
@ -3333,13 +3359,13 @@ dependencies = [
"once_cell",
"percent-encoding",
"pin-project-lite",
"rustls 0.20.8",
"rustls",
"rustls-pemfile",
"serde",
"serde_json",
"serde_urlencoded",
"tokio",
"tokio-rustls 0.23.4",
"tokio-rustls",
"tower-service",
"url",
"wasm-bindgen",
@ -3457,19 +3483,6 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "rustls"
version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7"
dependencies = [
"base64 0.13.1",
"log",
"ring",
"sct 0.6.1",
"webpki 0.21.4",
]
[[package]]
name = "rustls"
version = "0.20.8"
@ -3478,8 +3491,8 @@ checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f"
dependencies = [
"log",
"ring",
"sct 0.7.0",
"webpki 0.22.0",
"sct",
"webpki",
]
[[package]]
@ -3489,21 +3502,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c6a18f8d10f71bce9bca6eaeb80429460e652f3bcf0381f0c5f8954abf7b3b8"
dependencies = [
"log",
"rustls 0.20.8",
"rustls-native-certs 0.6.2",
"webpki 0.22.0",
]
[[package]]
name = "rustls-native-certs"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092"
dependencies = [
"openssl-probe",
"rustls 0.19.1",
"schannel",
"security-framework",
"rustls",
"rustls-native-certs",
"webpki",
]
[[package]]
@ -3584,16 +3585,6 @@ version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1"
[[package]]
name = "sct"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce"
dependencies = [
"ring",
"untrusted",
]
[[package]]
name = "sct"
version = "0.7.0"
@ -4155,26 +4146,15 @@ dependencies = [
"tokio-stream",
]
[[package]]
name = "tokio-rustls"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6"
dependencies = [
"rustls 0.19.1",
"tokio",
"webpki 0.21.4",
]
[[package]]
name = "tokio-rustls"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
dependencies = [
"rustls 0.20.8",
"rustls",
"tokio",
"webpki 0.22.0",
"webpki",
]
[[package]]
@ -4590,6 +4570,12 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "vsimd"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64"
[[package]]
name = "waker-fn"
version = "1.1.0"
@ -4639,7 +4625,7 @@ dependencies = [
"serde_json",
"serde_urlencoded",
"tokio",
"tokio-rustls 0.23.4",
"tokio-rustls",
"tokio-stream",
"tokio-util",
"tower-service",
@ -4734,16 +4720,6 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "webpki"
version = "0.21.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea"
dependencies = [
"ring",
"untrusted",
]
[[package]]
name = "webpki"
version = "0.22.0"
@ -4760,7 +4736,7 @@ version = "0.22.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87"
dependencies = [
"webpki 0.22.0",
"webpki",
]
[[package]]
@ -4981,9 +4957,9 @@ dependencies = [
[[package]]
name = "xmlparser"
version = "0.13.3"
version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "114ba2b24d2167ef6d67d7d04c8cc86522b87f490025f39f0303b7db5bf5e3d8"
checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd"
[[package]]
name = "yasna"

View File

@ -43,9 +43,10 @@ backend = { path = "../backend" }
reqwest = { version = "0.11", features = ["json", "rustls-tls"], default-features = false }
# Integrations
aws-types = "0.49"
aws-config = { version = "0.49", default-features = false }
aws-sdk-sns = "0.19"
aws-types = "0.55"
aws-credential-types = "0.55"
aws-config = { version = "0.55", default-features = false }
aws-sdk-sns = "0.25"
hmac = "0.12"
sha2 = "0.10"
urlencoding = "2.1"

View File

@ -2,11 +2,10 @@ use std::collections::HashMap;
use anyhow::Result;
use async_trait::async_trait;
use aws_sdk_sns::model::MessageAttributeValue;
use aws_types::credentials::future;
use aws_types::credentials::ProvideCredentials;
use aws_credential_types::provider::{future, ProvideCredentials, Result as CredentialsResult};
use aws_credential_types::Credentials;
use aws_sdk_sns::types::MessageAttributeValue;
use aws_types::region::Region;
use aws_types::{credentials, Credentials};
use base64::{engine::general_purpose, Engine as _};
use prost::Message;
use tracing::{info, trace};
@ -30,7 +29,7 @@ impl StaticCredentials {
}
}
fn credentials(&self) -> credentials::Result {
fn credentials(&self) -> CredentialsResult {
Ok(Credentials::new(
self.aws_access_key_id.clone(),
self.aws_secret_access_key.clone(),