@softistx/alxia-react-router 0.89.4 → 0.90.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 +31 -2
- package/dist/chunks/{index-1nw5yeek.js → index-qkyt0bka.js} +3 -3
- package/dist/chunks/{index-1nw5yeek.js.map → index-qkyt0bka.js.map} +1 -1
- package/dist/chunks/index-w61bjnkw.js +1019 -0
- package/dist/chunks/index-w61bjnkw.js.map +27 -0
- package/dist/clavix/api-url.d.ts +43 -0
- package/dist/clavix/api-url.d.ts.map +1 -0
- package/dist/clavix/client.d.ts +22 -0
- package/dist/clavix/client.d.ts.map +1 -0
- package/dist/clavix/core.d.ts +39 -0
- package/dist/clavix/core.d.ts.map +1 -0
- package/dist/clavix/env.d.ts +26 -0
- package/dist/clavix/env.d.ts.map +1 -0
- package/dist/clavix/index.d.ts +19 -0
- package/dist/clavix/index.d.ts.map +1 -0
- package/dist/clavix/index.js +673 -0
- package/dist/clavix/index.js.map +22 -0
- package/dist/clavix/landing.d.ts +67 -0
- package/dist/clavix/landing.d.ts.map +1 -0
- package/dist/clavix/messages.d.ts +53 -0
- package/dist/clavix/messages.d.ts.map +1 -0
- package/dist/clavix/notice.d.ts +32 -0
- package/dist/clavix/notice.d.ts.map +1 -0
- package/dist/clavix/refusal.d.ts +29 -0
- package/dist/clavix/refusal.d.ts.map +1 -0
- package/dist/clavix/relay.d.ts +41 -0
- package/dist/clavix/relay.d.ts.map +1 -0
- package/dist/clavix/routes.d.ts +5 -0
- package/dist/clavix/routes.d.ts.map +1 -0
- package/dist/clavix/send.d.ts +32 -0
- package/dist/clavix/send.d.ts.map +1 -0
- package/dist/clavix/state.d.ts +20 -0
- package/dist/clavix/state.d.ts.map +1 -0
- package/dist/clavix/types.d.ts +97 -0
- package/dist/clavix/types.d.ts.map +1 -0
- package/dist/clavix/viewer.d.ts +12 -0
- package/dist/clavix/viewer.d.ts.map +1 -0
- package/dist/fetcher/auth-refusal.d.ts +5 -1
- package/dist/fetcher/auth-refusal.d.ts.map +1 -1
- package/dist/fetcher/index.js +2 -5
- package/dist/fetcher/index.js.map +3 -3
- package/dist/oidc/index.js +23 -1025
- package/dist/oidc/index.js.map +3 -21
- package/dist/session/index.js +1 -1
- package/docs/README.md +2 -1
- package/docs/guide/clavix.md +332 -0
- package/docs/guide/fetcher.md +4 -0
- package/docs/guide/oidc.md +3 -0
- package/docs/roadmap.md +6 -0
- package/docs/troubleshooting.md +41 -0
- package/package.json +8 -2
package/docs/guide/fetcher.md
CHANGED
|
@@ -169,6 +169,10 @@ const onSubmit = async (values: { email: string; password: string }) => {
|
|
|
169
169
|
- Otherwise it returns `form` (from `formError`), `retryAfter`, and for each
|
|
170
170
|
name in `fields` the matching `fieldErrors` entry. The result is typed with
|
|
171
171
|
those names (`refusal.email`).
|
|
172
|
+
- When `retryAfter` is set, `form` is left out: material's auth forms treat
|
|
173
|
+
`form` as the reason and add their own live "Try again in {time}.", so
|
|
174
|
+
carrying the action's `formError` too would say the wait twice, with two
|
|
175
|
+
different values. A refusal without a wait keeps `form`.
|
|
172
176
|
- A field error whose name is not in `fields` is left out: list every field
|
|
173
177
|
the form shows.
|
|
174
178
|
- An answer with no `sent` and no message is still a refusal (all keys
|
package/docs/guide/oidc.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# A relying party of an external OpenID Connect issuer
|
|
2
2
|
|
|
3
|
+
> Signing in with Clavix? [`clavixRoutes`](clavix.md) is this client with PAR, DPoP, the
|
|
4
|
+
> sign-in, callback and sign-out routes and the refusal pages already set.
|
|
5
|
+
|
|
3
6
|
A BFF that signs its users in with an issuer it does not own (Keycloak,
|
|
4
7
|
Authentik, Google, Microsoft Entra, an in-house provider) is an OpenID
|
|
5
8
|
Connect *relying party*. The API's own sessions (`/session`) and a social
|
package/docs/roadmap.md
CHANGED
|
@@ -7,6 +7,12 @@ number on it. Every release, with each change it made, is in
|
|
|
7
7
|
|
|
8
8
|
## Now
|
|
9
9
|
|
|
10
|
+
- **`@softistx/alxia-react-router/clavix`: a BFF signing in with Clavix.**
|
|
11
|
+
`clavixRoutes` gives the sign-in, callback and sign-out routes over `/oidc`
|
|
12
|
+
(PAR, DPoP, a resource), provider-only by default, with the sign-in page's
|
|
13
|
+
landing and refusal notices, an internal-origin client and the `/media` and
|
|
14
|
+
`/live` relays. See the [Clavix guide](guide/clavix.md).
|
|
15
|
+
|
|
10
16
|
- **The client build, served compressed.** `react-router build` writes `.br`
|
|
11
17
|
and `.gz` copies beside the compressible files of `build/client`, and the
|
|
12
18
|
server sends the one a browser accepts, with `Vary: Accept-Encoding` and
|
package/docs/troubleshooting.md
CHANGED
|
@@ -4033,3 +4033,44 @@ default export, and the next open retries.
|
|
|
4033
4033
|
|
|
4034
4034
|
**Fix:** export the sheet as the module's default, taking `HelpPanelSheetProps`
|
|
4035
4035
|
(see the [lazy panel](guide/help.md#the-lazy-panel-helppanel)).
|
|
4036
|
+
|
|
4037
|
+
### `The OIDC environment is not usable:` (clavixRoutes)
|
|
4038
|
+
|
|
4039
|
+
`clavixRoutes` reads `CLAVIX_ISSUER`, `CLAVIX_CLIENT_ID`, the secrets
|
|
4040
|
+
(`CLAVIX_CLIENT_SECRET[_FILE]`, `CLAVIX_SESSION_SECRET[_FILE]`) and
|
|
4041
|
+
`CLAVIX_AUDIENCE` at boot (`await clavix.ready()`) or on the first request, and lists every problem
|
|
4042
|
+
in one `OidcEnvError` (`problems`). Set each variable it names; a `_FILE`
|
|
4043
|
+
secret must be readable by its owner only. A failed read is not cached: the
|
|
4044
|
+
next request reads again. See the [Clavix guide](guide/clavix.md#set-it-up).
|
|
4045
|
+
|
|
4046
|
+
### `clavixRoutes(): api.publicUrl is not an absolute URL.`
|
|
4047
|
+
|
|
4048
|
+
`api.publicUrl` (or `api.internalUrl`, named in the message) is not a URL
|
|
4049
|
+
`new URL()` reads. Give the address with its scheme, such as
|
|
4050
|
+
`https://api.example.com`. The same entry covers `api.publicUrl must be an
|
|
4051
|
+
http(s) URL with no query or fragment`: pass the origin and path only; the
|
|
4052
|
+
GraphQL path is `api.graphqlPath`.
|
|
4053
|
+
|
|
4054
|
+
### `clavixRoutes(): refusing to sign a call to … it is not api.publicUrl or api.internalUrl.`
|
|
4055
|
+
|
|
4056
|
+
`ClavixOriginError`: `sendOf` or a relay's `fetch` was given a URL outside the
|
|
4057
|
+
API's two addresses, and a DPoP-bound token never goes to another origin. Build
|
|
4058
|
+
the URL with `clavix.apiUrl(path)`, or fix `api.publicUrl` / `api.internalUrl`
|
|
4059
|
+
when the API really lives elsewhere (a media relay's `api` option must be the
|
|
4060
|
+
same address as `api.internalUrl`).
|
|
4061
|
+
|
|
4062
|
+
### `SessionExpired`, a 503 from the GraphQL client, or a 401 `session-expired`
|
|
4063
|
+
|
|
4064
|
+
The session ended and cannot be refreshed. `sendOf` throws `SessionExpired`
|
|
4065
|
+
whose `answer` is a redirect to sign-in for a GET and a 401 `{ "code":
|
|
4066
|
+
"session-expired" }` otherwise. A GraphQL client that turns every `fetch` error
|
|
4067
|
+
into a 503 hides it: read the viewer with `clavix.viewer(request, load)`, which
|
|
4068
|
+
throws the answer whatever the client did, or return `error.answer` from the
|
|
4069
|
+
loader. See [the guide](guide/clavix.md#the-viewer-without-the-plumbing).
|
|
4070
|
+
|
|
4071
|
+
### The sign-in page redirects straight to Clavix and never shows
|
|
4072
|
+
|
|
4073
|
+
That is the provider-only default: `clavix.landing` throws a redirect to the
|
|
4074
|
+
start route when it has nothing to say. It shows the page after a sign-out, a
|
|
4075
|
+
refused sign-in, an expired session, or with `otherMethods: true`. See
|
|
4076
|
+
[the sign-in page](guide/clavix.md#the-sign-in-page).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softistx/alxia-react-router",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "alxia as the server of a React Router framework app: server rendering behind the app's hooks, loaders reading its typed context, the client's assets served; the code with no UI an installable app shares (`/pwa`), its hooks (`/pwa/react`), `noCache` for the worker's script (`/pwa/server`), the service worker on Workbox (`/pwa/worker`) and its build (`/pwa/build`), an API's refusals worded for the page (`/errors`), the BFF session: cookies, sign-in, step-up and mail links (`/session`), its page hooks (`/session/react`) and what it shares with the page (`/session/model`), a GraphQL subscription relayed to the browser over SSE (`/subscription`) and kept alive in the page (`/subscription/react`), an API's MCP and OAuth endpoints relayed on the app's origin (`/mcp`), per-role flow docs, the help panel's data and its lazy `HelpPanel`, and the role guide's `useGuideRole` (`/help`, `/help/check`), an API's media files read and uploaded through the app (`/media`) and uploaded from the page with progress (`/media/client`), the page's CSP nonce and inline boot scripts (`/document`) and a streaming `entry.server` (`/entry`), the consent screen of an OAuth server: a route's loader and action, the connected apps' list and revoke (`/oauth`) and the decision hook (`/oauth/react`), a user's API keys listed, created behind a step-up and revoked (`/api-keys`) and `/oidc`: a relying party of an external OpenID Connect issuer (authorization code + PKCE, id token validation, a sealed token cookie, refresh and RP-initiated logout)",
|
|
3
|
+
"version": "0.90.0",
|
|
4
|
+
"description": "alxia as the server of a React Router framework app: server rendering behind the app's hooks, loaders reading its typed context, the client's assets served; the code with no UI an installable app shares (`/pwa`), its hooks (`/pwa/react`), `noCache` for the worker's script (`/pwa/server`), the service worker on Workbox (`/pwa/worker`) and its build (`/pwa/build`), an API's refusals worded for the page (`/errors`), the BFF session: cookies, sign-in, step-up and mail links (`/session`), its page hooks (`/session/react`) and what it shares with the page (`/session/model`), a GraphQL subscription relayed to the browser over SSE (`/subscription`) and kept alive in the page (`/subscription/react`), an API's MCP and OAuth endpoints relayed on the app's origin (`/mcp`), per-role flow docs, the help panel's data and its lazy `HelpPanel`, and the role guide's `useGuideRole` (`/help`, `/help/check`), an API's media files read and uploaded through the app (`/media`) and uploaded from the page with progress (`/media/client`), the page's CSP nonce and inline boot scripts (`/document`) and a streaming `entry.server` (`/entry`), the consent screen of an OAuth server: a route's loader and action, the connected apps' list and revoke (`/oauth`) and the decision hook (`/oauth/react`), a user's API keys listed, created behind a step-up and revoked (`/api-keys`) and `/oidc`: a relying party of an external OpenID Connect issuer (authorization code + PKCE, id token validation, a sealed token cookie, refresh and RP-initiated logout) and `/clavix`: a BFF that signs in with Clavix, provider-only by default (the routes, the sign-in page's decision, a DPoP `fetch` for the API and the relays)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -157,6 +157,11 @@
|
|
|
157
157
|
"import": "./dist/oidc/index.js",
|
|
158
158
|
"default": "./dist/oidc/index.js"
|
|
159
159
|
},
|
|
160
|
+
"./clavix": {
|
|
161
|
+
"types": "./dist/clavix/index.d.ts",
|
|
162
|
+
"import": "./dist/clavix/index.js",
|
|
163
|
+
"default": "./dist/clavix/index.js"
|
|
164
|
+
},
|
|
160
165
|
"./package.json": "./package.json"
|
|
161
166
|
},
|
|
162
167
|
"repository": {
|
|
@@ -195,6 +200,7 @@
|
|
|
195
200
|
"src/oauth/index.ts",
|
|
196
201
|
"src/oauth/react/index.ts",
|
|
197
202
|
"src/oidc/index.ts",
|
|
203
|
+
"src/clavix/index.ts",
|
|
198
204
|
"src/link/index.ts",
|
|
199
205
|
"src/fetcher/index.ts",
|
|
200
206
|
"src/document/index.ts",
|