strapi-plugin-magic-sessionmanager 4.20.0 → 4.21.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 +14 -0
- package/README.md +58 -39
- package/dist/admin/{Analytics-B5GnwMtH.js → Analytics-BqdZIBV4.js} +1 -1
- package/dist/admin/{Analytics-B-MVQ6dQ.mjs → Analytics-C-OLLzoB.mjs} +1 -1
- package/dist/admin/{App-DzbP5VPQ.mjs → App-BswHmNQT.mjs} +338 -4
- package/dist/admin/{App-xBOmg4g9.js → App-Cx9v6n_7.js} +337 -3
- package/dist/admin/{OnlineUsersWidget-FuPPPCCV.js → OnlineUsersWidget-BRmQPPp9.js} +1 -1
- package/dist/admin/{OnlineUsersWidget-Bf3BICmx.mjs → OnlineUsersWidget-Dusgjc1d.mjs} +1 -1
- package/dist/admin/{Settings-WRIXHLDa.js → Settings-DWGuf_Z3.js} +17 -9
- package/dist/admin/{Settings-hpkloyO6.mjs → Settings-DZyQheUS.mjs} +17 -9
- package/dist/admin/{de-Uqb30N5n.js → de-24TPqzG6.js} +32 -1
- package/dist/admin/{de-Bzd14FzX.mjs → de-DUnrmFWk.mjs} +32 -1
- package/dist/admin/{en-CDBcocLk.js → en-8mBSkWOF.js} +32 -1
- package/dist/admin/{en-DovyVwa5.mjs → en-D8J__tyF.mjs} +32 -1
- package/dist/admin/{es-BygJxl1J.mjs → es-BgpgWdk0.mjs} +32 -1
- package/dist/admin/{es-DA1X0RPv.js → es-ChUKey-Q.js} +32 -1
- package/dist/admin/{fr-CPPA27jW.js → fr-DE_CWmgq.js} +32 -1
- package/dist/admin/{fr-DONxL73-.mjs → fr-k1MHYKJo.mjs} +32 -1
- package/dist/admin/{index-Q_D-5LlE.js → index-Ceh3Q1Ki.js} +20 -10
- package/dist/admin/{index-DsaGGK7x.mjs → index-meLDPPwt.mjs} +34 -24
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/{pt-BMuwyaan.js → pt-BjqU5ioB.js} +32 -1
- package/dist/admin/{pt-D2yGNz2N.mjs → pt-DPO4DmDc.mjs} +32 -1
- package/dist/admin/{settingsTabs--7IsqMdn.mjs → settingsTabs-C1q5iMMw.mjs} +1 -1
- package/dist/admin/{settingsTabs-Dxlevody.js → settingsTabs-CfquZuKH.js} +1 -1
- package/dist/server/index.js +496 -12
- package/dist/server/index.mjs +496 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [4.21.0](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.20.0...v4.21.0) (2026-11-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* View as admin, a read-only permission preview with anti-escalation rules ([#42](https://github.com/Schero94/Magic-Sessionmanager/issues/42)) ([687bc32](https://github.com/Schero94/Magic-Sessionmanager/commit/687bc32bd027d961b3c7c1bb3aeddcb184bee3f7))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Release type: minor (`feat`). Additive: one RBAC action (`impersonate.admins`, "View as admin") and two admin routes; no stored data changes.
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **View as admin (read-only permission preview).** A new row action **View as** in Session Manager › Admin panel (permission **View as admin**, `impersonate.admins`) shows, after a reason and a duration of 15 or 30 minutes, which content types and actions another admin can use, their roles and their other permissions, under a banner "You are viewing as … · read-only · ends in mm:ss · End". It creates no session and no token. Anti-escalation on the server: nobody views themselves, nobody views a Super Admin (Super Admins included), and a non-Super-Admin only views an admin whose effective permissions are a subset of their own, compared with Strapi's permission ceiling rules (a test checks parity with Strapi 5.63's `isPermissionWithinCeiling`). Strapi 5.63 offers no documented way to sign a browser in as another admin, so no admin session is created; README › View as admin explains why.
|
|
14
|
+
|
|
1
15
|
# [4.20.0](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.19.1...v4.20.0) (2026-11-25)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -764,48 +764,51 @@ The **Admin panel sessions** routes need two more permissions, which only the Su
|
|
|
764
764
|
| `plugin::magic-sessionmanager.settings.update` | Change protected settings (location lookup, webhooks, security log, sign-in policies) | Changing IP location lookup, provider, lookup failure mode and database file, team notification webhooks, the sign-in and session policies (lockout, trusted addresses, session limit, password-change sign-out, role rules), the signed webhook and its **Send test**, the event selection, impossible travel and shortened session IPs, and (with View admin activity) the security log settings. Since 4.17; Super Admin only by default |
|
|
765
765
|
| `plugin::magic-sessionmanager.lockouts.unlock` | Unlock locked sign-ins | **Unlock** in Login protection › Locked now (also needs `access`) |
|
|
766
766
|
| `plugin::magic-sessionmanager.impersonate.users` | Impersonate app users | Starting, listing and ending impersonations of app users (also needs `access` and the **Allow impersonation** switch); see [Impersonation](#impersonation). Since 4.20 |
|
|
767
|
+
| `plugin::magic-sessionmanager.impersonate.admins` | View as admin (read-only permission preview) | **View as** in the Admin panel view, and listing and ending such previews (also needs `access` and the switch); see [View as admin](#view-as-admin-read-only-permission-preview). Since 4.20 |
|
|
767
768
|
|
|
768
769
|
**What the admin panel view shows about other admins (4.17).** Names, emails and roles of admins are Strapi's own user data. The Admin panel view and the sign-in history return them only to roles that may also read them in Settings › Users: email and name need Strapi's **Read** permission on Users (`admin::users.read`), role names need it or **Read** on Roles (`admin::roles.read`). Without them the list shows "Admin #12", "Email hidden" and "Hidden" (roles), and the search matches the admin id only. Every admin always sees their own row. Grant `admin::users.read` to roles that should keep seeing names and emails.
|
|
769
770
|
|
|
770
771
|
**Protected settings (4.17).** `PUT /settings` still needs only `access`, so roles that change the session, login-protection, alert-email and retention options keep working. Changing a protected key needs **Change protected settings** as well, else 403 with `error.details.reason: "settings-update-permission"`: `enableGeolocation`, `geoIpProvider`, `geoLookupFailureMode`, `geoIpDatabasePath`, `enableWebhooks`, `discordWebhookUrl`, `slackWebhookUrl`, every security log key (those also keep needing **View admin activity**, reason `admin-activity-permission`) and the sign-in and session policy keys (`maxFailedLoginsPerAccount`, `lockoutWindowMinutes`, `lockoutDurationMinutes`, `lockoutTrustedAddresses`, `lockoutNotifyUser`, `recordUserSignInEvents`, `maxSessionsPerUser`, `sessionLimitPolicy`, `endOtherSessionsOnPasswordChange`, `roleRules`), and the detection and integration keys (`impossibleTravelEnabled`, `impossibleTravelSpeedKmh`, `impossibleTravelMinDistanceKm`, `impossibleTravelAction`, `webhookEvents`, `genericWebhookEnabled`, `genericWebhookUrl`, `genericWebhookSecret`, `sessionIpAnonymize`), and `impersonationEnabled` (4.20). The new-device and impossible-travel email switches stay with `access`, like the other alert emails. Sending a protected key back with its stored value is not a change, so these roles can still save the whole form. The admin UI shows these controls read-only for them.
|
|
771
772
|
|
|
772
|
-
| Method | Path | Admin UI action
|
|
773
|
-
| -------- | -------------------------------------------------------------- |
|
|
774
|
-
| GET | `/sessions` | Sessions dashboard: `?page=&pageSize=` (1-100), `status`, `reason`, `search`, `sort`; see below
|
|
775
|
-
| GET | `/sessions/active` | Active sessions only; same paging parameters
|
|
776
|
-
| GET | `/sessions/stats` | Dashboard cards and widget: counts only, cached 5 seconds per process
|
|
777
|
-
| GET | `/sessions/native-only/summary` | **Why?** on the untracked-session notice: counts only, no query parameters (400 otherwise)
|
|
778
|
-
| POST | `/sessions/native-only/end` | **End these sessions**: empty body; signed-in administrators only (admin API tokens get 403); 5 per minute
|
|
779
|
-
| GET | `/sessions/analytics` | Analytics page: counts and grouped counts over every session, cached 30 seconds
|
|
780
|
-
| GET | `/sessions/export` | Export batches of up to 1,000 rows, newest first; follow `meta.nextCursor`
|
|
781
|
-
| GET | `/user/:userId/sessions` | Sessions panel
|
|
782
|
-
| POST | `/sessions/:sessionId/terminate` | **End session** (reason `manual`; in refresh mode the Strapi session is revoked first; the record stays)
|
|
783
|
-
| DELETE | `/sessions/:sessionId` | **Delete record** (record removed, token stays revoked; an open session also ends)
|
|
784
|
-
| POST | `/sessions/clean-inactive` | **Delete ended sessions** (all users; open and idle sessions are not affected; does not run the idle check)
|
|
785
|
-
| POST | `/user/:userId/terminate-all` | **End all sessions** (reason `manual`)
|
|
786
|
-
| POST | `/user/:userId/toggle-block` | **Block user** / **Unblock user**
|
|
787
|
-
| GET | `/users/stats` | Widget totals (`totalUsers`, `blockedUsers`)
|
|
788
|
-
| GET | `/geolocation/:ipAddress` | **Look up location**
|
|
789
|
-
| GET | `/geoip/status` | GeoIP database status, plus `risk` (`available`, `source`, and per risk database `editionId`, `exists`, `usable`, `fromEnvironment`, `metadata`)
|
|
790
|
-
| PUT | `/geoip/credentials` | Save or remove (`{ "clear": true }`) MaxMind credentials
|
|
791
|
-
| POST | `/geoip/update` | Update database / Force download. Body `{ "force"?: boolean, "database"?: "location" \| "anonymous-ip" \| "asn" }` (default `location`; anything else is 400). A 401/403 from MaxMind answers 502 "MaxMind refused the download…"
|
|
792
|
-
| GET, PUT | `/settings` | Configuration (PUT validates every field and returns `error.details.errors` on invalid input). Webhook URLs are never returned: `hasDiscordWebhook`, `hasSlackWebhook` and a hint (`https://discord.com/…`); see below
|
|
793
|
-
| POST | `/sessions/:sessionId/simulate-timeout` | Development only; removed when `NODE_ENV` is `production` or `staging`
|
|
794
|
-
| GET | `/admin-sessions/admins` | Admin panel view: `?page=&pageSize=` (1-100), `search` (up to 100 characters, name or email; the admin id only without `admin::users.read`), `filter` (`all`, `signed-in`, `not-signed-in`); needs `admin-sessions.read`
|
|
795
|
-
| GET | `/admin-sessions/admins/:adminId/sessions` | **View sessions**: one entry per signed-in browser; needs `admin-sessions.read`
|
|
796
|
-
| POST | `/admin-sessions/admins/:adminId/sessions/:sessionId/sign-out` | **Sign out** one browser; needs `admin-sessions.revoke`; signed-in administrators only; 10 per minute
|
|
797
|
-
| POST | `/admin-sessions/admins/:adminId/sign-out-everywhere` | **Sign out everywhere**; needs `admin-sessions.revoke`; signed-in administrators only; 10 per minute
|
|
798
|
-
| GET | `/admin-activity/sign-ins` | **Sign-in history**, **Recent security activity** and the **Security activity** page: `adminId`, `event` (`all`, `succeeded`, `failed`, `signed-out`, `changes`), `from`, `to` (ISO dates), `page`, `pageSize` (1-100); needs `admin-activity.read`
|
|
799
|
-
| GET | `/admin-activity/sign-ins/export` | CSV export batches of 500 rows, newest first; same filters plus `cursor`; follow `meta.nextCursor`
|
|
800
|
-
| GET | `/admin-activity/content` | **Activity**: `adminId`, `action` (`all`, `view`, `create`, `update`, `publish`, `unpublish`, `discard`, `delete`, `clone`), `contentType` (uid), `from`, `to`, `page`, `pageSize`; needs `admin-activity.read`
|
|
801
|
-
| GET | `/admin-activity/content/export` | CSV export batches of 500 rows; same filters plus `cursor`
|
|
802
|
-
| GET | `/lockouts` | **Locked now**: `{ data: [{ id, kind: 'ip' \| 'account', ip, user, failures, lockedAt, until }] }`; read rate limit
|
|
803
|
-
| POST | `/lockouts/unlock` | **Unlock**: body `{ id }` from the list; needs `lockouts.unlock`; 404 when the lock already ended; 10 per minute
|
|
804
|
-
| GET | `/roles` | Users & Permissions roles (without Public) for **Different rules for some roles**
|
|
805
|
-
| GET | `/impersonation/status` | `{ data: { enabled, handoff: 'frontend' \| 'token', frontendOrigin, durations, mode } }`
|
|
806
|
-
| POST | `/impersonation/users/:userId` | **Start impersonation**: body `{ reason, durationMinutes: 15 \| 30 \| 60, notifyUser? }`; needs `impersonate.users`; signed-in admins only; 201 `{ data: { impersonation, handoff } }` (`Cache-Control: no-store`); 10 per 10 minutes
|
|
807
|
-
|
|
|
808
|
-
|
|
|
773
|
+
| Method | Path | Admin UI action |
|
|
774
|
+
| -------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
775
|
+
| GET | `/sessions` | Sessions dashboard: `?page=&pageSize=` (1-100), `status`, `reason`, `search`, `sort`; see below |
|
|
776
|
+
| GET | `/sessions/active` | Active sessions only; same paging parameters |
|
|
777
|
+
| GET | `/sessions/stats` | Dashboard cards and widget: counts only, cached 5 seconds per process |
|
|
778
|
+
| GET | `/sessions/native-only/summary` | **Why?** on the untracked-session notice: counts only, no query parameters (400 otherwise) |
|
|
779
|
+
| POST | `/sessions/native-only/end` | **End these sessions**: empty body; signed-in administrators only (admin API tokens get 403); 5 per minute |
|
|
780
|
+
| GET | `/sessions/analytics` | Analytics page: counts and grouped counts over every session, cached 30 seconds |
|
|
781
|
+
| GET | `/sessions/export` | Export batches of up to 1,000 rows, newest first; follow `meta.nextCursor` |
|
|
782
|
+
| GET | `/user/:userId/sessions` | Sessions panel |
|
|
783
|
+
| POST | `/sessions/:sessionId/terminate` | **End session** (reason `manual`; in refresh mode the Strapi session is revoked first; the record stays) |
|
|
784
|
+
| DELETE | `/sessions/:sessionId` | **Delete record** (record removed, token stays revoked; an open session also ends) |
|
|
785
|
+
| POST | `/sessions/clean-inactive` | **Delete ended sessions** (all users; open and idle sessions are not affected; does not run the idle check) |
|
|
786
|
+
| POST | `/user/:userId/terminate-all` | **End all sessions** (reason `manual`) |
|
|
787
|
+
| POST | `/user/:userId/toggle-block` | **Block user** / **Unblock user** |
|
|
788
|
+
| GET | `/users/stats` | Widget totals (`totalUsers`, `blockedUsers`) |
|
|
789
|
+
| GET | `/geolocation/:ipAddress` | **Look up location** |
|
|
790
|
+
| GET | `/geoip/status` | GeoIP database status, plus `risk` (`available`, `source`, and per risk database `editionId`, `exists`, `usable`, `fromEnvironment`, `metadata`) |
|
|
791
|
+
| PUT | `/geoip/credentials` | Save or remove (`{ "clear": true }`) MaxMind credentials |
|
|
792
|
+
| POST | `/geoip/update` | Update database / Force download. Body `{ "force"?: boolean, "database"?: "location" \| "anonymous-ip" \| "asn" }` (default `location`; anything else is 400). A 401/403 from MaxMind answers 502 "MaxMind refused the download…" |
|
|
793
|
+
| GET, PUT | `/settings` | Configuration (PUT validates every field and returns `error.details.errors` on invalid input). Webhook URLs are never returned: `hasDiscordWebhook`, `hasSlackWebhook` and a hint (`https://discord.com/…`); see below |
|
|
794
|
+
| POST | `/sessions/:sessionId/simulate-timeout` | Development only; removed when `NODE_ENV` is `production` or `staging` |
|
|
795
|
+
| GET | `/admin-sessions/admins` | Admin panel view: `?page=&pageSize=` (1-100), `search` (up to 100 characters, name or email; the admin id only without `admin::users.read`), `filter` (`all`, `signed-in`, `not-signed-in`); needs `admin-sessions.read` |
|
|
796
|
+
| GET | `/admin-sessions/admins/:adminId/sessions` | **View sessions**: one entry per signed-in browser; needs `admin-sessions.read` |
|
|
797
|
+
| POST | `/admin-sessions/admins/:adminId/sessions/:sessionId/sign-out` | **Sign out** one browser; needs `admin-sessions.revoke`; signed-in administrators only; 10 per minute |
|
|
798
|
+
| POST | `/admin-sessions/admins/:adminId/sign-out-everywhere` | **Sign out everywhere**; needs `admin-sessions.revoke`; signed-in administrators only; 10 per minute |
|
|
799
|
+
| GET | `/admin-activity/sign-ins` | **Sign-in history**, **Recent security activity** and the **Security activity** page: `adminId`, `event` (`all`, `succeeded`, `failed`, `signed-out`, `changes`), `from`, `to` (ISO dates), `page`, `pageSize` (1-100); needs `admin-activity.read` |
|
|
800
|
+
| GET | `/admin-activity/sign-ins/export` | CSV export batches of 500 rows, newest first; same filters plus `cursor`; follow `meta.nextCursor` |
|
|
801
|
+
| GET | `/admin-activity/content` | **Activity**: `adminId`, `action` (`all`, `view`, `create`, `update`, `publish`, `unpublish`, `discard`, `delete`, `clone`), `contentType` (uid), `from`, `to`, `page`, `pageSize`; needs `admin-activity.read` |
|
|
802
|
+
| GET | `/admin-activity/content/export` | CSV export batches of 500 rows; same filters plus `cursor` |
|
|
803
|
+
| GET | `/lockouts` | **Locked now**: `{ data: [{ id, kind: 'ip' \| 'account', ip, user, failures, lockedAt, until }] }`; read rate limit |
|
|
804
|
+
| POST | `/lockouts/unlock` | **Unlock**: body `{ id }` from the list; needs `lockouts.unlock`; 404 when the lock already ended; 10 per minute |
|
|
805
|
+
| GET | `/roles` | Users & Permissions roles (without Public) for **Different rules for some roles** |
|
|
806
|
+
| GET | `/impersonation/status` | `{ data: { enabled, handoff: 'frontend' \| 'token', frontendOrigin, durations, mode } }` |
|
|
807
|
+
| POST | `/impersonation/users/:userId` | **Start impersonation**: body `{ reason, durationMinutes: 15 \| 30 \| 60, notifyUser? }`; needs `impersonate.users`; signed-in admins only; 201 `{ data: { impersonation, handoff } }` (`Cache-Control: no-store`); 10 per 10 minutes |
|
|
808
|
+
| POST | `/impersonation/admins/:adminId/preview` | **View as**: body `{ reason, durationMinutes: 15 \| 30 }`; needs `impersonate.admins`; signed-in admins only; 201 `{ data: { impersonation, preview: { admin, contentTypes, otherPermissions } } }`; 403 `self`, `super-admin`, `not-subset`; 10 per 10 minutes |
|
|
809
|
+
| GET | `/impersonation/previews/:id` | The running preview, for the admin who started it; 404 otherwise or once it ended |
|
|
810
|
+
| GET | `/impersonation/active` | **Active impersonations**: `{ data: [{ id, targetType, targetId, targetLabel, actorId, actorLabel, startedByYou, reason, durationMinutes, handoff, credentialIssued, startedAt, expiresAt, state }] }`; app users with `impersonate.users`, admin previews with `impersonate.admins` |
|
|
811
|
+
| POST | `/impersonation/:id/end` | **End impersonation**: `{ data: { ended } }`; needs the impersonate permission of its kind; 404 for unknown ids |
|
|
809
812
|
|
|
810
813
|
**Session list parameters.** `page` (from 1), `pageSize` (1-100), `status` (`all`, `open`, `active`, `idle`, `ended`), `reason` (with `status=ended`: `logout`, `idle`, `expired`, `manual`, `blocked`, `unrecorded`), `search` (up to 100 characters; matches email, username, IP address, browser, operating system and device type) and `sort` (`loginTime:desc`, `loginTime:asc`, `lastActive:desc`, `lastActive:asc`). The response is `{ data, meta: { pagination: { page, pageSize, total, pageCount } } }` with exact totals. Unknown or out-of-range parameters return 400. Pages that start after the first 50,000 matching sessions return 400; narrow the filter or use the export, which walks every row with a cursor. Without `page` and `pageSize`, `GET /sessions` keeps the 4.x response (latest 1,000 rows, `meta.truncated`) for existing scripts.
|
|
811
814
|
|
|
@@ -1025,7 +1028,23 @@ body[data-impersonating]::before {
|
|
|
1025
1028
|
- What: a credential of the user's own permissions, never more; credential, account and session changes are refused.
|
|
1026
1029
|
- How long: at most 60 minutes, enforced server-side; codes 60 seconds and single use.
|
|
1027
1030
|
- Accountability: reason, duration, actor and target in the security log; optional email to the user.
|
|
1028
|
-
- Not covered: requests your own routes make on the user's behalf are not restricted unless they match the list above; review custom routes that change credentials or emails. Admins of the admin panel cannot be impersonated
|
|
1031
|
+
- Not covered: requests your own routes make on the user's behalf are not restricted unless they match the list above; review custom routes that change credentials or emails. Admins of the admin panel cannot be impersonated; see [View as admin](#view-as-admin-read-only-permission-preview).
|
|
1032
|
+
|
|
1033
|
+
### View as admin (read-only permission preview)
|
|
1034
|
+
|
|
1035
|
+
**What it does.** In Session Manager › Admin panel, the row action **View as** (the person icon next to **View sessions** and **Sign out everywhere**; on narrow screens a **View as** button) opens a dialog that asks for a reason and a duration (15 or 30 minutes) and then shows which content types that admin can open and with which actions (Create, Read, Update, Delete, Publish; "restricted" when fields, locales or conditions limit them), their roles and their other permissions, computed on the server from their role permissions with Strapi's permission service. A banner on top reads "You are viewing as … · read-only · ends in mm:ss · End". Nobody is signed in and nothing can be changed: the preview creates no session and no token, so read-only holds by construction. Closing the dialog, **End**, the end of the duration or turning the switch off ends it; it also shows in **Active impersonations** while it runs. Needs **View as admin (read-only permission preview)** (`plugin::magic-sessionmanager.impersonate.admins`) and the **Allow impersonation** switch.
|
|
1036
|
+
|
|
1037
|
+
**Anti-escalation (server-side).** Refused with 403 and `details.reason`:
|
|
1038
|
+
|
|
1039
|
+
- `self`: nobody views themselves;
|
|
1040
|
+
- `super-admin`: nobody views a Super Admin, Super Admins included;
|
|
1041
|
+
- `not-subset`: a non-Super-Admin views only an admin whose every effective permission they hold themselves (`details.uncovered` counts the others). The comparison follows Strapi's own permission ceiling rules: conditions are OR-ed, so a conditional permission does not cover an unconditional one; a property the holder does not restrict covers every value; a parent field covers its nested fields; unregistered conditions and, on localized types, missing locales are read the way the engine enforces them. A test compares it with Strapi 5.63's `isPermissionWithinCeiling` on more than 20,000 permission pairs;
|
|
1042
|
+
- `api-token`: admin API tokens cannot start one;
|
|
1043
|
+
- nesting is impossible: a preview creates no credential, and an app-user impersonation token cannot reach admin routes (401).
|
|
1044
|
+
|
|
1045
|
+
The preview is visible only to the admin who started it. Admin names in it and in the list need Strapi's **Read** permission on Users (`admin::users.read`), as in the Admin panel view.
|
|
1046
|
+
|
|
1047
|
+
**Why not a real admin session.** Strapi 5.63 has no impersonation in its admin, core, Users & Permissions or Content Manager packages, and no documented way for a plugin to sign a browser in as another admin. The server side would be possible (`strapi.sessionManager('admin').generateRefreshToken(adminId, deviceId, { metadata })`, and a global middleware could refuse every non-GET request of such a session). But the admin panel keeps its access token in internal storage (`localStorage.jwtToken` or a cookie whose name is built into the bundle) that no public admin API can set (`useAuth` only offers `login` with credentials), every open tab adopts a changed token, the admin panel has no global injection zone for a banner on every page (`admin.injectionZones` is empty and the plugin `initializer` unmounts once plugins are ready), and Strapi's `POST /admin/logout` without a device id deletes every session of the signed-in admin, which in an impersonated tab would be the other admin's sessions. Building on those internals could break with any Strapi update and could sign the real admin out or act with the wrong identity, so the plugin offers the honest preview instead. Content Manager activity is therefore never attributed to an impersonation (`meta.impersonatedBy` does not occur): a preview cannot do anything.
|
|
1029
1048
|
|
|
1030
1049
|
**Works councils and GDPR (information, not legal advice).** Acting as a user processes that user's personal data. A typical basis is a legitimate interest in support and in fixing faults (Art. 6(1)(f) GDPR) or the contract with the user; tell users in your privacy information (Art. 13) and consider turning on the email notice. The security log shows which admin did what and when; in Germany a technical system that can monitor employees' behaviour or performance is subject to the works council's co-determination (Section 87(1) no. 6 BetrVG), and comparable rules exist elsewhere. Agree the feature with the works council where there is one before you turn it on, keep the circle of roles small, and check whether a data protection impact assessment (Art. 35 GDPR) is needed.
|
|
1031
1050
|
|
|
@@ -1217,7 +1236,7 @@ The plugin sits in the request path of every authenticated Content API call, so
|
|
|
1217
1236
|
- **Reporting a vulnerability.** Please do not post exploit details in a public issue. Open an issue that asks for a private contact, or use the email address on the maintainer's GitHub profile, and you will get a reply before anything is published.
|
|
1218
1237
|
- **Secrets.** MaxMind license keys are never returned to the browser. Webhook URLs grant posting rights to your channel; treat them as secrets. Exports never contain tokens.
|
|
1219
1238
|
- **Admin panel sessions.** The Admin panel view reads Strapi's own `admin::session` records (origin `admin`). Only Super Admin can see or sign out admins until another role is granted `admin-sessions.read` / `admin-sessions.revoke`; a delegated role cannot sign out a Super Admin. Sign-outs need a signed-in administrator (not an admin API token), are rate limited and logged with admin ids and counts only.
|
|
1220
|
-
- **Impersonation.** Off by default; only roles with **Impersonate app users**, only signed-in admins, at most 60 minutes, credential and account changes refused, every start, end, expiry and refusal in the security log. Details: [Impersonation](#impersonation).
|
|
1239
|
+
- **Impersonation.** Off by default; only roles with **Impersonate app users**, only signed-in admins, at most 60 minutes, credential and account changes refused, every start, end, expiry and refusal in the security log. Admins are never impersonated; **View as** shows a read-only permission preview with anti-escalation rules. Details: [Impersonation](#impersonation).
|
|
1221
1240
|
- **Admin activity and sign-in history.** The plugin's security log stores admin sign-ins with IP address and user agent (on by default; IP anonymisation and retention configurable) and, only when you turn it on, Content Manager activity. Only Super Admin sees it until another role gets `admin-activity.read`. Typed emails of failed sign-ins, passwords and request bodies are never stored. Details and legal notes: [Admin activity and sign-in history](#admin-activity-and-sign-in-history).
|
|
1222
1241
|
|
|
1223
1242
|
---
|
|
@@ -9,7 +9,7 @@ const styled = require("styled-components");
|
|
|
9
9
|
const designSystem = require("@strapi/design-system");
|
|
10
10
|
const icons = require("@strapi/icons");
|
|
11
11
|
const symbols = require("@strapi/icons/symbols");
|
|
12
|
-
const index = require("./index-
|
|
12
|
+
const index = require("./index-Ceh3Q1Ki.js");
|
|
13
13
|
const SectionCard = require("./SectionCard-BlWv8CRt.js");
|
|
14
14
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
15
15
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
@@ -7,7 +7,7 @@ import styled from "styled-components";
|
|
|
7
7
|
import { Typography, Flex, LinkButton, Button, EmptyStateLayout, VisuallyHidden } from "@strapi/design-system";
|
|
8
8
|
import { ArrowClockwise, ChartBubble, User, Clock, Calendar } from "@strapi/icons";
|
|
9
9
|
import { EmptyDocuments } from "@strapi/icons/symbols";
|
|
10
|
-
import {
|
|
10
|
+
import { W as normalizeDeviceType, u as useSessionFormatters, f as pluginId, n as isCancelledRequest, l as logSafeAdminError, h as PersistentAlert, R as ReadableText, q as PageShell, r as StatGrid, s as StatCard, H as EqualGrid, b as getTranslation, X as getDeviceTypeMessage } from "./index-meLDPPwt.mjs";
|
|
11
11
|
import { S as SectionCard } from "./SectionCard-D51bv4Hi.mjs";
|
|
12
12
|
const ANALYTICS_UNKNOWN_KEY = "unknown";
|
|
13
13
|
const VERSION_TOKEN = /^v?\d[\w.]*$/i;
|