Closed jiaxian-lin closed 2 years ago
Hello,
the value of authCommand
should be a bash command whose output is a JSON array containing a list of authentication tokens.
The command echo <SOMETHING>
is used to output a custom string, and it is useful in this case to provide static token(s). More complex commands can be used, such as python scripts that retrieve token(s) by authenticating with the REST API.
The output format of the command should be similar to the following:
[
{
"name": "Authorization",
"value": "Bearer: <TOKEN>",
"in": "header",
"timeout": 300
}
]
In this case, we tell RestTestGen that it must add a parameter with name Authorization
and value Bearer: <TOKEN>
in the header
of each request. We also tell the tool that the script should be re-executed every 300
seconds in order to refresh the token.
In your particular case, it seems that RestTestGen could not run the command echo
. I am not sure if this is a problem of your machine, or if it is a problem of RestTestGen on Windows. In fact, at the moment, we only tested our tool on Linux. While we further investigate the problem, I would suggest running RestTestGen on Linux.
thx for your reply! But when I run RestTestGen in ubuntu, I got this ERROR, I don't know why and this open API file is converted by Swagger Editor
this is a part of my API file:
/projects/{id}/fork:
post:
tags:
- projects-api
parameters:
- name: id
schema:
type: integer
required: true
in: path
description: The ID or URL-encoded path of the project.
- name: path
schema:
type: string
in: query
required: true
- name: name
schema:
type: string
in: query
required: true
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The name assigned to the resultant project after forking.
namespace_id:
type: integer
description: The ID of the namespace that the project is forked to.
namespace_path:
type: string
description: The path of the namespace that the project is forked to.
namespace:
oneOf:
- type: integer
- type: string
description:
(Deprecated) The ID or path of the namespace that the
project is forked to.
path:
type: string
description: The path assigned to the resultant project after forking.
responses:
'200':
description: success
Can you tell me how to fix this @davidecorradini
Can you tell me how to fix this @davidecorradini
I replied on the other issue. Davide
I don't know how to configure the value of “authCommand” and the default value gives an error on execution.