QA Labs Plugin

Status

In the portal's iframe
…
Portal origin
unknown
host-ready
not received
Library
—
Handshake
waiting
Token
none
Tokens received
0
Last auth_error
none
Gateway
https://labsgw.qa.clickhelp.com

Scenarios

Projects from the front end

auth.api.getAllProjectsPublications({ query: { types: "Project" } })

Expected: 200 with the projects: the Gateway lets the plug-in's origin through (CORS)

Projects through the back end

auth.fetchBackend("/api/projects") → gateway.forRequest(req).api.getAllProjectsPublications()

Expected: 200 with the projects, and no cookies of the portal received by the back end

Back end without a token

fetch("/api/projects") — plain fetch, no Authorization

Expected: 401 from the back-end helper itself, the Gateway is not called

Outside the scope

auth.fetch("/v2/users")

Expected: 403 from the Gateway: GET /v2/users is not in the scope of the plug-in (QP has only POST and PATCH there)

Stoplist: DELETE

auth.fetch("/v2/projects/labs-test-plugin-no-such-project", { method: "DELETE" })

Expected: 403 from the Gateway: any DELETE is closed for every plug-in; nothing reaches the portal

Stoplist: API v1

auth.fetch("/v1/projects")

Expected: 403 from the Gateway: the whole API v1 is closed for every plug-in

Path trick: encoded slash

auth.fetch("/v2/projects/..%2fusers")

Expected: 403 or 400 from the Gateway: decoded and normalized, the path is /v2/users, outside the scope

Path trick: encoded dots

auth.fetch("/v2/projects/%2e%2e%2fusers")

Expected: 403 or 400 from the Gateway, as above

Path trick: upper case

auth.fetch("/V2/USERS")

Expected: 403 from the Gateway: paths are compared ignoring case, as IIS treats them

Method outside the scope

auth.fetch("/v2/projects", { method: "POST", ... })

Expected: 403 from the Gateway: the scope of QP allows POST only under /v2/projects/.+, not on /v2/projects itself; no project is created

A header the Gateway does not allow

auth.fetch("/v2/projects", { headers: { "X-Labs-Test": "1" } })

Expected: PluginAuthError network: the CORS preflight fails, the request never leaves the browser

401 from the Gateway

auth.fetchBackend("/api/broken-token") — the back end sends a token the Gateway does not know

Expected: 401 after one token refresh and one repeat (the refresh waits until 10 s have passed since the previous token)

429: burst on the back end

auth.fetchBackend("/api/burst") — 40 parallel requests from the back end

Expected: 200 with the statuses the back end got: some 429 with Retry-After (limit of 20 concurrent requests)

429: relayed to the front end

auth.fetchBackend("/api/burst?relay=1") — the back end passes the first 429 on

Expected: 429 after the library waited Retry-After and repeated the call twice (each repeat bursts again)

Ask for a token

auth.getToken()

Expected: a token (only its length is shown). After an auth_error this is the "try again": the library asks the portal anew

Инструменты QP

Я

Адрес фрейма
…
Origin
…
Во фрейме
…
Origin предков
…
Referrer
…
Вид токена
нет токена
Длина токена
—
Частей через точку
—
Начинается с eyJ
—

Свой запрос с бека

Бек плагина шлёт запрос на любой адрес; путь уходит как есть, без нормализации. Ответ — как пришёл, редиректы не выполняются.

Свой запрос с фронта

Запрос из окна плагина через fetch(): браузер сам нормализует путь и не даёт задать Cookie, Host и другие запрещённые заголовки.

Сообщение порталу

Любое сообщение родительскому окну, заданное число раз, в обход библиотеки. Ответы портала видны в Events и в блоке Status (Tokens received).

Окно-двойник и ловушка во вложенном фрейме

Страница-ловушка сама шлёт порталу host-ready-request и token-request (pluginId qa-labs-plugin) и показывает всё, что ей пришло. Окно-двойник и вложенный фрейм-двойник — с домена QP, ловушка — с другого домена.

Увести фрейм и увести вкладку

35 токенов подряд

token-request порталу один за другим: следующий — после ответа на предыдущий или по истечении ожидания. Ответы портала на его запрос /labs/tokens/ (200, 429 и Retry-After) видны в сети страницы портала.

Страницы вне плагина

Открываются отдельной вкладкой, на домене QP.

Events

Nothing yet.