@scalio-cloud/ui 0.102.0 → 0.104.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,7 +42,11 @@ Classes like `bg-primary`, `rounded-sm`, `font-display` keep working unchanged.
42
42
  ## Security headers for nginx (from 0.36.0)
43
43
 
44
44
  `nginx/security-headers.conf` holds the security headers of every Scalio app (security review M6): `nosniff`,
45
- framing only by the own origin, no plugins, `Referrer-Policy`, no camera/microphone/location. No script policy.
45
+ framing only by the own origin, no plugins, `Referrer-Policy`, no camera/microphone/location. From 0.104.0 also HSTS
46
+ (one year, `includeSubDomains`) and a Content-Security-Policy (BL-1080): scripts only from the own origin (no inline
47
+ script, no `eval`), inline styles allowed, images also `data:`, `blob:` and HTTPS, fonts `data:`, connections to
48
+ HTTPS/WSS. The file explains every exception. An app that needs more (another script host, `eval`) must say so
49
+ before it upgrades; test the upgrade on dev with the browser console open (CSP errors show there).
46
50
  Copy it in the nginx stage of the frontend Dockerfile and include it in the server block and in every `location`
47
51
  that has its own `add_header` (nginx drops the server-level lines there):
48
52
 
@@ -1,9 +1,27 @@
1
- # Security headers for every Scalio app (security review M6). Shipped in @scalio-cloud/ui, copied by each app's
2
- # Dockerfile to /etc/nginx/snippets/. Include it in the server block AND in every location that has its own
1
+ # Security headers for every Scalio app (security review M6, BL-1080). Shipped in @scalio-cloud/ui, copied by each
2
+ # app's Dockerfile to /etc/nginx/snippets/. Include it in the server block AND in every location that has its own
3
3
  # add_header: nginx drops the server-level add_header lines in such a location.
4
- # No script policy here (an app could break); framing only by the own origin (Nexus frames its own pages).
4
+ #
5
+ # HSTS: one year, subdomains included, no preload (preload cannot be undone quickly). Browsers ignore it over plain
6
+ # HTTP, so an instance without TLS keeps working.
7
+ #
8
+ # Content-Security-Policy, what each part allows and why:
9
+ # default-src 'self' everything else only from the own origin
10
+ # script-src 'self' only the app's own bundles: no inline script, no eval (index.html has none)
11
+ # style-src 'self' 'unsafe-inline' sonner, Radix, Recharts, Quill and the access page set inline styles
12
+ # img-src 'self' data: blob: https: icons as data: URIs (Vite inlines small files), previews from blob: URLs,
13
+ # images in user content (Folio pages, Nexus) may come from any HTTPS address
14
+ # font-src 'self' data: self-hosted fonts (fonts.css), small fonts inlined by the build
15
+ # connect-src 'self' https: wss: API and the Folio live room (same origin); https:/wss: until every app is
16
+ # checked for browser calls to other hosts (Nexus, Kontor), then tighten to 'self'
17
+ # frame-src 'self' blob: Nexus frames its own pages; previews of a downloaded file
18
+ # worker-src 'self' blob: workers of editor libraries
19
+ # frame-ancestors 'self' framing only by the own origin (same as X-Frame-Options)
20
+ # object-src 'none'; base-uri 'self' no plugins, no <base> from injected markup
21
+ # No form-action: the Microsoft sign-in leaves by redirect, and Chrome checks form-action on redirects as well.
22
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
5
23
  add_header X-Content-Type-Options "nosniff" always;
6
24
  add_header X-Frame-Options "SAMEORIGIN" always;
7
- add_header Content-Security-Policy "frame-ancestors 'self'; object-src 'none'; base-uri 'self'" always;
25
+ add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; connect-src 'self' https: wss:; frame-src 'self' blob:; worker-src 'self' blob:; frame-ancestors 'self'; object-src 'none'; base-uri 'self'" always;
8
26
  add_header Referrer-Policy "strict-origin-when-cross-origin" always;
9
27
  add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()" always;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.102.0",
3
+ "version": "0.104.0",
4
4
  "description": "Scalio Control Room design tokens, Tailwind preset, self-hosted fonts, the shared app header, sign-in layout, sidebar and page blocks",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "private": false,
