@xignet/payload 0.1.0-beta.0 → 0.1.0-beta.1
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 +7 -1
- package/dist/next.js +11 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @xignet/payload
|
|
2
2
|
|
|
3
|
-
Xignet resource authorization for Payload v3. The adapter uses the official MCP plugin and applies token scopes together with existing Payload collection, document and field access. This
|
|
3
|
+
Xignet resource authorization for Payload v3. The adapter uses the official MCP plugin and applies token scopes together with existing Payload collection, document and field access. This is a preview SDK with MCP and native-session OIDC support; website rollout and final delivery verification remain in progress under the [implementation plan](../../docs/architecture/core-payload-implementation-plan.md).
|
|
4
4
|
|
|
5
5
|
The current test baseline is Payload and `@payloadcms/plugin-mcp` **3.93.0**. No broad v3 or v4 compatibility is declared. The upstream plugin currently resolves `mcp-handler` 1.1.0 with SDK 1.30.0 despite that handler declaring SDK 1.26.0 as its exact peer; the workspace explicitly acknowledges this one tested combination using pnpm.peerDependencyRules.allowedVersions. Strict-peer pnpm consumers must apply the same narrow rule. This does not permit any other SDK version. Do not infer compatibility with other versions from these fixture results.
|
|
6
6
|
|
|
@@ -92,6 +92,8 @@ const handlers = createXignetRouteHandlers(xignet, {
|
|
|
92
92
|
|
|
93
93
|
Provide the app's actual Payload instance lazily. SSO-enabled route factories require this provider. SSO requires the native local auth strategy and `useSessions`; MCP-only consumers may use other auth models. The adapter invokes beforeLogin/afterLogin hooks and composes existing refresh hooks. These HTTP login routes return redirects or generic error responses with no token body.
|
|
94
94
|
|
|
95
|
+
Next standalone can expose its internal hostname and port in `Request.url`. The Next callback handler uses the trusted Payload `serverURL` as its public origin while retaining the incoming path and query for OIDC validation. Configure `serverURL` to the canonical CMS origin; Host and forwarded-host headers never select that origin. Direct `integration.callback` callers must supply the canonical public request URL themselves.
|
|
96
|
+
|
|
95
97
|
The plugin adds the private `xignet-sessions` collection even while login is disabled. Include it and the official MCP key collection in database migrations. It stores native SID linkage, absolute expiry and the verified access-token identity from login; it never stores the raw access/ID/refresh token. Metadata is not readable/writable through REST/MCP, including by ordinary admin accounts. The project remains responsible for approved `(issuer, subject)` bindings and local roles.
|
|
96
98
|
|
|
97
99
|
`resolveUser` receives `channel: 'session'` during subsequent SSO authentication and refresh. This is the historical verified identity stored at login, not a newly verified OAuth token: its OAuth expiry may have elapsed. Resolve current local binding/enablement and roles without treating that historical expiry as the browser session expiry. No Xignet network call is required on each native session request.
|
|
@@ -111,3 +113,7 @@ RPC audit events use the server-generated request ID, principal, allowlisted met
|
|
|
111
113
|
The database adapter must provide read-after-write consistency for login session records. Before issuing the browser cookie, the callback confirms the native SID and private metadata with fresh reads outside the completed transaction, since some adapter commit helpers can suppress an underlying transaction failure. A missing record refuses login instead of issuing an unusable cookie.
|
|
112
114
|
|
|
113
115
|
For staged rollout, configure the final collection/global policies once and set `mcp.writesEnabled: false` to hide and deny create/update while retaining the same schema. Set it to true after write/publish validation; omission preserves the default of enabling configured operations. `mcp.enabled` and `login.enabled` also retain their private collections when disabled.
|
|
116
|
+
|
|
117
|
+
## Reusing the adapter
|
|
118
|
+
|
|
119
|
+
Each CMS supplies its own canonical resource/serverURL, web client, secrets, auth collection, local resolver and collection/global policies. Keep project binding and role rules in that resolver and call `revokeUserSessions` from local lifecycle hooks; mount the shared Next handlers rather than copying the OIDC flow. Tests cover a second CMS profile with a `members` auth collection, separate origin/client/admission scope, native login, refresh and revocation. This fixture verifies configurable reuse; it is not a claim that a second production project has been deployed.
|
package/dist/next.js
CHANGED
|
@@ -8,7 +8,17 @@ export function createXignetRouteHandlers(integration, options) {
|
|
|
8
8
|
callback: async (request) => {
|
|
9
9
|
if (!integration.loginEnabled || !options)
|
|
10
10
|
return new Response(null, { status: 404 });
|
|
11
|
-
|
|
11
|
+
const payload = await options.getPayload();
|
|
12
|
+
if (!payload.config.serverURL)
|
|
13
|
+
return integration.callback(request, payload);
|
|
14
|
+
// Standalone Next requests may use an internal hostname and port.
|
|
15
|
+
// Only configured serverURL supplies the public origin, never headers.
|
|
16
|
+
const incoming = new URL(request.url);
|
|
17
|
+
const callback = new URL(payload.config.serverURL);
|
|
18
|
+
callback.pathname = incoming.pathname;
|
|
19
|
+
callback.search = incoming.search;
|
|
20
|
+
callback.hash = incoming.hash;
|
|
21
|
+
return integration.callback(new Request(callback, request), payload);
|
|
12
22
|
},
|
|
13
23
|
};
|
|
14
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xignet/payload",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Xignet OAuth resource and OIDC integration for Payload v3.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"jose": "^5.10.0",
|
|
33
|
-
"@xignet/core": "^0.1.0-beta.
|
|
33
|
+
"@xignet/core": "^0.1.0-beta.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"payload": "3.93.0",
|