mirror of
https://github.com/JoshiCodes/knock.git
synced 2026-12-04 16:19:42 +01:00
GraphQL, WebSocket, import, runner and CLI (M5, M6) plus packaging
- GraphQL editor with schema introspection, cached schema, autocomplete and explorer - WebSocket: auth and subprotocols in the handshake, text/JSON/hex/file messages, saved messages, live log with filter, search and export, reconnect with backoff - Import from Postman (collections and environments), Bruno, Insomnia, OpenAPI/Swagger and cURL; imported scripts are kept as docs, never run; credentials move to the gitignored secrets file - Code snippets for cURL, fetch, Python, HTTPie, Go, PowerShell; Postman export - Runner for folders and collections with JSON and JUnit reports - knock CLI: send, run, import, auth login/debug/logout - Large JSON responses parsed off the main thread - PKGBUILDs, desktop entry with knock:// handler, CI workflow, README
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
meta {
|
||||
name: Login
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/auth/login
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Accept: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "{{email}}",
|
||||
"password": "{{password}}"
|
||||
}
|
||||
}
|
||||
|
||||
vars:post-response {
|
||||
token: res.body.token
|
||||
~refresh: res.body.refresh_token
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.token: isDefined
|
||||
res.headers.content-type: contains json
|
||||
res.body.roles: length 2
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
bru.setVar("loggedInAt", Date.now());
|
||||
}
|
||||
|
||||
tests {
|
||||
test("returns a token", function() {
|
||||
expect(res.getBody().token).to.be.a("string");
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
meta {
|
||||
name: auth
|
||||
seq: 1
|
||||
}
|
||||
Reference in New Issue
Block a user