package/react/mail.js CHANGED
@@ -304,8 +304,9 @@ function select(id, value, options, onChange, extra) {
304
304
  // list the provider `default` («Vorgabe verwenden») and send `default` {available, source, provider, from_name,
305
305
  // from_address, tenant_id, smtp_host}: the page shows where the default comes from and where mails go.
306
306
  // With scalio-platform 0.45.0 the status names a `reason` when the app can not set the send right itself: the button
307
- // «Senderecht setzen» stays visible but greyed out with that reason (grantOffHint {read_only, no_exchange, identity}:
308
- // the app's own texts, e.g. Citadel «Mit Scalio Schreiben setzt Citadel das Senderecht selbst»).
307
+ // page shows only that reason next to the script, without the button «Senderecht setzen» (0.103.0; before it was greyed
308
+ // out) (grantOffHint {read_only, no_exchange, identity}: the app's own texts, e.g. Citadel «Mit Scalio Schreiben setzt
309
+ // Citadel das Senderecht selbst»).
309
310
  // With scalio-platform 0.60.0 settings and the test mail answer carry from_name_applies, from_name_hint and
310
311
  // from_name_hint_de: when applies is false (e.g. Microsoft 365 sends with the mailbox's display name) the sender name
311
312
  // has no effect; the field is locked and the hint shown, but only for the ways graph, tenant and default (never for SMTP). Without these fields (older backends) nothing changes.
@@ -611,12 +612,13 @@ function MailTransport(props) {
611
612
  );
612
613
 
613
614
  const auto = !!(rightsInfo && rightsInfo.mode === "auto" && client.grantRights);
614
- // The button «Senderecht setzen» is there in every app (like Foundry); greyed out with the reason where the app's
615
- // own connection may not set it (scalio-platform 0.45.0 `reason`). Not for an own app registration (provider graph).
615
+ // The button «Senderecht setzen» only where the app can set the right (mode auto); where the app's own connection
616
+ // may not (scalio-platform 0.45.0 `reason`) only the reason is shown, next to the script (0.103.0).
616
617
  const offReason = rightsInfo && rightsInfo.mode === "script" && L.grantOff[rightsInfo.reason] ? rightsInfo.reason : "";
617
618
  const rightsOk = !!(rightsInfo && rightsInfo.state === "ok");
618
- // Nothing to do once the right is there: no greyed-out «Senderecht setzen» next to «Senderecht vorhanden».
619
- const showGrant = auto || (!rightsOk && !!offReason && !!client.grantRights);
619
+ // Nothing to do once the right is there: no reason next to «Senderecht vorhanden».
620
+ const showOff = !rightsOk && !!offReason;
621
+ const showGrant = auto || (wasBlocked && !!client.grantRights && !offReason);
620
622
  const rightsKnown = !!(rightsInfo && (rightsInfo.state === "ok" || rightsInfo.state === "missing"));
621
623
  const rights = form.send_rights && (form.provider === "graph" || form.provider === "tenant" || form.provider === "default")
622
624
  ? h(
@@ -647,15 +649,14 @@ function MailTransport(props) {
647
649
  rightsInfo && rightsInfo.detail && !rightsOk
648
650
  ? h("p", { className: "scalio-settings-help is-error", "data-testid": "mail-rights-detail" }, rightsInfo.detail)
649
651
  : null,
650
- showGrant || (wasBlocked && client.grantRights)
652
+ showOff
653
+ ? h("p", { className: "scalio-settings-help", "data-testid": "mail-rights-grant-off" },
654
+ (props.grantOffHint && props.grantOffHint[offReason]) || L.grantOff[offReason])
655
+ : null,
656
+ showGrant
651
657
  ? h("div", { className: "scalio-settings-section-footer" },
652
- offReason
653
- ? h("p", { className: "scalio-settings-help", "data-testid": "mail-rights-grant-off" },
654
- (props.grantOffHint && props.grantOffHint[offReason]) || L.grantOff[offReason])
655
- : null,
656
658
  h("button", { type: "button", className: "scalio-btn is-primary", onClick: grant, disabled: granting || !auto || blocked,
657
- title: offReason ? ((props.grantOffHint && props.grantOffHint[offReason]) || L.grantOff[offReason]) : (blocked ? L.exchangeUnreachable : undefined),
658
- "data-testid": "mail-rights-grant" },
659
+ title: blocked ? L.exchangeUnreachable : undefined, "data-testid": "mail-rights-grant" },
659
660
  h(Icons.Check, { className: "scalio-icon" }), L.autoGrant))
660
661
  : null,
661
662
  script