diff --git a/services/identity/Cargo.lock b/services/identity/Cargo.lock --- a/services/identity/Cargo.lock +++ b/services/identity/Cargo.lock @@ -161,9 +161,9 @@ [[package]] name = "aws-config" -version = "0.54.1" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3d1e2a1f1ab3ac6c4b884e37413eaa03eb9d901e4fc68ee8f5c1d49721680e" +checksum = "bcdcf0d683fe9c23d32cf5b53c9918ea0a500375a9fb20109802552658e576c9" dependencies = [ "aws-credential-types", "aws-http", @@ -177,6 +177,7 @@ "aws-smithy-types", "aws-types", "bytes", + "fastrand", "hex", "http", "hyper", @@ -190,12 +191,13 @@ [[package]] name = "aws-credential-types" -version = "0.54.1" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0696a0523a39a19087747e4dafda0362dc867531e3d72a3f195564c84e5e08" +checksum = "1fcdb2f7acbc076ff5ad05e7864bdb191ca70a6fd07668dc3a1a8bcd051de5ae" dependencies = [ "aws-smithy-async", "aws-smithy-types", + "fastrand", "tokio", "tracing", "zeroize", @@ -203,9 +205,9 @@ [[package]] name = "aws-endpoint" -version = "0.54.1" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80a4f935ab6a1919fbfd6102a80c4fccd9ff5f47f94ba154074afe1051903261" +checksum = "8cce1c41a6cfaa726adee9ebb9a56fcd2bbfd8be49fd8a04c5e20fd968330b04" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -217,9 +219,9 @@ [[package]] name = "aws-http" -version = "0.54.1" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82976ca4e426ee9ca3ffcf919d9b2c8d14d0cd80d43cc02173737a8f07f28d4d" +checksum = "aadbc44e7a8f3e71c8b374e03ecd972869eb91dd2bc89ed018954a52ba84bc44" dependencies = [ "aws-credential-types", "aws-smithy-http", @@ -236,9 +238,9 @@ [[package]] name = "aws-sdk-dynamodb" -version = "0.24.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34fc8efd8ed65312b05dc84bb0d7ba79c31802873c4b5676403e220724af39b7" +checksum = "67fb64867fe098cffee7e34352b01bbfa2beb3aa1b2ff0e0a7bf9ff293557852" dependencies = [ "aws-credential-types", "aws-endpoint", @@ -262,9 +264,9 @@ [[package]] name = "aws-sdk-sso" -version = "0.24.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0119bacf0c42f587506769390983223ba834e605f049babe514b2bd646dbb2" +checksum = "c8b812340d86d4a766b2ca73f740dfd47a97c2dff0c06c8517a16d88241957e4" dependencies = [ "aws-credential-types", "aws-endpoint", @@ -282,13 +284,14 @@ "regex", "tokio-stream", "tower", + "tracing", ] [[package]] name = "aws-sdk-sts" -version = "0.24.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "270b6a33969ebfcb193512fbd5e8ee5306888ad6c6d5d775cdbfb2d50d94de26" +checksum = "265fac131fbfc188e5c3d96652ea90ecc676a934e3174eaaee523c6cec040b3b" dependencies = [ "aws-credential-types", "aws-endpoint", @@ -312,9 +315,9 @@ [[package]] name = "aws-sig-auth" -version = "0.54.1" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "660a02a98ab1af83bd8d714afbab2d502ba9b18c49e7e4cddd6bf8837ff778cb" +checksum = "3b94acb10af0c879ecd5c7bdf51cda6679a0a4f4643ce630905a77673bfa3c61" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -326,9 +329,9 @@ [[package]] name = "aws-sigv4" -version = "0.54.2" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86529e7b64d902efea8fff52c1b2529368d04f90305cf632729e3713f6b57dc0" +checksum = "9d2ce6f507be68e968a33485ced670111d1cbad161ddbbab1e313c03d37d8f4c" dependencies = [ "aws-smithy-http", "form_urlencoded", @@ -345,9 +348,9 @@ [[package]] name = "aws-smithy-async" -version = "0.54.4" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63c712a28a4f2f2139759235c08bf98aca99d4fdf1b13c78c5f95613df0a5db9" +checksum = "13bda3996044c202d75b91afeb11a9afae9db9a721c6a7a427410018e286b880" dependencies = [ "futures-util", "pin-project-lite", @@ -357,9 +360,9 @@ [[package]] name = "aws-smithy-client" -version = "0.54.4" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104ca17f56cde00a10207169697dfe9c6810db339d52fb352707e64875b30a44" +checksum = "0a86aa6e21e86c4252ad6a0e3e74da9617295d8d6e374d552be7d3059c41cedd" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -373,6 +376,7 @@ "hyper-rustls", "lazy_static", "pin-project-lite", + "rustls 0.20.8", "tokio", "tower", "tracing", @@ -380,9 +384,9 @@ [[package]] name = "aws-smithy-http" -version = "0.54.4" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "873f316f1833add0d3aa54ed1b0cd252ddd88c792a0cf839886400099971e844" +checksum = "2b3b693869133551f135e1f2c77cb0b8277d9e3e17feaf2213f735857c4f0d28" dependencies = [ "aws-smithy-types", "bytes", @@ -402,9 +406,9 @@ [[package]] name = "aws-smithy-http-tower" -version = "0.54.4" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38231d3f5dac9ac7976f44e12803add1385119ffca9e5f050d8e980733d164" +checksum = "3ae4f6c5798a247fac98a867698197d9ac22643596dc3777f0c76b91917616b9" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -418,18 +422,18 @@ [[package]] name = "aws-smithy-json" -version = "0.54.4" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd83ff2b79e9f729746fcc8ad798676b68fe6ea72986571569a5306a277a182" +checksum = "23f9f42fbfa96d095194a632fbac19f60077748eba536eb0b9fecc28659807f8" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-query" -version = "0.54.4" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2f0445dafe9d2cd50b44339ae3c3ed46549aad8ac696c52ad660b3e7ae8682b" +checksum = "98819eb0b04020a1c791903533b638534ae6c12e2aceda3e6e6fba015608d51d" dependencies = [ "aws-smithy-types", "urlencoding", @@ -437,9 +441,9 @@ [[package]] name = "aws-smithy-types" -version = "0.54.4" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8161232eda10290f5136610a1eb9de56aceaccd70c963a26a260af20ac24794f" +checksum = "16a3d0bf4f324f4ef9793b86a1701d9700fbcdbd12a846da45eed104c634c6e8" dependencies = [ "base64-simd", "itoa", @@ -450,18 +454,18 @@ [[package]] name = "aws-smithy-xml" -version = "0.54.4" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343ffe9a9bb3f542675f4df0e0d5933513d6ad038ca3907ad1767ba690a99684" +checksum = "b1b9d12875731bd07e767be7baad95700c3137b56730ec9ddeedb52a5e5ca63b" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "0.54.1" +version = "0.55.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f15b34253b68cde08e39b0627cc6101bcca64351229484b4743392c035d057" +checksum = "6dd209616cc8d7bfb82f87811a5c655dc97537f592689b18743bddf5dc5c4829" dependencies = [ "aws-credential-types", "aws-smithy-async", diff --git a/services/identity/Cargo.toml b/services/identity/Cargo.toml --- a/services/identity/Cargo.toml +++ b/services/identity/Cargo.toml @@ -11,8 +11,8 @@ ed25519-dalek = "1" clap = { version = "4.4", features = ["derive", "env"] } derive_more = "0.99" -aws-config = "0.54.0" -aws-sdk-dynamodb = "0.24.0" +aws-config = "0.55.0" +aws-sdk-dynamodb = "0.27.0" tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } chrono = "0.4.31" diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs --- a/services/identity/src/database.rs +++ b/services/identity/src/database.rs @@ -1,3 +1,12 @@ +use aws_sdk_dynamodb::operation::delete_item::DeleteItemOutput; +use aws_sdk_dynamodb::operation::get_item::GetItemOutput; +use aws_sdk_dynamodb::operation::put_item::PutItemOutput; +use aws_sdk_dynamodb::operation::query::QueryOutput; +use aws_sdk_dynamodb::primitives::Blob; +use aws_sdk_dynamodb::types::{ + AttributeValue, PutRequest, ReturnConsumedCapacity, WriteRequest, +}; +use aws_sdk_dynamodb::Client; use constant_time_eq::constant_time_eq; use std::collections::{HashMap, HashSet}; use std::str::FromStr; @@ -8,11 +17,6 @@ }; use crate::error::{consume_error, DBItemAttributeError, DBItemError, Error}; use aws_config::SdkConfig; -use aws_sdk_dynamodb::model::{AttributeValue, PutRequest, WriteRequest}; -use aws_sdk_dynamodb::output::{ - DeleteItemOutput, GetItemOutput, PutItemOutput, QueryOutput, -}; -use aws_sdk_dynamodb::{types::Blob, Client}; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use tracing::{debug, error, info, warn}; @@ -611,9 +615,7 @@ .table_name(NAME) .key_condition_expression(format!("{} = :pk", PARTITION_KEY)) .expression_attribute_values(":pk", AttributeValue::S(partition_key)) - .return_consumed_capacity( - aws_sdk_dynamodb::model::ReturnConsumedCapacity::Total, - ) + .return_consumed_capacity(ReturnConsumedCapacity::Total) .send() .await .map_err(|e| Error::AwsSdk(e.into())) diff --git a/services/identity/src/database/device_list.rs b/services/identity/src/database/device_list.rs --- a/services/identity/src/database/device_list.rs +++ b/services/identity/src/database/device_list.rs @@ -1,16 +1,11 @@ -// TODO: get rid of this -#![allow(dead_code)] - use std::collections::HashMap; use aws_sdk_dynamodb::{ - client::fluent_builders::Query, - error::TransactionCanceledException, - model::{ - AttributeValue, Delete, DeleteRequest, Put, TransactWriteItem, Update, - WriteRequest, + operation::{get_item::GetItemOutput, query::builders::QueryFluentBuilder}, + types::{ + error::TransactionCanceledException, AttributeValue, Delete, DeleteRequest, + Put, TransactWriteItem, Update, WriteRequest, }, - output::GetItemOutput, }; use chrono::{DateTime, Utc}; use tracing::{error, warn}; @@ -1022,7 +1017,7 @@ db: &crate::database::DatabaseClient, user_id: impl Into, prefix: &'static str, -) -> Query { +) -> QueryFluentBuilder { db.client .query() .table_name(devices_table::NAME) diff --git a/services/identity/src/ddb_utils.rs b/services/identity/src/ddb_utils.rs --- a/services/identity/src/ddb_utils.rs +++ b/services/identity/src/ddb_utils.rs @@ -1,4 +1,4 @@ -use aws_sdk_dynamodb::model::{AttributeValue, PutRequest, WriteRequest}; +use aws_sdk_dynamodb::types::{AttributeValue, PutRequest, WriteRequest}; use chrono::{DateTime, NaiveDateTime, Utc}; use std::collections::HashMap; use std::iter::IntoIterator; diff --git a/services/identity/src/error.rs b/services/identity/src/error.rs --- a/services/identity/src/error.rs +++ b/services/identity/src/error.rs @@ -1,4 +1,5 @@ -use aws_sdk_dynamodb::{model::AttributeValue, Error as DynamoDBError}; +use aws_sdk_dynamodb::types::AttributeValue; +use aws_sdk_dynamodb::Error as DynamoDBError; use std::collections::hash_map::HashMap; use std::fmt::{Display, Formatter, Result as FmtResult}; use tracing::error;