aws-sdk-go-v2 icon indicating copy to clipboard operation
aws-sdk-go-v2 copied to clipboard

MIGRATION ISSUE: Missing presigned request functionality for SQS service

Open avishay28 opened this issue 1 year ago • 1 comments

Pre-Migration Checklist

Go Version Used

Go 1.21

Describe the Migration Issue

Back in v1 I was able to obtain presign URL for SQS service ReceiveMessage operation, by calling ReceiveMessageRequest. I couldn't find a way to do it SDK v2, the only way is to call ReceiveMessage and get the messages directly.

Code Comparison

In V1:

func (s *Service) getSignedRequestsURL(queueURL string, maxNumOfMessages, visibilityTimeout, waitTimeSeconds int64) (string, error) {
    req, _ := s.sqsService.ReceiveMessageRequest(&sqs.ReceiveMessageInput{
        QueueUrl:            aws.String(queueURL),
        MaxNumberOfMessages: aws.Int64(maxNumOfMessages),
        VisibilityTimeout:   aws.Int64(visibilityTimeout),
        WaitTimeSeconds:     aws.Int64(waitTimeSeconds),
    })

    exp := 20 * time.Minute
    signedURL, err := req.Presign(exp)
    if err != nil {
        return "", err
    }

    return signedURL, nil
} 

Observed Differences/Errors

Similar functionality not exist in V2.

Additional Context

No response

avishay28 avatar Sep 16 '24 08:09 avishay28

Hi @avishay28,

We are going to do some work that would impact presigning in Go v2 so this will likely be covered by it. I don't think that the presigning behavior would mirror the v1 behavior, but we will consider this to maintain feature parity gaps between v1 and v2.

I'm adding this to our backlog.

Thanks for taking the time and reaching out. Ran~

RanVaknin avatar Sep 25 '24 20:09 RanVaknin