Skip to content

Commit 5f1bb2b

Browse files
committed
Refine plugin documentation for clarity and completeness, including YAML configuration and token handling details.
1 parent 64274a8 commit 5f1bb2b

File tree

1 file changed

+50
-5
lines changed

1 file changed

+50
-5
lines changed

docs/quix-cloud/managed-services/plugin.md

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
The plugin system enables services to expose an embedded UI inside Deployment Details (rendered as an iframe), and optionally add a shortcut in the environment’s left sidebar.
44

5-
Managed services could (or could not) populate these plugin properties automatically via the Managed Framework. You can always override them explicitly via YAML if needed.
5+
Managed services may populate these plugin properties automatically via the Managed Framework, and you can always override them explicitly in YAML.
66

7-
Non‑managed services can also define these properties in YAML, making any deployment of your pipeline behave like a plugin without being a managed service.
7+
Non‑managed services can also define these properties in YAML, making any deployment behave like a plugin without being a managed service.
88

99
## What it does
1010

@@ -18,7 +18,7 @@ Non‑managed services can also define these properties in YAML, making any depl
1818

1919
- Provide basic authentication integration with Quix Cloud so publicly exposed services don’t require a separate login
2020

21-
## YAML
21+
## YAML configuration
2222

2323
In your deployment YAML, you can enable the embedded UI and, optionally, a sidebar item:
2424

@@ -39,15 +39,60 @@ Notes
3939
4040
## Embedded view URL
4141
42-
When the plugin feature is enabled, the deployment exposes a public URL dedicated to the embedded UI. The Portal uses this URL to load the embedded view inside the iframe when `embeddedView` is enabled.
42+
When the plugin feature is enabled, the deployment exposes a public URL dedicated to the embedded UI. The Portal uses this URL to load the embedded view inside the iframe when `embeddedView` is enabled. This URL is not set in YAML; it’s exposed by the API.
4343

4444
Population rules:
4545

4646
- Managed service → Derived from Managed Services conventions.
47-
- Non‑managed service → The `publicAccess` configuration needs to be enabled.
47+
- Non‑managed service → Requires `publicAccess` to be enabled; resolves from the deployment’s public URL.
4848

4949
## Authentication and authorization
5050

5151
The embedded view inherits authentication and authorization from the Quix platform: no separate login is required, and the same user/environment permissions apply.
5252
When an embedded view loads, the Plugin system injects the Quix user token into the iframe. The UI uses this token to call the backend securely.
5353

54+
### How the token is injected in the embedded view
55+
56+
On initial load of the embedded view (and on reload), the Portal provides the user token to the iframe so the UI can authenticate calls to the backend.
57+
58+
### How to handle the token in the backend
59+
60+
Install the Quix Portal helper package from the public feed:
61+
62+
```bash
63+
pip install -i https://pkgs.dev.azure.com/quix-analytics/53f7fe95-59fe-4307-b479-2473b96de6d1/_packaging/public/pypi/simple/ quixportal
64+
```
65+
66+
Then, in the backend service, validate the token and enforce authorization for each request. For example:
67+
68+
```python
69+
70+
import os
71+
72+
from quixportal.auth import Auth
73+
74+
# Instantiate authentication client. By default it will read
75+
# the portal API url from the environment variable Quix__Portal__Api
76+
auth = Auth()
77+
78+
# Obtain the authorization token, traditionally passed as a header
79+
# Authorization: Bearer <token>
80+
token = ...
81+
82+
# Example to obtain "Read" access to the "Workspace" resource
83+
resource_type = "Workspace"
84+
workspace_id = os.environ["Quix__Workspace__Id"]
85+
permissions = "Read"
86+
87+
# Authorize the token bearer to access the resource
88+
if auth.validate_permissions(
89+
token=token,
90+
resourceType=resource_type,
91+
resourceID=workspace_id,
92+
permissions=permissions,
93+
):
94+
print("Bearer is authorized to access the resource")
95+
else:
96+
print("Bearer is not authorized to access the resource")
97+
98+
```

0 commit comments

Comments
 (0)