@aiquants/auth-react-router 0.26.0 → 0.28.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 +41 -1
- package/dist/admin.js +1 -1
- package/dist/admin.mjs +1 -1
- package/dist/styles/auth-react-router.standalone.css +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -183,8 +183,48 @@ export default () => <AuthUserAdminAppView basePath="/users" />
|
|
|
183
183
|
- **`guards` is mandatory** — this surface lists every user and mutates group membership, so an unguarded mount is an account-enumeration and privilege-escalation path. Allow by returning, deny by throwing (`Response` / `redirect` / `Error`); the return value is `void` by contract, so a predicate-style guard that returns `false` cannot silently fail open.
|
|
184
184
|
- **Per-operation authorization**: the guard receives the CRUD verb each intent actually performs (`read` / `create` / `update` / `delete`), so a principal holding only `update` cannot delete. Membership add/remove map to `create`/`delete` because they add and remove rows.
|
|
185
185
|
- Unknown intents reach neither the guard nor the store (the intent table is a `Map`, so prototype keys such as `constructor` do not resolve).
|
|
186
|
-
- Store errors (e.g. "cannot remove the last administrator") are returned as `{ ok: false, error }` and rendered by the views
|
|
186
|
+
- Store errors (e.g. "cannot remove the last administrator") are returned as `{ ok: false, error }` and rendered by the views.
|
|
187
|
+
- **Denials (`status: 403`) never surface as a 500.** A thrown value whose `status` is `403` is a denial, recognised by
|
|
188
|
+
that HTTP vocabulary alone (no authorization library is imported):
|
|
189
|
+
- the **loader** answers a denial that is not a `Response` with a 403 route error response,
|
|
190
|
+
`data(labels.errors.forbidden, { status: 403, statusText: "Forbidden" })`, after reporting it to `guards.onDenied`
|
|
191
|
+
(`intent: "loader"`, `actions: ["read"]`). React Router answers any other thrown value with 500 and, outside
|
|
192
|
+
development, replaces it with "Unexpected Server Error" before the route's `ErrorBoundary` sees it, so a plain
|
|
193
|
+
denial would reach the boundary looking like any other failure. A guard that throws a `Response` (a 403, a 401, a
|
|
194
|
+
redirect) and every other rejection propagate unchanged;
|
|
195
|
+
- the **action** answers a denial thrown by the guard or the store with an in-page
|
|
196
|
+
`{ ok: false, error: labels.errors.forbidden }` at status 403, so the other tabs and operations stay usable; any
|
|
197
|
+
other guard rejection propagates unchanged.
|
|
198
|
+
- Neither returns the guard's own message: it carries internal vocabulary (tenant ids, denial reasons).
|
|
187
199
|
- Labels default to **English** (`defaultUserAdminLabels`); inject `jaUserAdminLabels` or a partial override via `resolveUserAdminLabels`.
|
|
200
|
+
- **Every control is a 44 × 44 CSS px target under every pointer** (mouse, pen and touch alike; WCAG 2.2 SC 2.5.5,
|
|
201
|
+
AAA): the tabs, the sort buttons, the row actions, the links to a group's members, the search and form fields, the
|
|
202
|
+
selects, and every control of the dialogs. Where the control is drawn smaller than its target, the target is the
|
|
203
|
+
element around it: the label of the visually hidden "create from" radios and of the "members only" checkbox. The two
|
|
204
|
+
upstream-group pickers keep the 44 px targets of `@aiquants/select-box` itself. Rows grow to hold their actions; on
|
|
205
|
+
a narrow screen the toolbars and the tabs wrap, the tables scroll sideways, and a dialog taller than the screen
|
|
206
|
+
scrolls with its backdrop.
|
|
207
|
+
- **Text size**: the names of the row actions, of the links to a group's members and of the pressable "create from"
|
|
208
|
+
and "members only" labels are set in the `body` step (13 px on a 20 px line), and the permission badge of the header
|
|
209
|
+
and its pills in the `caption` step (11 px on a 20 px line); no text of the package is smaller than `caption`. A
|
|
210
|
+
size is always read together with its line height. A one-line name sits inside its 44 px target without changing
|
|
211
|
+
it; a name that wraps takes 20 px per line (the longer "create from" label wraps to two lines, a 54.8 px box). The
|
|
212
|
+
sizes are in rem, so they follow the browser's zoom and its root font-size setting. They are read from custom
|
|
213
|
+
properties with these defaults, which a host may bind once on `:root` (never declare them on an element inside the
|
|
214
|
+
screen: a declaration there wins over the host's binding):
|
|
215
|
+
|
|
216
|
+
| Custom property | Default | Read by |
|
|
217
|
+
| --- | --- | --- |
|
|
218
|
+
| `--aqau-font-size-body` | `0.8125rem` (13 px) | the names of the controls above |
|
|
219
|
+
| `--aqau-line-height-body` | `1.25rem` (20 px) | the same controls, together with the size |
|
|
220
|
+
| `--aqau-font-size-caption` | `0.6875rem` (11 px) | the permission badge of the header and its pills |
|
|
221
|
+
| `--aqau-line-height-caption` | `1.25rem` (20 px) | the same badge and pills, together with the size |
|
|
222
|
+
|
|
223
|
+
- **The group-members tab reflows without a media query** (WCAG 2.2 SC 1.4.10): the group list keeps a 240 px basis
|
|
224
|
+
and the member panel never takes less than half the row, so the two sit side by side from about 518 px
|
|
225
|
+
(`2 × (240 px + 1.2rem)`) and stack, each at the full width, below it. The heading, the action error and the
|
|
226
|
+
deep-link note are rows of the vertical stack outside the wrapping row, so they span the whole width in both
|
|
227
|
+
arrangements. Long addresses wrap inside a member row.
|
|
188
228
|
|
|
189
229
|
### Localization (`labels.locale` vs `labels.formatLocale`)
|
|
190
230
|
|