aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock20
-rw-r--r--Cargo.nix138
-rw-r--r--Cargo.toml18
-rw-r--r--doc/book/cookbook/real-world.md10
-rw-r--r--script/helm/garage/Chart.yaml2
-rw-r--r--src/api/Cargo.toml2
-rw-r--r--src/api/signature/payload.rs57
-rw-r--r--src/block/Cargo.toml2
-rw-r--r--src/db/Cargo.toml2
-rw-r--r--src/garage/Cargo.toml2
-rw-r--r--src/garage/tests/common/custom_requester.rs4
-rw-r--r--src/garage/tests/s3/mod.rs1
-rw-r--r--src/garage/tests/s3/presigned.rs72
-rw-r--r--src/model/Cargo.toml2
-rw-r--r--src/net/Cargo.toml2
-rw-r--r--src/rpc/Cargo.toml2
-rw-r--r--src/table/Cargo.toml2
-rw-r--r--src/util/Cargo.toml2
-rw-r--r--src/web/Cargo.toml2
19 files changed, 216 insertions, 126 deletions
diff --git a/Cargo.lock b/Cargo.lock
index b2956559..f9bf0c0a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1277,7 +1277,7 @@ dependencies = [
[[package]]
name = "garage"
-version = "0.9.2"
+version = "0.9.3"
dependencies = [
"assert-json-diff",
"async-trait",
@@ -1331,7 +1331,7 @@ dependencies = [
[[package]]
name = "garage_api"
-version = "0.9.2"
+version = "0.9.3"
dependencies = [
"argon2",
"async-trait",
@@ -1380,7 +1380,7 @@ dependencies = [
[[package]]
name = "garage_block"
-version = "0.9.2"
+version = "0.9.3"
dependencies = [
"arc-swap",
"async-compression",
@@ -1407,7 +1407,7 @@ dependencies = [
[[package]]
name = "garage_db"
-version = "0.9.2"
+version = "0.9.3"
dependencies = [
"err-derive",
"heed",
@@ -1420,7 +1420,7 @@ dependencies = [
[[package]]
name = "garage_model"
-version = "0.9.2"
+version = "0.9.3"
dependencies = [
"arc-swap",
"async-trait",
@@ -1448,7 +1448,7 @@ dependencies = [
[[package]]
name = "garage_net"
-version = "0.9.2"
+version = "0.9.3"
dependencies = [
"arc-swap",
"async-trait",
@@ -1474,7 +1474,7 @@ dependencies = [
[[package]]
name = "garage_rpc"
-version = "0.9.2"
+version = "0.9.3"
dependencies = [
"arc-swap",
"async-trait",
@@ -1509,7 +1509,7 @@ dependencies = [
[[package]]
name = "garage_table"
-version = "0.9.2"
+version = "0.9.3"
dependencies = [
"arc-swap",
"async-trait",
@@ -1531,7 +1531,7 @@ dependencies = [
[[package]]
name = "garage_util"
-version = "0.9.2"
+version = "0.9.3"
dependencies = [
"arc-swap",
"async-trait",
@@ -1565,7 +1565,7 @@ dependencies = [
[[package]]
name = "garage_web"
-version = "0.9.2"
+version = "0.9.3"
dependencies = [
"err-derive",
"futures",
diff --git a/Cargo.nix b/Cargo.nix
index f976d2e6..0a4ca99a 100644
--- a/Cargo.nix
+++ b/Cargo.nix
@@ -34,7 +34,7 @@ args@{
ignoreLockHash,
}:
let
- nixifiedLockHash = "3e1e0730302ee7d1f4185a13ad0086392562eb7cb962b1212801847887beaa47";
+ nixifiedLockHash = "8112e20b0e356bed77a9769600c2b2952662ec8af9548eecf8a2d46fe8433189";
workspaceSrc = if args.workspaceSrc == null then ./. else args.workspaceSrc;
currentLockHash = builtins.hashFile "sha256" (workspaceSrc + /Cargo.lock);
lockHashIgnored = if ignoreLockHash
@@ -58,17 +58,17 @@ in
{
cargo2nixVersion = "0.11.0";
workspace = {
- garage_db = rustPackages.unknown.garage_db."0.9.2";
- garage_util = rustPackages.unknown.garage_util."0.9.2";
- garage_net = rustPackages.unknown.garage_net."0.9.2";
- garage_rpc = rustPackages.unknown.garage_rpc."0.9.2";
+ garage_db = rustPackages.unknown.garage_db."0.9.3";
+ garage_util = rustPackages.unknown.garage_util."0.9.3";
+ garage_net = rustPackages.unknown.garage_net."0.9.3";
+ garage_rpc = rustPackages.unknown.garage_rpc."0.9.3";
format_table = rustPackages.unknown.format_table."0.1.1";
- garage_table = rustPackages.unknown.garage_table."0.9.2";
- garage_block = rustPackages.unknown.garage_block."0.9.2";
- garage_model = rustPackages.unknown.garage_model."0.9.2";
- garage_api = rustPackages.unknown.garage_api."0.9.2";
- garage_web = rustPackages.unknown.garage_web."0.9.2";
- garage = rustPackages.unknown.garage."0.9.2";
+ garage_table = rustPackages.unknown.garage_table."0.9.3";
+ garage_block = rustPackages.unknown.garage_block."0.9.3";
+ garage_model = rustPackages.unknown.garage_model."0.9.3";
+ garage_api = rustPackages.unknown.garage_api."0.9.3";
+ garage_web = rustPackages.unknown.garage_web."0.9.3";
+ garage = rustPackages.unknown.garage."0.9.3";
k2v-client = rustPackages.unknown.k2v-client."0.0.4";
};
"registry+https://github.com/rust-lang/crates.io-index".addr2line."0.21.0" = overridableMkRustCrate (profileName: rec {
@@ -1871,9 +1871,9 @@ in
};
});
- "unknown".garage."0.9.2" = overridableMkRustCrate (profileName: rec {
+ "unknown".garage."0.9.3" = overridableMkRustCrate (profileName: rec {
name = "garage";
- version = "0.9.2";
+ version = "0.9.3";
registry = "unknown";
src = fetchCrateLocal (workspaceSrc + "/src/garage");
features = builtins.concatLists [
@@ -1900,15 +1900,15 @@ in
format_table = (rustPackages."unknown".format_table."0.1.1" { inherit profileName; }).out;
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.30" { inherit profileName; }).out;
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.30" { inherit profileName; }).out;
- garage_api = (rustPackages."unknown".garage_api."0.9.2" { inherit profileName; }).out;
- garage_block = (rustPackages."unknown".garage_block."0.9.2" { inherit profileName; }).out;
- garage_db = (rustPackages."unknown".garage_db."0.9.2" { inherit profileName; }).out;
- garage_model = (rustPackages."unknown".garage_model."0.9.2" { inherit profileName; }).out;
- garage_net = (rustPackages."unknown".garage_net."0.9.2" { inherit profileName; }).out;
- garage_rpc = (rustPackages."unknown".garage_rpc."0.9.2" { inherit profileName; }).out;
- garage_table = (rustPackages."unknown".garage_table."0.9.2" { inherit profileName; }).out;
- garage_util = (rustPackages."unknown".garage_util."0.9.2" { inherit profileName; }).out;
- garage_web = (rustPackages."unknown".garage_web."0.9.2" { inherit profileName; }).out;
+ garage_api = (rustPackages."unknown".garage_api."0.9.3" { inherit profileName; }).out;
+ garage_block = (rustPackages."unknown".garage_block."0.9.3" { inherit profileName; }).out;
+ garage_db = (rustPackages."unknown".garage_db."0.9.3" { inherit profileName; }).out;
+ garage_model = (rustPackages."unknown".garage_model."0.9.3" { inherit profileName; }).out;
+ garage_net = (rustPackages."unknown".garage_net."0.9.3" { inherit profileName; }).out;
+ garage_rpc = (rustPackages."unknown".garage_rpc."0.9.3" { inherit profileName; }).out;
+ garage_table = (rustPackages."unknown".garage_table."0.9.3" { inherit profileName; }).out;
+ garage_util = (rustPackages."unknown".garage_util."0.9.3" { inherit profileName; }).out;
+ garage_web = (rustPackages."unknown".garage_web."0.9.3" { inherit profileName; }).out;
git_version = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".git-version."0.3.9" { inherit profileName; }).out;
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
sodiumoxide = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".kuska-sodiumoxide."0.2.5-0" { inherit profileName; }).out;
@@ -1946,9 +1946,9 @@ in
};
});
- "unknown".garage_api."0.9.2" = overridableMkRustCrate (profileName: rec {
+ "unknown".garage_api."0.9.3" = overridableMkRustCrate (profileName: rec {
name = "garage_api";
- version = "0.9.2";
+ version = "0.9.3";
registry = "unknown";
src = fetchCrateLocal (workspaceSrc + "/src/api");
features = builtins.concatLists [
@@ -1968,12 +1968,12 @@ in
form_urlencoded = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".form_urlencoded."1.2.1" { inherit profileName; }).out;
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.30" { inherit profileName; }).out;
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.30" { inherit profileName; }).out;
- garage_block = (rustPackages."unknown".garage_block."0.9.2" { inherit profileName; }).out;
- garage_model = (rustPackages."unknown".garage_model."0.9.2" { inherit profileName; }).out;
- garage_net = (rustPackages."unknown".garage_net."0.9.2" { inherit profileName; }).out;
- garage_rpc = (rustPackages."unknown".garage_rpc."0.9.2" { inherit profileName; }).out;
- garage_table = (rustPackages."unknown".garage_table."0.9.2" { inherit profileName; }).out;
- garage_util = (rustPackages."unknown".garage_util."0.9.2" { inherit profileName; }).out;
+ garage_block = (rustPackages."unknown".garage_block."0.9.3" { inherit profileName; }).out;
+ garage_model = (rustPackages."unknown".garage_model."0.9.3" { inherit profileName; }).out;
+ garage_net = (rustPackages."unknown".garage_net."0.9.3" { inherit profileName; }).out;
+ garage_rpc = (rustPackages."unknown".garage_rpc."0.9.3" { inherit profileName; }).out;
+ garage_table = (rustPackages."unknown".garage_table."0.9.3" { inherit profileName; }).out;
+ garage_util = (rustPackages."unknown".garage_util."0.9.3" { inherit profileName; }).out;
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
hmac = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hmac."0.12.1" { inherit profileName; }).out;
http = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."1.0.0" { inherit profileName; }).out;
@@ -2004,9 +2004,9 @@ in
};
});
- "unknown".garage_block."0.9.2" = overridableMkRustCrate (profileName: rec {
+ "unknown".garage_block."0.9.3" = overridableMkRustCrate (profileName: rec {
name = "garage_block";
- version = "0.9.2";
+ version = "0.9.3";
registry = "unknown";
src = fetchCrateLocal (workspaceSrc + "/src/block");
features = builtins.concatLists [
@@ -2020,11 +2020,11 @@ in
bytesize = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".bytesize."1.3.0" { inherit profileName; }).out;
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.30" { inherit profileName; }).out;
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.30" { inherit profileName; }).out;
- garage_db = (rustPackages."unknown".garage_db."0.9.2" { inherit profileName; }).out;
- garage_net = (rustPackages."unknown".garage_net."0.9.2" { inherit profileName; }).out;
- garage_rpc = (rustPackages."unknown".garage_rpc."0.9.2" { inherit profileName; }).out;
- garage_table = (rustPackages."unknown".garage_table."0.9.2" { inherit profileName; }).out;
- garage_util = (rustPackages."unknown".garage_util."0.9.2" { inherit profileName; }).out;
+ garage_db = (rustPackages."unknown".garage_db."0.9.3" { inherit profileName; }).out;
+ garage_net = (rustPackages."unknown".garage_net."0.9.3" { inherit profileName; }).out;
+ garage_rpc = (rustPackages."unknown".garage_rpc."0.9.3" { inherit profileName; }).out;
+ garage_table = (rustPackages."unknown".garage_table."0.9.3" { inherit profileName; }).out;
+ garage_util = (rustPackages."unknown".garage_util."0.9.3" { inherit profileName; }).out;
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
opentelemetry = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".opentelemetry."0.17.0" { inherit profileName; }).out;
rand = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".rand."0.8.5" { inherit profileName; }).out;
@@ -2037,9 +2037,9 @@ in
};
});
- "unknown".garage_db."0.9.2" = overridableMkRustCrate (profileName: rec {
+ "unknown".garage_db."0.9.3" = overridableMkRustCrate (profileName: rec {
name = "garage_db";
- version = "0.9.2";
+ version = "0.9.3";
registry = "unknown";
src = fetchCrateLocal (workspaceSrc + "/src/db");
features = builtins.concatLists [
@@ -2064,9 +2064,9 @@ in
};
});
- "unknown".garage_model."0.9.2" = overridableMkRustCrate (profileName: rec {
+ "unknown".garage_model."0.9.3" = overridableMkRustCrate (profileName: rec {
name = "garage_model";
- version = "0.9.2";
+ version = "0.9.3";
registry = "unknown";
src = fetchCrateLocal (workspaceSrc + "/src/model");
features = builtins.concatLists [
@@ -2085,12 +2085,12 @@ in
err_derive = (buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".err-derive."0.3.1" { profileName = "__noProfile"; }).out;
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.30" { inherit profileName; }).out;
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.30" { inherit profileName; }).out;
- garage_block = (rustPackages."unknown".garage_block."0.9.2" { inherit profileName; }).out;
- garage_db = (rustPackages."unknown".garage_db."0.9.2" { inherit profileName; }).out;
- garage_net = (rustPackages."unknown".garage_net."0.9.2" { inherit profileName; }).out;
- garage_rpc = (rustPackages."unknown".garage_rpc."0.9.2" { inherit profileName; }).out;
- garage_table = (rustPackages."unknown".garage_table."0.9.2" { inherit profileName; }).out;
- garage_util = (rustPackages."unknown".garage_util."0.9.2" { inherit profileName; }).out;
+ garage_block = (rustPackages."unknown".garage_block."0.9.3" { inherit profileName; }).out;
+ garage_db = (rustPackages."unknown".garage_db."0.9.3" { inherit profileName; }).out;
+ garage_net = (rustPackages."unknown".garage_net."0.9.3" { inherit profileName; }).out;
+ garage_rpc = (rustPackages."unknown".garage_rpc."0.9.3" { inherit profileName; }).out;
+ garage_table = (rustPackages."unknown".garage_table."0.9.3" { inherit profileName; }).out;
+ garage_util = (rustPackages."unknown".garage_util."0.9.3" { inherit profileName; }).out;
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
opentelemetry = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".opentelemetry."0.17.0" { inherit profileName; }).out;
rand = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".rand."0.8.5" { inherit profileName; }).out;
@@ -2102,9 +2102,9 @@ in
};
});
- "unknown".garage_net."0.9.2" = overridableMkRustCrate (profileName: rec {
+ "unknown".garage_net."0.9.3" = overridableMkRustCrate (profileName: rec {
name = "garage_net";
- version = "0.9.2";
+ version = "0.9.3";
registry = "unknown";
src = fetchCrateLocal (workspaceSrc + "/src/net");
features = builtins.concatLists [
@@ -2139,9 +2139,9 @@ in
};
});
- "unknown".garage_rpc."0.9.2" = overridableMkRustCrate (profileName: rec {
+ "unknown".garage_rpc."0.9.3" = overridableMkRustCrate (profileName: rec {
name = "garage_rpc";
- version = "0.9.2";
+ version = "0.9.3";
registry = "unknown";
src = fetchCrateLocal (workspaceSrc + "/src/rpc");
features = builtins.concatLists [
@@ -2163,9 +2163,9 @@ in
format_table = (rustPackages."unknown".format_table."0.1.1" { inherit profileName; }).out;
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.30" { inherit profileName; }).out;
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.30" { inherit profileName; }).out;
- garage_db = (rustPackages."unknown".garage_db."0.9.2" { inherit profileName; }).out;
- garage_net = (rustPackages."unknown".garage_net."0.9.2" { inherit profileName; }).out;
- garage_util = (rustPackages."unknown".garage_util."0.9.2" { inherit profileName; }).out;
+ garage_db = (rustPackages."unknown".garage_db."0.9.3" { inherit profileName; }).out;
+ garage_net = (rustPackages."unknown".garage_net."0.9.3" { inherit profileName; }).out;
+ garage_util = (rustPackages."unknown".garage_util."0.9.3" { inherit profileName; }).out;
gethostname = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".gethostname."0.4.3" { inherit profileName; }).out;
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
itertools = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".itertools."0.12.1" { inherit profileName; }).out;
@@ -2187,9 +2187,9 @@ in
};
});
- "unknown".garage_table."0.9.2" = overridableMkRustCrate (profileName: rec {
+ "unknown".garage_table."0.9.3" = overridableMkRustCrate (profileName: rec {
name = "garage_table";
- version = "0.9.2";
+ version = "0.9.3";
registry = "unknown";
src = fetchCrateLocal (workspaceSrc + "/src/table");
dependencies = {
@@ -2198,9 +2198,9 @@ in
bytes = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".bytes."1.5.0" { inherit profileName; }).out;
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.30" { inherit profileName; }).out;
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.30" { inherit profileName; }).out;
- garage_db = (rustPackages."unknown".garage_db."0.9.2" { inherit profileName; }).out;
- garage_rpc = (rustPackages."unknown".garage_rpc."0.9.2" { inherit profileName; }).out;
- garage_util = (rustPackages."unknown".garage_util."0.9.2" { inherit profileName; }).out;
+ garage_db = (rustPackages."unknown".garage_db."0.9.3" { inherit profileName; }).out;
+ garage_rpc = (rustPackages."unknown".garage_rpc."0.9.3" { inherit profileName; }).out;
+ garage_util = (rustPackages."unknown".garage_util."0.9.3" { inherit profileName; }).out;
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
hexdump = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hexdump."0.1.1" { inherit profileName; }).out;
opentelemetry = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".opentelemetry."0.17.0" { inherit profileName; }).out;
@@ -2212,9 +2212,9 @@ in
};
});
- "unknown".garage_util."0.9.2" = overridableMkRustCrate (profileName: rec {
+ "unknown".garage_util."0.9.3" = overridableMkRustCrate (profileName: rec {
name = "garage_util";
- version = "0.9.2";
+ version = "0.9.3";
registry = "unknown";
src = fetchCrateLocal (workspaceSrc + "/src/util");
features = builtins.concatLists [
@@ -2230,8 +2230,8 @@ in
digest = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".digest."0.10.7" { inherit profileName; }).out;
err_derive = (buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".err-derive."0.3.1" { profileName = "__noProfile"; }).out;
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.30" { inherit profileName; }).out;
- garage_db = (rustPackages."unknown".garage_db."0.9.2" { inherit profileName; }).out;
- garage_net = (rustPackages."unknown".garage_net."0.9.2" { inherit profileName; }).out;
+ garage_db = (rustPackages."unknown".garage_db."0.9.3" { inherit profileName; }).out;
+ garage_net = (rustPackages."unknown".garage_net."0.9.3" { inherit profileName; }).out;
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
hexdump = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hexdump."0.1.1" { inherit profileName; }).out;
http = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."1.0.0" { inherit profileName; }).out;
@@ -2256,18 +2256,18 @@ in
};
});
- "unknown".garage_web."0.9.2" = overridableMkRustCrate (profileName: rec {
+ "unknown".garage_web."0.9.3" = overridableMkRustCrate (profileName: rec {
name = "garage_web";
- version = "0.9.2";
+ version = "0.9.3";
registry = "unknown";
src = fetchCrateLocal (workspaceSrc + "/src/web");
dependencies = {
err_derive = (buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".err-derive."0.3.1" { profileName = "__noProfile"; }).out;
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.30" { inherit profileName; }).out;
- garage_api = (rustPackages."unknown".garage_api."0.9.2" { inherit profileName; }).out;
- garage_model = (rustPackages."unknown".garage_model."0.9.2" { inherit profileName; }).out;
- garage_table = (rustPackages."unknown".garage_table."0.9.2" { inherit profileName; }).out;
- garage_util = (rustPackages."unknown".garage_util."0.9.2" { inherit profileName; }).out;
+ garage_api = (rustPackages."unknown".garage_api."0.9.3" { inherit profileName; }).out;
+ garage_model = (rustPackages."unknown".garage_model."0.9.3" { inherit profileName; }).out;
+ garage_table = (rustPackages."unknown".garage_table."0.9.3" { inherit profileName; }).out;
+ garage_util = (rustPackages."unknown".garage_util."0.9.3" { inherit profileName; }).out;
http = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."1.0.0" { inherit profileName; }).out;
http_body_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".http-body-util."0.1.0" { inherit profileName; }).out;
hyper = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hyper."1.1.0" { inherit profileName; }).out;
diff --git a/Cargo.toml b/Cargo.toml
index 59d1c26b..568f4e51 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,15 +21,15 @@ default-members = ["src/garage"]
# Internal Garage crates
format_table = { version = "0.1.1", path = "src/format-table" }
-garage_api = { version = "0.9.2", path = "src/api" }
-garage_block = { version = "0.9.2", path = "src/block" }
-garage_db = { version = "0.9.2", path = "src/db", default-features = false }
-garage_model = { version = "0.9.2", path = "src/model", default-features = false }
-garage_net = { version = "0.9.2", path = "src/net" }
-garage_rpc = { version = "0.9.2", path = "src/rpc" }
-garage_table = { version = "0.9.2", path = "src/table" }
-garage_util = { version = "0.9.2", path = "src/util" }
-garage_web = { version = "0.9.2", path = "src/web" }
+garage_api = { version = "0.9.3", path = "src/api" }
+garage_block = { version = "0.9.3", path = "src/block" }
+garage_db = { version = "0.9.3", path = "src/db", default-features = false }
+garage_model = { version = "0.9.3", path = "src/model", default-features = false }
+garage_net = { version = "0.9.3", path = "src/net" }
+garage_rpc = { version = "0.9.3", path = "src/rpc" }
+garage_table = { version = "0.9.3", path = "src/table" }
+garage_util = { version = "0.9.3", path = "src/util" }
+garage_web = { version = "0.9.3", path = "src/web" }
k2v-client = { version = "0.0.4", path = "src/k2v-client" }
# External crates from crates.io
diff --git a/doc/book/cookbook/real-world.md b/doc/book/cookbook/real-world.md
index 5c2dd0f1..c15ea384 100644
--- a/doc/book/cookbook/real-world.md
+++ b/doc/book/cookbook/real-world.md
@@ -85,14 +85,14 @@ to store 2 TB of data in total.
## Get a Docker image
Our docker image is currently named `dxflrs/garage` and is stored on the [Docker Hub](https://hub.docker.com/r/dxflrs/garage/tags?page=1&ordering=last_updated).
-We encourage you to use a fixed tag (eg. `v0.9.2`) and not the `latest` tag.
-For this example, we will use the latest published version at the time of the writing which is `v0.9.2` but it's up to you
+We encourage you to use a fixed tag (eg. `v0.9.3`) and not the `latest` tag.
+For this example, we will use the latest published version at the time of the writing which is `v0.9.3` but it's up to you
to check [the most recent versions on the Docker Hub](https://hub.docker.com/r/dxflrs/garage/tags?page=1&ordering=last_updated).
For example:
```
-sudo docker pull dxflrs/garage:v0.9.2
+sudo docker pull dxflrs/garage:v0.9.3
```
## Deploying and configuring Garage
@@ -157,7 +157,7 @@ docker run \
-v /etc/garage.toml:/etc/garage.toml \
-v /var/lib/garage/meta:/var/lib/garage/meta \
-v /var/lib/garage/data:/var/lib/garage/data \
- dxflrs/garage:v0.9.2
+ dxflrs/garage:v0.9.3
```
With this command line, Garage should be started automatically at each boot.
@@ -171,7 +171,7 @@ If you want to use `docker-compose`, you may use the following `docker-compose.y
version: "3"
services:
garage:
- image: dxflrs/garage:v0.9.2
+ image: dxflrs/garage:v0.9.3
network_mode: "host"
restart: unless-stopped
volumes:
diff --git a/script/helm/garage/Chart.yaml b/script/helm/garage/Chart.yaml
index 9a21aa8e..71906cfb 100644
--- a/script/helm/garage/Chart.yaml
+++ b/script/helm/garage/Chart.yaml
@@ -21,4 +21,4 @@ version: 0.4.1
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
-appVersion: "v0.9.2"
+appVersion: "v0.9.3"
diff --git a/src/api/Cargo.toml b/src/api/Cargo.toml
index 40fab769..317031a7 100644
--- a/src/api/Cargo.toml
+++ b/src/api/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "garage_api"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Alex Auvolat <alex@adnab.me>"]
edition = "2018"
license = "AGPL-3.0"
diff --git a/src/api/signature/payload.rs b/src/api/signature/payload.rs
index 0029716a..d72736bb 100644
--- a/src/api/signature/payload.rs
+++ b/src/api/signature/payload.rs
@@ -31,7 +31,13 @@ pub const AWS4_HMAC_SHA256: &str = "AWS4-HMAC-SHA256";
pub const UNSIGNED_PAYLOAD: &str = "UNSIGNED-PAYLOAD";
pub const STREAMING_AWS4_HMAC_SHA256_PAYLOAD: &str = "STREAMING-AWS4-HMAC-SHA256-PAYLOAD";
-pub type QueryMap = HashMap<String, String>;
+pub type QueryMap = HeaderMap<QueryValue>;
+pub struct QueryValue {
+ /// Original key with potential uppercase characters,
+ /// for use in signature calculation
+ key: String,
+ value: String,
+}
pub async fn check_payload_signature(
garage: &Garage,
@@ -40,7 +46,7 @@ pub async fn check_payload_signature(
) -> Result<(Option<Key>, Option<Hash>), Error> {
let query = parse_query_map(request.uri())?;
- if query.contains_key(X_AMZ_ALGORITHM.as_str()) {
+ if query.contains_key(&X_AMZ_ALGORITHM) {
// We check for presigned-URL-style authentification first, because
// the browser or someting else could inject an Authorization header
// that is totally unrelated to AWS signatures.
@@ -122,8 +128,8 @@ async fn check_presigned_signature(
request: &mut Request<IncomingBody>,
mut query: QueryMap,
) -> Result<(Option<Key>, Option<Hash>), Error> {
- let algorithm = query.get(X_AMZ_ALGORITHM.as_str()).unwrap();
- let authorization = Authorization::parse_presigned(algorithm, &query)?;
+ let algorithm = query.get(&X_AMZ_ALGORITHM).unwrap();
+ let authorization = Authorization::parse_presigned(&algorithm.value, &query)?;
// Verify that all necessary request headers are included in signed_headers
// For AWSv4 pre-signed URLs, the following must be incldued:
@@ -136,7 +142,7 @@ async fn check_presigned_signature(
// but the signature cannot be computed from a string that contains itself.
// AWS specifies that all query params except X-Amz-Signature are included
// in the canonical request.
- query.remove(X_AMZ_SIGNATURE.as_str());
+ query.remove(&X_AMZ_SIGNATURE);
let canonical_request = canonical_request(
service,
request.method(),
@@ -162,10 +168,8 @@ async fn check_presigned_signature(
// then an InvalidRequest error is raised.
let headers_mut = request.headers_mut();
for (name, value) in query.iter() {
- let name =
- HeaderName::from_bytes(name.as_bytes()).ok_or_bad_request("Invalid header name")?;
- if let Some(existing) = headers_mut.get(&name) {
- if signed_headers.contains(&name) && existing.as_bytes() != value.as_bytes() {
+ if let Some(existing) = headers_mut.get(name) {
+ if signed_headers.contains(&name) && existing.as_bytes() != value.value.as_bytes() {
return Err(Error::bad_request(format!(
"Conflicting values for `{}` in query parameters and request headers",
name
@@ -181,7 +185,7 @@ async fn check_presigned_signature(
// that are not signed, however there is not much reason that this would happen)
headers_mut.insert(
name,
- HeaderValue::from_bytes(value.as_bytes())
+ HeaderValue::from_bytes(value.value.as_bytes())
.ok_or_bad_request("invalid query parameter value")?,
);
}
@@ -193,11 +197,19 @@ async fn check_presigned_signature(
}
pub fn parse_query_map(uri: &http::uri::Uri) -> Result<QueryMap, Error> {
- let mut query = QueryMap::new();
+ let mut query = QueryMap::with_capacity(0);
if let Some(query_str) = uri.query() {
let query_pairs = url::form_urlencoded::parse(query_str.as_bytes());
for (key, val) in query_pairs {
- if query.insert(key.to_string(), val.into_owned()).is_some() {
+ let name =
+ HeaderName::from_bytes(key.as_bytes()).ok_or_bad_request("Invalid header name")?;
+
+ let value = QueryValue {
+ key: key.to_string(),
+ value: val.into_owned(),
+ };
+
+ if query.insert(name, value).is_some() {
return Err(Error::bad_request(format!(
"duplicate query parameter: `{}`",
key
@@ -306,7 +318,7 @@ pub fn canonical_request(
// Canonical query string from passed HeaderMap
let canonical_query_string = {
let mut items = Vec::with_capacity(query.len());
- for (key, value) in query.iter() {
+ for (_, QueryValue { key, value }) in query.iter() {
items.push(uri_encode(&key, true) + "=" + &uri_encode(&value, true));
}
items.sort();
@@ -464,18 +476,19 @@ impl Authorization {
}
let cred = query
- .get(X_AMZ_CREDENTIAL.as_str())
+ .get(&X_AMZ_CREDENTIAL)
.ok_or_bad_request("X-Amz-Credential not found in query parameters")?;
let signed_headers = query
- .get(X_AMZ_SIGNEDHEADERS.as_str())
+ .get(&X_AMZ_SIGNEDHEADERS)
.ok_or_bad_request("X-Amz-SignedHeaders not found in query parameters")?;
let signature = query
- .get(X_AMZ_SIGNATURE.as_str())
+ .get(&X_AMZ_SIGNATURE)
.ok_or_bad_request("X-Amz-Signature not found in query parameters")?;
let duration = query
- .get(X_AMZ_EXPIRES.as_str())
+ .get(&X_AMZ_EXPIRES)
.ok_or_bad_request("X-Amz-Expires not found in query parameters")?
+ .value
.parse()
.map_err(|_| Error::bad_request("X-Amz-Expires is not a number".to_string()))?;
@@ -486,20 +499,20 @@ impl Authorization {
}
let date = query
- .get(X_AMZ_DATE.as_str())
+ .get(&X_AMZ_DATE)
.ok_or_bad_request("Missing X-Amz-Date field")?;
- let date = parse_date(date)?;
+ let date = parse_date(&date.value)?;
if Utc::now() - date > Duration::seconds(duration) {
return Err(Error::bad_request("Date is too old".to_string()));
}
- let (key_id, scope) = parse_credential(cred)?;
+ let (key_id, scope) = parse_credential(&cred.value)?;
Ok(Authorization {
key_id,
scope,
- signed_headers: signed_headers.to_string(),
- signature: signature.to_string(),
+ signed_headers: signed_headers.value.clone(),
+ signature: signature.value.clone(),
content_sha256: UNSIGNED_PAYLOAD.to_string(),
date,
})
diff --git a/src/block/Cargo.toml b/src/block/Cargo.toml
index 54093e4e..0f6fb5bb 100644
--- a/src/block/Cargo.toml
+++ b/src/block/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "garage_block"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Alex Auvolat <alex@adnab.me>"]
edition = "2018"
license = "AGPL-3.0"
diff --git a/src/db/Cargo.toml b/src/db/Cargo.toml
index bb72d5cd..d7c89620 100644
--- a/src/db/Cargo.toml
+++ b/src/db/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "garage_db"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Alex Auvolat <alex@adnab.me>"]
edition = "2018"
license = "AGPL-3.0"
diff --git a/src/garage/Cargo.toml b/src/garage/Cargo.toml
index 2c8ea3f9..b022049c 100644
--- a/src/garage/Cargo.toml
+++ b/src/garage/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "garage"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Alex Auvolat <alex@adnab.me>"]
edition = "2018"
license = "AGPL-3.0"
diff --git a/src/garage/tests/common/custom_requester.rs b/src/garage/tests/common/custom_requester.rs
index 2cac5cd5..8e1eaa56 100644
--- a/src/garage/tests/common/custom_requester.rs
+++ b/src/garage/tests/common/custom_requester.rs
@@ -64,6 +64,10 @@ impl CustomRequester {
vhost_style: false,
}
}
+
+ pub fn client(&self) -> &Client<HttpConnector, Body> {
+ &self.client
+ }
}
pub struct RequestBuilder<'a> {
diff --git a/src/garage/tests/s3/mod.rs b/src/garage/tests/s3/mod.rs
index 623eb665..4ebc4914 100644
--- a/src/garage/tests/s3/mod.rs
+++ b/src/garage/tests/s3/mod.rs
@@ -1,6 +1,7 @@
mod list;
mod multipart;
mod objects;
+mod presigned;
mod simple;
mod streaming_signature;
mod website;
diff --git a/src/garage/tests/s3/presigned.rs b/src/garage/tests/s3/presigned.rs
new file mode 100644
index 00000000..15270361
--- /dev/null
+++ b/src/garage/tests/s3/presigned.rs
@@ -0,0 +1,72 @@
+use std::time::{Duration, SystemTime};
+
+use crate::common;
+use aws_sdk_s3::presigning::PresigningConfig;
+use bytes::Bytes;
+use http_body_util::{BodyExt, Full};
+use hyper::Request;
+
+const STD_KEY: &str = "hello world";
+const BODY: &[u8; 62] = b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+
+#[tokio::test]
+async fn test_presigned_url() {
+ let ctx = common::context();
+ let bucket = ctx.create_bucket("presigned");
+
+ let etag = "\"46cf18a9b447991b450cad3facf5937e\"";
+ let body = Bytes::from(BODY.to_vec());
+
+ let psc = PresigningConfig::builder()
+ .start_time(SystemTime::now() - Duration::from_secs(60))
+ .expires_in(Duration::from_secs(3600))
+ .build()
+ .unwrap();
+
+ {
+ // PutObject
+ let req = ctx
+ .client
+ .put_object()
+ .bucket(&bucket)
+ .key(STD_KEY)
+ .presigned(psc.clone())
+ .await
+ .unwrap();
+
+ let client = ctx.custom_request.client();
+ let req = Request::builder()
+ .method("PUT")
+ .uri(req.uri())
+ .body(Full::new(body.clone()))
+ .unwrap();
+ let res = client.request(req).await.unwrap();
+ assert_eq!(res.status(), 200);
+ assert_eq!(res.headers().get("etag").unwrap(), etag);
+ }
+
+ {
+ // GetObject
+ let req = ctx
+ .client
+ .get_object()
+ .bucket(&bucket)
+ .key(STD_KEY)
+ .presigned(psc)
+ .await
+ .unwrap();
+
+ let client = ctx.custom_request.client();
+ let req = Request::builder()
+ .method("GET")
+ .uri(req.uri())
+ .body(Full::new(Bytes::new()))
+ .unwrap();
+ let res = client.request(req).await.unwrap();
+ assert_eq!(res.status(), 200);
+ assert_eq!(res.headers().get("etag").unwrap(), etag);
+
+ let body2 = BodyExt::collect(res.into_body()).await.unwrap().to_bytes();
+ assert_eq!(body, body2);
+ }
+}
diff --git a/src/model/Cargo.toml b/src/model/Cargo.toml
index 3060c133..2e5b047d 100644
--- a/src/model/Cargo.toml
+++ b/src/model/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "garage_model"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Alex Auvolat <alex@adnab.me>"]
edition = "2018"
license = "AGPL-3.0"
diff --git a/src/net/Cargo.toml b/src/net/Cargo.toml
index af7b4cbe..5168c939 100644
--- a/src/net/Cargo.toml
+++ b/src/net/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "garage_net"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Alex Auvolat <alex@adnab.me>"]
edition = "2018"
license = "AGPL-3.0"
diff --git a/src/rpc/Cargo.toml b/src/rpc/Cargo.toml
index de0e9e17..823fab99 100644
--- a/src/rpc/Cargo.toml
+++ b/src/rpc/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "garage_rpc"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Alex Auvolat <alex@adnab.me>"]
edition = "2018"
license = "AGPL-3.0"
diff --git a/src/table/Cargo.toml b/src/table/Cargo.toml
index 4cf21f9f..61b8a82e 100644
--- a/src/table/Cargo.toml
+++ b/src/table/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "garage_table"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Alex Auvolat <alex@adnab.me>"]
edition = "2018"
license = "AGPL-3.0"
diff --git a/src/util/Cargo.toml b/src/util/Cargo.toml
index fb7b632d..72581c16 100644
--- a/src/util/Cargo.toml
+++ b/src/util/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "garage_util"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Alex Auvolat <alex@adnab.me>"]
edition = "2018"
license = "AGPL-3.0"
diff --git a/src/web/Cargo.toml b/src/web/Cargo.toml
index 12bec5a7..7bbaca56 100644
--- a/src/web/Cargo.toml
+++ b/src/web/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "garage_web"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Alex Auvolat <alex@adnab.me>", "Quentin Dufour <quentin@dufour.io>"]
edition = "2018"
license = "AGPL-3.0"