strapi-oauth-mcp-manager 0.1.5 → 1.1.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 +56 -0
- package/LICENSE +21 -0
- package/README.md +334 -225
- package/dist/_chunks/App-BLcSXikb.mjs +425 -0
- package/dist/_chunks/App-CxPrn10p.js +425 -0
- package/dist/_chunks/{en-B4KWt_jN.js → en-Dw8Cn8uZ.js} +3 -1
- package/dist/_chunks/en-UyIAE3Kz.mjs +6 -0
- package/dist/_chunks/{index-DzBaU9Fw.mjs → index-B36PlzpY.mjs} +4 -3
- package/dist/_chunks/{index-B2ShbPnj.js → index-dzfso1OG.js} +4 -3
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +1842 -433
- package/dist/server/index.mjs +1843 -434
- package/dist/server/src/bootstrap.d.ts +1 -0
- package/dist/server/src/config/index.d.ts +48 -2
- package/dist/server/src/content-types/index.d.ts +65 -11
- package/dist/server/src/controllers/admin.d.ts +16 -0
- package/dist/server/src/controllers/index.d.ts +17 -1
- package/dist/server/src/controllers/oauth.d.ts +21 -19
- package/dist/server/src/destroy.d.ts +1 -4
- package/dist/server/src/identity/index.d.ts +8 -0
- package/dist/server/src/identity/line.d.ts +8 -0
- package/dist/server/src/identity/types.d.ts +15 -0
- package/dist/server/src/index.d.ts +200 -23
- package/dist/server/src/middlewares/index.d.ts +1 -1
- package/dist/server/src/middlewares/mcp-oauth.d.ts +10 -13
- package/dist/server/src/permissions.d.ts +3 -0
- package/dist/server/src/register.d.ts +1 -1
- package/dist/server/src/routes/admin/index.d.ts +13 -1
- package/dist/server/src/routes/index.d.ts +13 -1
- package/dist/server/src/services/index.d.ts +87 -3
- package/dist/server/src/services/oauth.d.ts +169 -13
- package/dist/server/src/utils/bearer.d.ts +2 -0
- package/dist/server/src/utils/crypto.d.ts +20 -0
- package/dist/server/src/utils/end-user.d.ts +25 -0
- package/dist/server/src/utils/oauth-error.d.ts +11 -0
- package/dist/server/src/utils/url.d.ts +32 -0
- package/dist/server/src/views/authorize-page.d.ts +31 -0
- package/package.json +29 -16
- package/dist/_chunks/App-CjW3NftW.mjs +0 -23
- package/dist/_chunks/App-DsMhfKkM.js +0 -23
- package/dist/_chunks/en-Byx4XI2L.mjs +0 -4
- package/dist/admin/src/utils/getTranslation.d.ts +0 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
Customer sign-in with LINE, for apps that expose MCP tools to their own users.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Token exchange (RFC 8693) at the token endpoint: a LINE client posts a customer's LINE ID token (`liff.getIDToken()`) and gets a short-lived MCP session. The session runs with the client's mapped admin token.
|
|
10
|
+
- `resolveSubject(authorization)` on the `oauth` service. Tool plugins pass the `Authorization` header their handler received and get the customer's `line:U…` subject, or `null` when there's no verified customer (staff sessions, plain admin tokens and anything invalid). Call it only from MCP tool handlers: it identifies the customer but doesn't authenticate the request.
|
|
11
|
+
- Configuration: `identityProviders.line.channelId` (digits only: the LINE Login channel ID, not the LIFF ID), the test-only `identityProviders.line.verifyUrl` (Strapi warns at startup while it's set), and `endUserAccessTokenTtl` (default 3600 seconds).
|
|
12
|
+
- "Customer sign-in" when adding a client on the **MCP OAuth** page, a Customer column in the sessions list (masked), and token exchange details under Connection details.
|
|
13
|
+
- Discovery lists the token exchange grant when LINE sign-in is configured.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- New fields: `endUserProvider` on clients (existing clients are staff clients), and `subject` on grants.
|
|
18
|
+
- LINE clients are always public, must keep a mapped admin token, and may have no redirect URI. Only one LINE client can be active at a time, and LINE clients can't use the consent page (`/authorize`).
|
|
19
|
+
- Customer sessions have no refresh token. They expire after `endUserAccessTokenTtl`, and the app exchanges a fresh ID token.
|
|
20
|
+
- Token exchange answers `invalid_grant` only when LINE rejects the ID token. When LINE can't be reached or the LINE client's admin token can't be used, it answers `temporarily_unavailable` (503) with `Retry-After`, and the Strapi log says why.
|
|
21
|
+
|
|
22
|
+
### Breaking changes
|
|
23
|
+
|
|
24
|
+
None. Staff sign-in, dynamic client registration, refresh rotation and revocation work as before.
|
|
25
|
+
|
|
26
|
+
## 1.0.0
|
|
27
|
+
|
|
28
|
+
A rewrite that adds OAuth sign-in to the MCP server built into Strapi 5.47+ (`/mcp`).
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- OAuth 2.1 authorization server for `/mcp`: protected resource metadata (RFC 9728), authorization server metadata (RFC 8414), dynamic client registration (RFC 7591), PKCE with S256 (RFC 7636), token revocation (RFC 7009) and refresh token rotation.
|
|
33
|
+
- Consent page where users sign in with their Strapi admin account and pick one of their own admin tokens. Each session gets exactly that token's permissions.
|
|
34
|
+
- Optional admin token mapping per client. A mapped client always uses its token, and only the token's owner can approve it.
|
|
35
|
+
- Optional "All of my permissions" access, behind `allowUserPermissions` (off by default).
|
|
36
|
+
- Revocation at every level: deactivating a user, deleting or regenerating a token, revoking a session, revoking all sessions for a user, turning off a client, or changing a client's mapped token.
|
|
37
|
+
- **MCP OAuth** admin page with connection details, connected sessions and client management, gated by the new **Manage MCP OAuth clients and grants** permission.
|
|
38
|
+
- Plugin configuration: `accessTokenTtl`, `refreshTokenTtl`, `authorizationCodeTtl`, `refreshTokenReuseWindow`, `dynamicClientRegistration`, `allowUserPermissions` and `cleanupIntervalMs`.
|
|
39
|
+
- Refresh token reuse detection: a rotated refresh token used again after `refreshTokenReuseWindow` (10 seconds) revokes the session. Rotation is atomic, so concurrent refreshes with one token can't both succeed.
|
|
40
|
+
- Warning when OAuth is served over plain `http` on a host other than `localhost`.
|
|
41
|
+
- Confirmation before deleting a client or revoking all of a user's sessions, and an error state with retry when the admin page can't load.
|
|
42
|
+
- End-to-end test suites (`npm run test:e2e`).
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- Discovery documents moved to the server root (`/.well-known/...`).
|
|
47
|
+
- OAuth codes and tokens are stored only as SHA-256 hashes.
|
|
48
|
+
- The OAuth client content type is no longer shown in the Content Manager.
|
|
49
|
+
|
|
50
|
+
### Breaking changes
|
|
51
|
+
|
|
52
|
+
- Requires Strapi 5.47.0 or later with `server.mcp.enabled: true`.
|
|
53
|
+
- Only `/mcp` is protected. Routes matching `/api/*/mcp` are no longer handled.
|
|
54
|
+
- The OAuth client, code and token tables changed. Existing tokens stop working, and clients reconnect through the consent page.
|
|
55
|
+
- The `strapiApiToken` field on clients is removed. Map an admin token to the client instead.
|
|
56
|
+
- The `/api/strapi-oauth-mcp-manager/.well-known/*` routes are removed.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Paul Bratslavsky
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|