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)
auth.api.getAllProjectsPublications({ query: { types: "Project" } })Expected: 200 with the projects: the Gateway lets the plug-in's origin through (CORS)
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
fetch("/api/projects") — plain fetch, no AuthorizationExpected: 401 from the back-end helper itself, the Gateway is not called
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)
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
auth.fetch("/v1/projects")Expected: 403 from the Gateway: the whole API v1 is closed for every plug-in
auth.fetch("/v2/projects/..%2fusers")Expected: 403 or 400 from the Gateway: decoded and normalized, the path is /v2/users, outside the scope
auth.fetch("/v2/projects/%2e%2e%2fusers")Expected: 403 or 400 from the Gateway, as above
auth.fetch("/V2/USERS")Expected: 403 from the Gateway: paths are compared ignoring case, as IIS treats them
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
auth.fetch("/v2/projects", { headers: { "X-Labs-Test": "1" } })Expected: PluginAuthError network: the CORS preflight fails, the request never leaves the browser
auth.fetchBackend("/api/broken-token") — the back end sends a token the Gateway does not knowExpected: 401 after one token refresh and one repeat (the refresh waits until 10 s have passed since the previous token)
auth.fetchBackend("/api/burst") — 40 parallel requests from the back endExpected: 200 with the statuses the back end got: some 429 with Retry-After (limit of 20 concurrent requests)
auth.fetchBackend("/api/burst?relay=1") — the back end passes the first 429 onExpected: 429 after the library waited Retry-After and repeated the call twice (each repeat bursts again)
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
Бек плагина шлёт запрос на любой адрес; путь уходит как есть, без нормализации. Ответ — как пришёл, редиректы не выполняются.
Запрос из окна плагина через fetch(): браузер сам нормализует путь и не даёт задать Cookie, Host и другие запрещённые заголовки.
Любое сообщение родительскому окну, заданное число раз, в обход библиотеки. Ответы портала видны в Events и в блоке Status (Tokens received).
Страница-ловушка сама шлёт порталу host-ready-request и token-request (pluginId qa-labs-plugin) и показывает всё, что ей пришло. Окно-двойник и вложенный фрейм-двойник — с домена QP, ловушка — с другого домена.
token-request порталу один за другим: следующий — после ответа на предыдущий или по истечении ожидания. Ответы портала на его запрос /labs/tokens/ (200, 429 и Retry-After) видны в сети страницы портала.
Открываются отдельной вкладкой, на домене QP.
… (TC-97)Nothing yet.