|
4 | 4 | #if NIX_WITH_S3_SUPPORT |
5 | 5 |
|
6 | 6 | # include "nix/util/ref.hh" |
7 | | -# include "nix/util/url.hh" |
8 | | -# include "nix/util/util.hh" |
| 7 | +# include "nix/store/s3-url.hh" |
9 | 8 |
|
10 | | -# include <optional> |
11 | 9 | # include <string> |
12 | | -# include <variant> |
13 | 10 |
|
14 | 11 | namespace Aws { |
15 | 12 | namespace Client { |
@@ -48,47 +45,6 @@ struct S3Helper |
48 | 45 | FileTransferResult getObject(const std::string & bucketName, const std::string & key); |
49 | 46 | }; |
50 | 47 |
|
51 | | -/** |
52 | | - * Parsed S3 URL. |
53 | | - */ |
54 | | -struct ParsedS3URL |
55 | | -{ |
56 | | - std::string bucket; |
57 | | - /** |
58 | | - * @see ParsedURL::path. This is a vector for the same reason. |
59 | | - * Unlike ParsedURL::path this doesn't include the leading empty segment, |
60 | | - * since the bucket name is necessary. |
61 | | - */ |
62 | | - std::vector<std::string> key; |
63 | | - std::optional<std::string> profile; |
64 | | - std::optional<std::string> region; |
65 | | - std::optional<std::string> scheme; |
66 | | - /** |
67 | | - * The endpoint can be either missing, be an absolute URI (with a scheme like `http:`) |
68 | | - * or an authority (so an IP address or a registered name). |
69 | | - */ |
70 | | - std::variant<std::monostate, ParsedURL, ParsedURL::Authority> endpoint; |
71 | | - |
72 | | - std::optional<std::string> getEncodedEndpoint() const |
73 | | - { |
74 | | - return std::visit( |
75 | | - overloaded{ |
76 | | - [](std::monostate) -> std::optional<std::string> { return std::nullopt; }, |
77 | | - [](const auto & authorityOrUrl) -> std::optional<std::string> { return authorityOrUrl.to_string(); }, |
78 | | - }, |
79 | | - endpoint); |
80 | | - } |
81 | | - |
82 | | - static ParsedS3URL parse(const ParsedURL & uri); |
83 | | - |
84 | | - /** |
85 | | - * Convert this ParsedS3URL to HTTPS ParsedURL for use with curl's AWS SigV4 authentication |
86 | | - */ |
87 | | - ParsedURL toHttpsUrl() const; |
88 | | - |
89 | | - auto operator<=>(const ParsedS3URL & other) const = default; |
90 | | -}; |
91 | | - |
92 | 48 | } // namespace nix |
93 | 49 |
|
94 | 50 | #endif |
0 commit comments