v1.10.1
This patch changes how a named command auth is defined. In 1.10.0, a word after @auth <scope file|global> file command became the definition's name, so a request file written for 1.9.1 could lose its default auth without an error, like @auth file command gh. A definition is now named with name=.
If you have not updated yet, see the 1.10.0 release notes for cmd=, named command auth, errors for options with spaces around =, and the Headers tab.
Named definitions use name=
# @auth global command name=gh cmd="gh auth token"
### User
# @auth use=gh
GET https://api.github.com/username=can go anywhere on the line.- Only
commanddefinitions on@auth fileand@auth globallines take a name. A request line withname=is an error.
In 1.9.1, a word after command was ignored, so this line was the default for every request in the workspace:
# @auth global command gh argv=["gh","auth","token"]In 1.10.0, gh became the name of the definition. Named definitions are not inherited, so requests that relied on the line were sent without auth. Now the line is an error:
error[parse]: @auth expects key=value options but got "gh". Write name=gh to name a definition
--> defs.http:1:3
|
1 | # @auth global command gh argv=["gh","auth","token"]
| ^
Requests that take their auth from the line fail with the same error instead of being sent:
error[auth]: @auth expects key=value options but got "gh". Write name=gh to name a definition (/work/api/defs.http:1)
To fix the line, do one of these:
- Remove the word to keep the line as the default, as it was in 1.9.1.
- Write
name=ghto make it a named definition, and add# @auth use=ghto each request that needs the token.
Completion
@authsuggestions follow the line. After@auth file, only auth kinds are offered. Aftercommand, only command options. Afteruse=gh, onlyheader,scheme, andtimeout.- On a
fileorgloballine, choosingcommandleaves the options open and suggestsname=first. On a request line it still insertscmd="gh auth token". use=suggests definitions from every file Resterm scans. In 1.10.0 it only suggested names from the open file. The same applies to@apply use=,@ssh use=, and@k8s use=.- A global definition in a subdirectory is suggested only when Resterm runs with
-R, the same as when a request runs.
Changed
These changes may affect existing request files:
- A word after
@auth file commandor@auth global commandis an error. Writename=<some_auth_name>for a named definition, or remove the word. - A definition written for 1.10.0, such as
@auth global command gh cmd="gh auth token", needsname=gh. Until then, the line reports the error above, and requests with@auth use=ghfail with@auth use="gh" not found.