Skip to content

Commit

Permalink
Remove internal AWS SDK implementation (#1030)
Browse files Browse the repository at this point in the history
Closes #1029
  • Loading branch information
roman-khimov authored Dec 16, 2024
2 parents 0f78258 + 54ff7e6 commit b0ac82c
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 981 deletions.
3 changes: 2 additions & 1 deletion api/auth/center.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"time"

"github.com/aws/aws-sdk-go/aws/credentials"
v4amz "github.com/aws/aws-sdk-go/aws/signer/v4"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
v4 "github.com/nspcc-dev/neofs-s3-gw/api/auth/signer/v4"
"github.com/nspcc-dev/neofs-s3-gw/api/cache"
Expand Down Expand Up @@ -314,7 +315,7 @@ func cloneRequest(r *http.Request, authHeader *authHeader) *http.Request {

func (c *center) checkSign(authHeader *authHeader, box *accessbox.Box, request *http.Request, signatureDateTime time.Time) error {
awsCreds := credentials.NewStaticCredentials(authHeader.AccessKeyID, box.Gate.AccessKey, "")
signer := v4.NewSigner(awsCreds)
signer := v4amz.NewSigner(awsCreds)

var signature string
if authHeader.IsPresigned {
Expand Down
3 changes: 2 additions & 1 deletion api/auth/center_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"time"

"github.com/aws/aws-sdk-go/aws/credentials"
v4aws "github.com/aws/aws-sdk-go/aws/signer/v4"
v4 "github.com/nspcc-dev/neofs-s3-gw/api/auth/signer/v4"
"github.com/nspcc-dev/neofs-s3-gw/api/s3errors"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -380,7 +381,7 @@ func TestAwsEncodedWithRequest(t *testing.T) {
"79488f248493cb5175ea079a12a3e08015021d9c710a064017e1da6a2b0ae111", // secret_access_key
"")

signer := v4.NewSigner(awsCreds)
signer := v4aws.NewSigner(awsCreds)

signer.DisableURIPathEscaping = true
_, err = signer.Sign(req, nil, "s3", "us-east-1", ts)
Expand Down
87 changes: 0 additions & 87 deletions api/auth/signer/v4/header_rules.go

This file was deleted.

7 changes: 0 additions & 7 deletions api/auth/signer/v4/options.go

This file was deleted.

14 changes: 0 additions & 14 deletions api/auth/signer/v4/request_context_go1.7.go

This file was deleted.

25 changes: 0 additions & 25 deletions api/auth/signer/v4/uri_path.go

This file was deleted.

Loading

0 comments on commit b0ac82c

Please sign in to comment.