@aiquants/auth-react-router 0.26.0 → 0.27.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
@@ -183,8 +183,32 @@ 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; guard rejections propagate untouched.
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
+ - **The group-members tab reflows without a media query** (WCAG 2.2 SC 1.4.10): the group list keeps a 240 px basis
208
+ and the member panel never takes less than half the row, so the two sit side by side from about 518 px
209
+ (`2 × (240 px + 1.2rem)`) and stack, each at the full width, below it. The heading, the action error and the
210
+ deep-link note are rows of the vertical stack outside the wrapping row, so they span the whole width in both
211
+ arrangements. Long addresses wrap inside a member row.
188
212
 
189
213
  ### Localization (`labels.locale` vs `labels.formatLocale`)
190
214