Labs Test 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: the scope of the plug-in has only GET /v2/projects(/.*)?

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 allows only GET; 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

Events

Nothing yet.