>_ RESTERM
v1.18.2

examples Variables and auth

auth_scopes.http

Default auth inheritance across global, file and request scopes, plus @auth none.

runs as-is

shell
resterm run --all _examples/auth_scopes.http

Run this from the root of a clone of the Resterm repository.

Editor
# @global auth.globalToken demo-global-token
# @global auth.fileToken demo-file-token

# @auth global bearer {{auth.globalToken}}
# @auth file bearer {{auth.fileToken}}

### Global Default Auth
# @name AuthGlobalDefault
# @tag auth scopes global
# @description Inherits the global default because no file-scoped auth has been defined yet.
GET https://httpbin.org/anything/auth/global-default
Accept: application/json

### File Default Auth
# @name AuthFileDefault
# @tag auth scopes file
# @description Inherits the file default, which overrides the earlier global default for later requests in this document.
GET https://httpbin.org/anything/auth/file-default
Accept: application/json

### Explicit Request Override
# @name AuthRequestOverride
# @tag auth scopes request
# @description Uses explicit request-scoped auth instead of the inherited file default.
# @auth request bearer request-token-{{$uuid}}
GET https://httpbin.org/anything/auth/request-override
Accept: application/json

### Disable Inherited Auth
# @name AuthNone
# @tag auth scopes none
# @description Disables inherited auth for this request with @auth none.
# @auth none
GET https://httpbin.org/anything/auth/no-auth
Accept: application/json

_examples/auth_scopes.http on GitHub

Authentication directives docs
Search

↑↓ moveEnter openEsc close

Help

These keys work like the ones in the TUI.

/
Search the docs (also Ctrl K)
j k
Scroll down and up
g g G
Jump to the top or the bottom
[ ]
Previous and next page
g d
Docs index
g h
Home page
t
Switch between dark and light
?
Show this help
Esc
Close a dialog