ArchGPT / insomnium

Insomnium is a fast local API testing tool that is privacy-focused and 100% local. For testing GraphQL, REST, WebSockets and gRPC. This is a fork of Kong/insomnia
MIT License
3.38k stars 156 forks source link

AWS S3 sign header error when pushing a file to S3 #167

Open dennis-dmak opened 6 months ago

dennis-dmak commented 6 months ago

Expected Behavior

I'm trying to push a file to AWS S3 bucket using a AWS restapi. I was able to use GET method to view bucket successfully. But hen try to push a file I get errors. This works in postman though. When provided following values/parameters, file should be pushed to S3 bucket

Auth_Type: AWS
                  Access Key ID : <Key ID>
                  SECRET ACCESS KEY : <S_KEY_ID>
Headers:
                  x-amz-server-side-encryption-aws-kms-key-id: <KMS Key ID>
                  x-amz-server-side-encryption: aws:kms
                  Content-Type: application/pdf
Body: Select Binary File
                 Select the binary file you need. I selected a pdf file

Actual Behavior

When I click Send, I get ; _

AWS authentication not supported for provided body type

_

image

If I remove the file from the Body, U get following erro

<?xml version="1.0" encoding="UTF-8"?>
<Error>
    <Code>AccessDenied</Code>
    <Message>There were headers present in the request which were not signed</Message>
    <HeadersNotSigned>x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption</HeadersNotSigned>
    <RequestId>EVF7CZD37D8E9CCV</RequestId>
    <HostId>brD9BEa6GUpbZv/POyFP4bLBegEvknFWYJs+VPTXWXbzcyOADokrXZieVYVFIRuDBJnhg5rR0A8=</HostId>
</Error>

image

Reproduction Steps

  1. Select Method : PUT
  2. Type the AWS S3 URL box. https://.s3.eu-central-1.amazonaws.com/Test.pdf
  3. Select Auth Type as "AWS"
  4. Provide, Access KEY ID, SECRET ACCESS KEY, REGION and SERVICE(S3)
  5. Go to Headers tab and Add Content-Type => application/pdf, x-amz-server-side-encryption-aws-kms-key-id => , x-amz-server-side-encryption => aws:kms
  6. Click Send

Now you will get the first error in Actual Behavior Now remove the File from the body and click send. You will get the second error from the Actual Behavior

Is there an existing issue for this?

Additional Information

No response

Insomnium Version

Insomnium 0.2.3-a, Build Date: 29/10/2023

What operating system are you using?

Windows

Operating System Version

Windows 10 Enterprise

Installation method

Downloaded from Internet

Last Known Working Insomnium version

N/A