Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

convert authorization fail #80

Closed
XuCcc opened this issue Jan 28, 2021 · 7 comments
Closed

convert authorization fail #80

XuCcc opened this issue Jan 28, 2021 · 7 comments

Comments

@XuCcc
Copy link

XuCcc commented Jan 28, 2021

Postman link: https://www.getpostman.com/collections/f2e5124ce87d5523bd73

i find that some authorization convert fail, like

    postman[Request]({
      name: "获取产品交付件报告列表",
      id: "2220f3e8-724f-41fe-bb5f-db62d882ddef",
      method: "GET",
      address:
        "{{address}}/interface/v3/products/24013871/deliverable/reports?type=WebScan",
      headers: {
        "x-auth-token":
          "ETMsDgAAAXZmUp5GABRBRVMvQ0JDL1BLQ1M1UGFkZGluZwCAABAAEHV5T3VMnz6VqWXXvJbZ2sQAAACA5Ptzl6OtqeUTyKHDEGHlwcdNEE/dgOUtj0Eds3+Kf8KZkIp39mOK+lhLQwyktFZ0nfj+EzV7bIcMLgxTdHP31ZmmkTHx3J0t5hBjmo7MLmWNhQExPuobbTvXFID3m1QAMBAMxyNSec3lqCm6EyTJmwYETZQ1zY1M6ONA67Tx0b8AFKFk3UUEgOH521tBlEBWIRQN4lE4"
      }
    });

    postman[Request]({
      name: " 获取工作空间测试报告某版本的质量汇总数据",
      id: "adc0824d-ebda-4791-8a35-f496689cbb72",
      method: "GET",
      address: "{{address}}/interface/v3/products/23046806/quality",
      auth(config, Var) {
        config.options.x -
        auth -
        token = "ETMsDgAAAXZmUp5GABRBRVMvQ0JDL1BLQ1M1UGFkZGluZwCAABAAEHV5T3VMnz6VqWXXvJbZ2sQAAACA5Ptzl6OtqeUTyKHDEGHlwcdNEE/dgOUtj0Eds3+Kf8KZkIp39mOK+lhLQwyktFZ0nfj+EzV7bIcMLgxTdHP31ZmmkTHx3J0t5hBjmo7MLmWNhQExPuobbTvXFID3m1QAMBAMxyNSec3lqCm6EyTJmwYETZQ1zY1M6ONA67Tx0b8AFKFk3UUEgOH521tBlEBWIRQN4lE4";
      }
    });
@thim81
Copy link
Contributor

thim81 commented Jan 28, 2021

I have similar results:

postman[Request]({
      name: "Get all list configurations",
      id: "22bc6f33-f0f0-4bbf-927b-dad877088cc7",
      method: "GET",
      address: "{{baseUrl}}/lists/v2?$top=100&$skip=0&$count=false",
      headers: {
        "X-ApiKey": "{{username}}:{{password}}"
      },
      auth(config, Var) {
        config.headers.X - ApiKey = true;
      }
    });

No sure how to overcome this.

@thim81
Copy link
Contributor

thim81 commented Feb 2, 2021

@XuCcc Did you found a way to overcome the auth method?

@XuCcc
Copy link
Author

XuCcc commented Feb 3, 2021

i just overwrite them by sublime with alt+d 😶

@simskij
Copy link
Contributor

simskij commented Apr 22, 2021

Would you mind giving some more context? I'm not sure I even understand what these lines are supposed to do?

config.options.x -
        auth -
        token = "....";

and

        config.headers.X - ApiKey = true;

@XuCcc
Copy link
Author

XuCcc commented Apr 25, 2021

PostMan origin json:

				{
					"name": "安全规范遵从度汇总数据",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "x-auth-token",
								"value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{address}}/interface/v3/products/{{pbi}}/compliance",
							"host": [
								"{{address}}"
							],
							"path": [
								"interface",
								"v3",
								"products",
								"{{pbi}}",
								"compliance"
							],
							"query": [
								{
									"key": "pbi",
									"value": "4120335",
									"disabled": true
								}
							]
						}
					},
					"response": []
				},

when convert to k6

    postman[Request]({
      name: "安全规范遵从度汇总数据",
      id: "a127b32a-1ea0-46ad-a28f-56ad27b7309e",
      method: "GET",
      address: "{{address}}/interface/v3/products/{{pbi}}/compliance",
      headers: {
        "x-auth-token":
          "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      },
      auth(config, Var) {
        config.options.x -
        auth -
        token = "xxxxxxxxxxxxxxxxxxxx";
      }
    });

this js code has syntax error when i run k6 with it

❯ k6  run .\a.js

          /\      |‾‾| /‾‾/   /‾‾/
     /\  /  \     |  |/  /   /  /
    /  \/    \    |     (   /   ‾‾\
   /          \   |  |\  \ |  (‾)  |
  / __________ \  |__| \__\ \_____/ .io

ERRO[0000] SyntaxError: file:///C:/Users/x00519684/Desktop/a.js: Invalid left-hand side in assignment expression (32:8)
  30 |       },
  31 |       auth(config, Var) {
> 32 |         config.options.x -
     |         ^
  33 |         auth -
  34 |         token = "xxxxxxxxxxxx";
  35 |       } at <eval>:2:28542(114)

@simskij
Copy link
Contributor

simskij commented Apr 25, 2021

Yeah, this definitely looks to be generating borked code in this particular case. I’ll have a look and get back to you.

@simskij simskij self-assigned this Apr 25, 2021
@simskij simskij removed their assignment Nov 12, 2021
@ppcano
Copy link
Collaborator

ppcano commented Nov 22, 2021

Apologies for the inactivity on this project.

Due to the inability to properly support this project, the k6 team has decided not to continue its development. The primary reason is that k6 scope has grown significantly with the launch of k6 extensions. The team is prioritizing extending k6 capabilities over the converters.

We suggest you post your issue at api-deck/postman-to-k6. The project is active and maintained on this fork.

@ppcano ppcano closed this as completed Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants