From 037fb7f1aeaa628f2ae9023d00eda29608414f12 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Fri, 8 Sep 2023 21:41:08 -0700 Subject: [PATCH] allow aws_http to use static signing time --- src/aws_http.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aws_http.zig b/src/aws_http.zig index 1e313d4..41de07e 100644 --- a/src/aws_http.zig +++ b/src/aws_http.zig @@ -39,6 +39,9 @@ pub const Options = struct { region: []const u8 = "aws-global", dualstack: bool = false, sigv4_service_name: ?[]const u8 = null, + + /// Used for testing to provide consistent signing. If null, will use current time + signing_time: ?i64 = null, }; pub const Header = base.Header; @@ -110,6 +113,7 @@ pub const AwsHttp = struct { .region = getRegion(service, options.region), .service = options.sigv4_service_name orelse service, .credentials = creds, + .signing_time = options.signing_time, }; return try self.makeRequest(endpoint, request, signing_config); }