usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
25.66k stars 1.17k forks source link

CLI does not apply AWS Sigv4 to requests when the AWS Sigv4 is set at the collection level using environment variables #2389

Closed bdenio11 closed 3 months ago

bdenio11 commented 3 months ago

I have checked the following:

Describe the bug

The CLI does not apply AWS signature v4 environment variables to requests when the requests are set to inherit auth from the collection.

.bru file to reproduce the bug

Both of these are the .bru files of the same request

Does not work

A Put request

put { url: any-url body: json auth: inherit }

The inherited collection.bru file

auth { mode: awsv4 }

auth:awsv4 { accessKeyId: {{accessKey}} secretAccessKey: {{secretKey}} sessionToken: {{sessionToken}} service: {{serviceName}} region: {{region}} profileName: }

Does work

The put request with its auth on the request

put { url: any-url body: json auth: awsv4 } auth:awsv4 { accessKeyId: {{accessKey}} secretAccessKey: {{secretKey}} sessionToken: {{sessionToken}} service: {{serviceName}} region: {{region}} profileName: }

Screenshots/Live demo link

Apologies I cannot do a live demo. Here you can see the collection configuration is loaded successfully in the UI for the signature and unsuccessfully for the CLI. The URL environment variable functions as expected but anything related to AWS v4 sig fails to interpolate. The fix for this currently is to include the signature on each request. This ticket mentions here https://github.com/usebruno/bruno/pull/1713

image image

bdenio11 commented 3 months ago

https://github.com/usebruno/bruno/pull/2243 Address the issue.