This commit is contained in:
Scott E. Graves 2024-12-19 11:13:15 -06:00
parent 146d301002
commit c46334b046

View File

@ -242,7 +242,7 @@ auto s3_provider::create_path_directories(const std::string &api_path,
auto s3_provider::decrypt_object_name(std::string &object_name) const auto s3_provider::decrypt_object_name(std::string &object_name) const
-> api_error { -> api_error {
auto parts = utils::string::split(object_name, '/', false); auto parts = utils::string::split(object_name, '/', false);
for (auto &&part : parts) { for (const auto &part : parts) {
if (not utils::encryption::decrypt_file_name( if (not utils::encryption::decrypt_file_name(
get_s3_config().encryption_token, part)) { get_s3_config().encryption_token, part)) {
return api_error::decryption_error; return api_error::decryption_error;
@ -440,14 +440,14 @@ auto s3_provider::get_directory_items_impl(const std::string &api_path,
auto node_list = auto node_list =
doc.select_nodes("/ListBucketResult/CommonPrefixes/Prefix"); doc.select_nodes("/ListBucketResult/CommonPrefixes/Prefix");
for (auto &&node : node_list) { for (const auto &node : node_list) {
add_directory_item( add_directory_item(
true, node.node().text().as_string(), 0U, true, node.node().text().as_string(), 0U,
[](const directory_item &) -> std::uint64_t { return 0U; }); [](const directory_item &) -> std::uint64_t { return 0U; });
} }
node_list = doc.select_nodes("/ListBucketResult/Contents"); node_list = doc.select_nodes("/ListBucketResult/Contents");
for (auto &&node : node_list) { for (const auto &node : node_list) {
auto child_object_name = utils::path::create_api_path( auto child_object_name = utils::path::create_api_path(
node.node().select_node("Key").node().text().as_string()); node.node().select_node("Key").node().text().as_string());
if (child_object_name == utils::path::create_api_path(prefix)) { if (child_object_name == utils::path::create_api_path(prefix)) {
@ -552,7 +552,7 @@ auto s3_provider::get_file_list(api_file_list &list, std::string &marker) const
} }
auto node_list = doc.select_nodes("/ListBucketResult/Contents"); auto node_list = doc.select_nodes("/ListBucketResult/Contents");
for (auto &&node : node_list) { for (const auto &node : node_list) {
auto object_name = auto object_name =
std::string{node.node().select_node("Key").node().text().as_string()}; std::string{node.node().select_node("Key").node().text().as_string()};
auto api_path{object_name}; auto api_path{object_name};