From 785a157ae9e81ce833cea1be7e98fd6777ad3ca0 Mon Sep 17 00:00:00 2001 From: Ray Johnson Date: Mon, 11 Dec 2023 17:30:00 +0000 Subject: [PATCH] updated dependencies, had to fix a few tests --- Makefile | 4 +- Version | 2 +- browse_test.go | 18 +- caddyfile.go | 31 +- caddyfile_test.go | 56 +- go.mod | 25 +- go.sum | 2984 +++++++++++++++++++++++++++++++++++++-------- s3proxy_test.go | 17 +- 8 files changed, 2523 insertions(+), 614 deletions(-) diff --git a/Makefile b/Makefile index 876fa3a..7017b90 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ -export GO111MODULE=on VERSION := $(shell cat Version) COVER_TARGET ?= 30 @@ -32,7 +31,7 @@ cover: ## Generate test coverage results .PHONY: lint lint: ## Run golint on source base - @golangci-lint run ./... + @golangci-lint run --config .standard-lint.yml ./... .PHONY: localstack localstack: ## Launch localstack to run tests against @@ -51,6 +50,7 @@ awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' .PHONY: clean clean: ## Delete any generated files @rm -f caddy + @rm -f cover.profile cover.html cover.func .PHONY: version version: ## Show the version the Makefile will build diff --git a/Version b/Version index 659914a..416bfb0 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -0.5.8 +0.5.9 diff --git a/browse_test.go b/browse_test.go index 54f59fd..d0d4f28 100644 --- a/browse_test.go +++ b/browse_test.go @@ -21,7 +21,7 @@ func TestConstructListObjInput(t *testing.T) { } testCases := []testCase{ - testCase{ + { name: "no query options", bucket: "myBucket", key: "/mypath/", @@ -31,7 +31,7 @@ func TestConstructListObjInput(t *testing.T) { Prefix: aws.String("mypath/"), }, }, - testCase{ + { name: "max option", bucket: "myBucket", key: "/mypath/", @@ -43,7 +43,7 @@ func TestConstructListObjInput(t *testing.T) { MaxKeys: aws.Int64(20), }, }, - testCase{ + { name: "max with next", bucket: "myBucket", key: "/mypath/", @@ -78,15 +78,15 @@ func TestMakePageObj(t *testing.T) { NextContinuationToken: aws.String("next_token"), MaxKeys: aws.Int64(20), CommonPrefixes: []*s3.CommonPrefix{ - &s3.CommonPrefix{ + { Prefix: aws.String("/mydir"), }, - &s3.CommonPrefix{ + { Prefix: aws.String("/otherdir"), }, }, Contents: []*s3.Object{ - &s3.Object{ + { Key: aws.String("/path/to/myobj"), Size: aws.Int64(1024), LastModified: aws.Time(time.Date(1845, time.November, 10, 23, 0, 0, 0, time.UTC)), @@ -99,17 +99,17 @@ func TestMakePageObj(t *testing.T) { Count: 20, MoreLink: "?max=20&next=next_token", Items: []Item{ - Item{ + { Url: "./mydir/", IsDir: true, Name: "mydir", }, - Item{ + { Url: "./otherdir/", IsDir: true, Name: "otherdir", }, - Item{ + { Url: "./myobj", Key: "/path/to/myobj", IsDir: false, diff --git a/caddyfile.go b/caddyfile.go index d2a8ca8..6d240ca 100644 --- a/caddyfile.go +++ b/caddyfile.go @@ -15,22 +15,21 @@ func init() { // parseCaddyfile parses the s3proxy directive. It enables the proxying // requests to S3 and configures it with this syntax: // -// s3proxy [] { -// root -// region -// profile -// bucket -// index -// hide -// endpoint -// enable_put -// enable_delete -// force_path_style -// use_accelerate -// errors [] [|pass_through] -// browse [