Security model¶
This page describes who can install applications, whose permissions views and server scripts run with, and what application authors must take care of.
Installation is an administrative act¶
Only users with Global Administration rights see the Applications topic and can upload, update or delete applications. There is no per-project installation and no self-service for end users.
Uploading an application means trusting its author: the static files are served to every user who opens a view, and server scripts run on the Polarion server with the Java API available. Treat an application ZIP like any other software you deploy: review it, keep the SHA-2 hash shown during upload with your change records, and only install packages from sources you trust.
Views run in the user's browser as the user¶
A view is a web page inside Polarion's origin and receives a REST token in the context for the logged-in user. Calls from the view to the REST API and application endpoints must send this token in the X-Polarion-REST-Token header. The token identifies the user, and calls are subject to that user's permissions, workflow rules and license. A view cannot escalate privileges.
Application endpoints do not authenticate requests through the browser session or session cookies. Being logged in to Polarion does not remove the token-header requirement, for either GET or POST requests.
Consequences for authors:
- Do not assume write access. A user who may read a work item may not be allowed to change it; handle HTTP 403 gracefully.
- Keep the token in memory only. Do not write it to
localStorage, cookies, logs or analytics, and do not send it to any host other than the Polarion server. - Call
fetchContext()again if a call fails with 401; tokens are bound to the session.
Server scripts run on the server as the user¶
A server script executes with the identity of the user identified by the endpoint request's REST token. context.scriptContext().services().security() reports that user, and all tracker operations check permissions as usual. A script therefore cannot read data the user could not read in the UI.
Scripts do have server-side capabilities that the browser does not: HTTP access from the server, reading project vault secrets, and the whole Java API. Review scripts carefully for:
- Unvalidated input: everything in
argumentscomes from the browser. Validate ids and lengths, and never build queries or Java calls from raw strings without checking them. - Side effects on GET: GET endpoints should not modify data. Use POST for anything that saves.
- Secrets: keep webhook URLs and API keys in the user account vault and read them in the script; never ship them in the ZIP.
Same-origin, iframe isolation¶
Views are served from the Polarion origin, so the browser's same-origin policy does not separate the view from the host page. Polarion isolates the view in an iframe and defines a narrow message protocol (the host bridge). Stay within that protocol through the SDK; do not reach into window.parent to read or modify the Polarion UI. Such code breaks with every Polarion release and bypasses the design that keeps applications supportable.
The SDK verifies the origin of every message it receives and ignores messages from other origins.
Content Security Policy and external resources¶
Polarion serves application files with the same HTTP headers as its own UI. If your server enforces a Content Security Policy that blocks external scripts or styles, a view that loads libraries from a public CDN is expected to fail (check the browser console for Refused to load); this was not exercised in this guide. Bundle everything with Vite instead of loading from CDNs; that also avoids the dependency on internet access from the user's browser.
Calls from a view to other origins are subject to CORS on that origin. If your application needs an external service, call it from a server script or make sure the service allows the Polarion origin.
Data protection¶
Views see personal data (user names, assignees, comments) exactly as the user does. Do not send Polarion data to third-party services from the browser without the same approval you would need for any other integration. Server scripts that forward data (for example to a chat tool) should be limited to what the use case needs.
Checklist for application authors¶
- No credentials, tokens or secrets in the package.
- Token only used for
restBaseUrlandappEndpoint. - All HTTP errors handled; 401 and 403 produce a helpful message.
- Server scripts validate their inputs and keep writes on POST.
- No access to
window.parentoutside the SDK. - Dependencies bundled, no runtime CDN loads.
-
applicationVersionbumped and SHA-2 hash recorded for every release. - Tested with a project user without administrator rights: panels and sidebars visible, 403 handled where writes are not allowed.