Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.17k stars 1.92k forks source link

Authorization Header not read when importing a Postman file #5920

Open Alex23rodriguez opened 1 year ago

Alex23rodriguez commented 1 year ago

Expected Behavior

When importing a Collection, headers named "Authorization" are ignored, instead of being added as a header or being added as an "API Key Auth" with KEY: Authorization, VALUE: {{value}} and ADD TO: Header

Actual Behavior

The header is completely ignored. This is a problem when importing a large collection, as there is no way to edit the Authorization or Header of many requests simultaneously without the use of a plugin. See example below

Reproduction Steps

  1. Copy the following JSON schema (taken from a bigger collection found here):
    
    {
    "info": {
    "name": "Mirakl seller API: mmp",
    "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
    },
    "variables": [],
    "item": [
    {
      "name": "example",
      "request": {
        "method": "get",
        "url": {
          "raw": "{{URL}}/api/document-request/:document_request_id/lines",
          "host": ["{{URL}}"],
          "path": [
            "",
            "api",
            "document-request",
            ":document_request_id",
            "lines"
          ],
          "variable": [{ "key": ":document_request_id", "value": "value" }],
          "query": [{ "key": "shop_id", "value": "", "disabled": true }]
        },
        "header": [
          { "key": "Authorization", "value": "{{APIKEY}}" },
          { "key": "Accept", "value": "application/json" }
        ],
        "body": {}
      },
      "response": []
    }
    ]
    }

2. go to Home on the Insomnia App
3. click on "Create" > "Import from Clipboard"
4. Select "Import as Request Collection"
5. Notice how the request has no Header corresponding to the "Authorization" key, as well as no Auth Key

### Is there an existing issue for this?

- [X] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.

### Additional Information

_No response_

### Insomnia Version

2023.1.0

### What operating system are you using?

macOS

### Operating System Version

12.6.2

### Installation method

Website

### Last Known Working Insomnia version

_No response_
Makoehle commented 11 months ago

Is there a way to provide a default auth for all requests in my collection?