From 19f3b861de25c8e45fc29ac13c7b272747da43f8 Mon Sep 17 00:00:00 2001 From: Noah Pederson Date: Sat, 21 Oct 2023 17:51:02 -0500 Subject: [PATCH] Fixes failing build... * Renames s3-client constructor from make-s3-client to S3Client to not conflict with the one generated by `defstruct` * Calculate the empty-body sha256 hash on module import time --- src/std/net/s3/api.ss | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/std/net/s3/api.ss b/src/std/net/s3/api.ss index 1242543b2..0d91d4b26 100644 --- a/src/std/net/s3/api.ss +++ b/src/std/net/s3/api.ss @@ -13,27 +13,27 @@ :std/error :std/sugar :std/srfi/19) -(export make-s3-client S3ClientError) +(export S3Client S3ClientError) -(def (make-s3-client +; precomputed empty sha256 +(def emptySHA256 (sha256 #u8())) + +(def (S3Client (endpoint "s3.amazonaws.com") (access-key (getenv "AWS_ACCESS_KEY_ID" #f)) (secret-key (getenv "AWS_SECRET_ACCESS_KEY" #f)) - (region (getenv "AWS_DEFAULT_REGION" "us-east-1")) - (cond - ((not access-key) - (raise-s3-error make-s3-client "Must provide access key" "access-key")) - ((not secret-key) - (raise-s3-error make-s3-client "Must provide secret key" "secret-key"))) - (S3 (make-s3-client endpoint access-key secret-key region)))) - -; precomputed empty sha256 -(def emptySHA256 (syntax-eval (sha256 #u8()))) + (region (getenv "AWS_DEFAULT_REGION" "us-east-1"))) + (cond + ((not access-key) + (raise-s3-error make-s3-client "Must provide access key" "access-key")) + ((not secret-key) + (raise-s3-error make-s3-client "Must provide secret key" "secret-key"))) + (S3 (make-s3-client endpoint access-key secret-key region))) (defstruct s3-client (endpoint access-key secret-key region) final: #t - constructor: make-s3-client) + constructor: S3Client) (defstruct bucket (client name region) final: #t)