@adonis-agora/agent 0.25.4 → 0.26.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/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @adonis-agora/agent
2
2
 
3
+ ## 0.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#90](https://github.com/DavideCarvalho/adonis-agora-agent/pull/90) [`c540ed5`](https://github.com/DavideCarvalho/adonis-agora-agent/commit/c540ed5884d8dc2ad4a22c0f29f9ec9c68ace6be) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Governance console: a refused request now gets a real page instead of `{"error":"forbidden"}`.
8
+
9
+ Opening the console without permission used to answer the browser with JSON. Both providers
10
+ (the embedded `@adonis-agora/agent/dashboard_provider` and the standalone
11
+ `@adonis-agora/agent-dashboard`) now serve a built-in access-denied page in the console's own
12
+ visual language — the status, a sentence explaining the refusal and a "Back to app" link.
13
+ Statuses are unchanged (`401` when no actor resolves, `403` when `authorize` denies), and a
14
+ redirect written by `onUnauthenticated`/`authorize` still wins.
15
+
16
+ The page carries no inline `<script>`, so a nonce'd `script-src` CSP cannot break it; its inline
17
+ `<style>` takes `@adonisjs/shield`'s request nonce when one exists.
18
+
19
+ New `dashboard.accessDenied` option on `config/agent.ts` to customise it — an object (`brand`,
20
+ `title`, `message`, `homeHref`, `accent`, labels) to tweak the built-in page, or a function
21
+ `(info, ctx) => html | void` to render it yourself or redirect. `@adonis-agora/agent/dashboard`
22
+ exports the shared `answerDashboardDenial` + `renderAccessDeniedPage`.
23
+
24
+ ## 0.25.5
25
+
26
+ ### Patch Changes
27
+
28
+ - [#86](https://github.com/DavideCarvalho/adonis-agora-agent/pull/86) [`98b9c4f`](https://github.com/DavideCarvalho/adonis-agora-agent/commit/98b9c4f97c1a04dd58bde67346cc194ef07a8e5f) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Dashboard: every API request 404 under a nonce CSP — fixed.
29
+
30
+ The providers used to hand the SPA the agent API base as an inline `<script>` setting
31
+ `window.__AGENT_DASHBOARD_BASE__`. A host with `script-src 'self' 'nonce-…'` (`@adonisjs/shield`'s
32
+ `@nonce`, the recommended setup) drops that script silently; the SPA then derived a base from its
33
+ own URL, which is right only for the default `<agent>/dashboard` mount, and on any other every
34
+ request from a console that rendered perfectly well answered 404. `injectApiBase` now emits a
35
+ `<script type="application/json">` data block, which is never executed and so cannot be refused,
36
+ and `resolveApiBase` reads it first (the global is still honoured after it). Nothing to change on
37
+ the host.
38
+
3
39
  ## 0.25.4
4
40
 
5
41
  ### Patch Changes