@adonis-agora/durable 0.27.0 → 0.29.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 +51 -0
- package/dist/assets/spa/assets/index-Db5aPtlJ.js +16 -0
- package/dist/assets/spa/assets/index-Db5aPtlJ.js.map +1 -0
- package/dist/assets/spa/index.html +1 -1
- package/dist/providers/dashboard_provider.d.ts +17 -15
- package/dist/providers/dashboard_provider.d.ts.map +1 -1
- package/dist/providers/dashboard_provider.js +100 -33
- package/dist/providers/dashboard_provider.js.map +1 -1
- package/dist/src/dashboard/access_denied_page.d.ts +102 -0
- package/dist/src/dashboard/access_denied_page.d.ts.map +1 -0
- package/dist/src/dashboard/access_denied_page.js +266 -0
- package/dist/src/dashboard/access_denied_page.js.map +1 -0
- package/dist/src/dashboard/compat-view.d.ts +1 -1
- package/dist/src/dashboard/compat-view.d.ts.map +1 -1
- package/dist/src/dashboard/compat-view.js +1 -1
- package/dist/src/dashboard/compat-view.js.map +1 -1
- package/dist/src/dashboard/define_config.d.ts +27 -0
- package/dist/src/dashboard/define_config.d.ts.map +1 -1
- package/dist/src/dashboard/define_config.js +1 -0
- package/dist/src/dashboard/define_config.js.map +1 -1
- package/dist/src/dashboard/handlers.d.ts +3 -3
- package/dist/src/dashboard/handlers.js +2 -2
- package/dist/src/dashboard/index.d.ts +4 -3
- package/dist/src/dashboard/index.d.ts.map +1 -1
- package/dist/src/dashboard/index.js +3 -2
- package/dist/src/dashboard/index.js.map +1 -1
- package/dist/src/dashboard/login_page.d.ts +23 -10
- package/dist/src/dashboard/login_page.d.ts.map +1 -1
- package/dist/src/dashboard/login_page.js +29 -41
- package/dist/src/dashboard/login_page.js.map +1 -1
- package/dist/src/dashboard/spa.d.ts +21 -4
- package/dist/src/dashboard/spa.d.ts.map +1 -1
- package/dist/src/dashboard/spa.js +19 -5
- package/dist/src/dashboard/spa.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/package.json +3 -3
- package/dist/assets/dashboard.html +0 -559
- package/dist/assets/spa/assets/index-CS0tc60i.js +0 -16
- package/dist/assets/spa/assets/index-CS0tc60i.js.map +0 -1
- package/dist/src/dashboard/html.d.ts +0 -7
- package/dist/src/dashboard/html.d.ts.map +0 -1
- package/dist/src/dashboard/html.js +0 -24
- package/dist/src/dashboard/html.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @adonis-agora/durable
|
|
2
2
|
|
|
3
|
+
## 0.29.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#88](https://github.com/DavideCarvalho/adonis-agora-durable/pull/88) [`8873c6b`](https://github.com/DavideCarvalho/adonis-agora-durable/commit/8873c6b9f0a8c6a90af046368b8aa6309a2c7ad6) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Dashboard: a refused page navigation now gets a real page instead of `{"error":"forbidden"}`.
|
|
8
|
+
|
|
9
|
+
Opening the console without permission used to answer the browser with the same JSON the API
|
|
10
|
+
gets. It now serves a built-in access-denied page in the console's own visual language — the
|
|
11
|
+
status, a sentence explaining the refusal, a "Back to app" link and, when `dashboardAuth.login`
|
|
12
|
+
is configured, a "Sign in" button. The Mode-A-only "Open this console from your application."
|
|
13
|
+
notice uses the same page. API requests are unchanged (the SPA still relies on their JSON), and
|
|
14
|
+
an `authorize` hook that redirects 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 `accessDenied` option on `config/durable_dashboard.ts` to customise it — an object
|
|
20
|
+
(`brand`, `title`, `message`, `homeHref`, `loginHref`, `accent`, labels) to tweak the built-in
|
|
21
|
+
page, or a function `(info, ctx) => html | void` to render it yourself or redirect.
|
|
22
|
+
|
|
23
|
+
Also: the built-in `dashboardAuth` login page no longer dies under a nonce'd CSP. It is now a real
|
|
24
|
+
HTML form that works without JavaScript — a form submit is answered with a redirect (to the page
|
|
25
|
+
the operator came from, or back to the form with the error shown) while the page's own `fetch`
|
|
26
|
+
keeps getting JSON — and its inline script/style carry `@adonisjs/shield`'s request nonce.
|
|
27
|
+
`renderLoginPage` takes an optional `{ nonce, error, returnTo }`.
|
|
28
|
+
|
|
29
|
+
## 0.28.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- [#84](https://github.com/DavideCarvalho/adonis-agora-durable/pull/84) [`5f8c6bd`](https://github.com/DavideCarvalho/adonis-agora-durable/commit/5f8c6bd7dbd9e9afd723ce5dd0a0f29a706059b2) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Remove the `GET <path>/legacy` route and the `renderDashboard` export behind it.
|
|
34
|
+
|
|
35
|
+
`/legacy` served the console as it was before the React SPA: one self-contained page whose whole
|
|
36
|
+
UI was an inline `<script>`. It was kept "for an environment where the SPA bundle cannot be
|
|
37
|
+
served", but it could not have worked under the CSP a shield-hardened host runs
|
|
38
|
+
(`script-src 'self' 'nonce-…'` drops that script whole, leaving a blank page behind a live,
|
|
39
|
+
guarded route). The JSON API it called is unchanged — `GET /api/health` in particular stays — so
|
|
40
|
+
a hand-written client keeps working; only the page is gone.
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- [#84](https://github.com/DavideCarvalho/adonis-agora-durable/pull/84) [`5f8c6bd`](https://github.com/DavideCarvalho/adonis-agora-durable/commit/5f8c6bd7dbd9e9afd723ce5dd0a0f29a706059b2) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Dashboard: every API request 404 under a nonce CSP — fixed.
|
|
45
|
+
|
|
46
|
+
The provider used to hand the SPA its mount/API base as an inline `<script>` setting
|
|
47
|
+
`window.__DURABLE_BASE__`/`__DURABLE_API__`. A host with `script-src 'self' 'nonce-…'`
|
|
48
|
+
(`@adonisjs/shield`'s `@nonce`, the recommended setup) drops that script silently; the SPA then fell
|
|
49
|
+
back to `/durable/api`, and on any other mount path every request from a console that rendered
|
|
50
|
+
perfectly well answered 404. The config now travels as a `<script type="application/json">` data
|
|
51
|
+
block, which is never executed and so cannot be refused. Nothing to change on the host; the globals
|
|
52
|
+
are still honoured as a fallback for tests and hand-embedding.
|
|
53
|
+
|
|
3
54
|
## 0.27.0
|
|
4
55
|
|
|
5
56
|
### Minor Changes
|