@checkstack/catalog-common 2.3.2 → 2.3.4
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 +86 -0
- package/package.json +6 -6
- package/src/access.ts +44 -23
- package/src/slots.ts +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,91 @@
|
|
|
1
1
|
# @checkstack/catalog-common
|
|
2
2
|
|
|
3
|
+
## 2.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 56e7c75: Hide navigation, actions and links that the current user cannot use, so anonymous
|
|
8
|
+
and read-only users no longer see entries that lead to "Access Denied" or to
|
|
9
|
+
actions the server would reject.
|
|
10
|
+
|
|
11
|
+
- **Sidebar**: a nav entry can now declare a dynamic `nav.isVisible({ accessRules, isAuthenticated })` predicate (in addition to the static `accessRule`). A group whose every entry is filtered out is no longer rendered. The filtering/grouping logic is extracted to a pure, unit-tested helper.
|
|
12
|
+
- **Infrastructure**: its sidebar entry is shown only when the user can READ at least one contributed tab (queue, cache, …), instead of always (it previously had no static rule because tabs are contributed at runtime).
|
|
13
|
+
- **Notification Settings**: hidden from anonymous users - notifications are per-user, so an anonymous visitor can't have any.
|
|
14
|
+
- **Anomaly Mute / Suppress**: the "Mute" / "Mute all" controls (a per-user preference) are hidden from anonymous visitors; the "Suppress" control is gated on `anomalyAccess.feed.manage`. Both were previously always visible.
|
|
15
|
+
- **Dashboard**: the "Open Catalog" actions (which open the manage-only Catalog config page) are hidden from users without `catalogAccess.system.manage`, and the "View catalog" link is gated on `catalogAccess.system.read`.
|
|
16
|
+
- **Dashboard status signals**: the per-system status rows contributed by plugins (`SystemSignalsSlot`) now render as a LINK only when the user can open the target, and as plain text otherwise. `SystemSignal` gains an optional `accessRule`; the healthcheck, anomaly, and dependency fillers set it for their gated targets (check-history / assignments / dependency-map). Signals pointing at ungated pages (incident / maintenance / SLO detail) stay links.
|
|
17
|
+
- **Plugin Manager**: the "Install plugin" button (which opens the install-gated page) is hidden from users with only `plugin` view access.
|
|
18
|
+
- **Satellites**: the page is entirely manage-gated, but its route/sidebar entry was gated on `read`, so read-only users saw the nav item and hit "Access Denied" on click. The route and nav entry now require `satellite.manage`.
|
|
19
|
+
|
|
20
|
+
The `@checkstack/ai-backend` bump is only the regenerated bundled docs index
|
|
21
|
+
(the frontend routing guide gained the `nav.isVisible` section); no code change.
|
|
22
|
+
|
|
23
|
+
**BREAKING (`@checkstack/frontend-api`):** the `AccessApi` interface gains a
|
|
24
|
+
required `useIsAuthenticated()` method. Custom `AccessApi` implementations must
|
|
25
|
+
add it (it returns `{ loading, isAuthenticated }`). The built-in auth
|
|
26
|
+
implementation and the no-auth fallback already do. `NavEntry` also gains an
|
|
27
|
+
optional `isVisible` predicate (purely additive).
|
|
28
|
+
|
|
29
|
+
- 56e7c75: Fix frontend access checks to use FULLY-QUALIFIED access-rule ids, and resolve
|
|
30
|
+
the anonymous role on the frontend.
|
|
31
|
+
|
|
32
|
+
Granted access-rule ids are stored fully-qualified as `{pluginId}.{ruleId}` (e.g.
|
|
33
|
+
`incident.incident.read`) so two plugins defining the same short rule id never
|
|
34
|
+
collide. The frontend, however, was checking the UNqualified id (`incident.read`)
|
|
35
|
+
via `isAccessRuleSatisfied`, so every check failed for any user without the `*`
|
|
36
|
+
(admin) grant - masked in development because dev-auth grants `*`. This silently
|
|
37
|
+
broke ALL non-admin frontend gating (route guards, sidebar entries, and
|
|
38
|
+
`useAccess`-based button/link gating).
|
|
39
|
+
|
|
40
|
+
- **`@checkstack/common`**: `AccessRule` now carries a REQUIRED owning `pluginId`;
|
|
41
|
+
`access()` / `accessPair()` require and stamp it; `isAccessRuleSatisfied`
|
|
42
|
+
qualifies the rule (`{pluginId}.{id}`, plus the manage->read escalation) and
|
|
43
|
+
matches ONLY the qualified form. There is intentionally NO unqualified fallback
|
|
44
|
+
- matching a bare id would let one plugin's grant satisfy another plugin's
|
|
45
|
+
identically-named rule (a cross-plugin privilege-escalation flaw). Every plugin
|
|
46
|
+
that defines access rules now passes its own `pluginId`.
|
|
47
|
+
- **`@checkstack/backend`**: `pluginManager.getAllAccessRules()` no longer strips
|
|
48
|
+
the `pluginId` field (the rule `id` is already fully-qualified for the DB sync).
|
|
49
|
+
- **Route guard** (`@checkstack/frontend` / `@checkstack/frontend-api`) now
|
|
50
|
+
checks the FULL rule object (so it qualifies and escalates), not a bare id.
|
|
51
|
+
- **Anonymous role on the frontend**: the `accessRules` procedure is now
|
|
52
|
+
`public`, returning the configurable anonymous role's grants to unauthenticated
|
|
53
|
+
callers; `useAccessRules` fetches them for guests instead of returning an empty
|
|
54
|
+
set. So anonymous UI now reflects exactly what the anonymous role is allowed -
|
|
55
|
+
which an admin can change (`isPublic` is only the seeded default).
|
|
56
|
+
- Incident / maintenance / SLO detail routes are now read-gated (their read rule
|
|
57
|
+
is an `isPublic` default, so the anonymous role holds it unless an admin
|
|
58
|
+
revokes it); their dashboard status signals carry that rule and render as a
|
|
59
|
+
link only when the viewer may open it.
|
|
60
|
+
|
|
61
|
+
**BREAKING (`@checkstack/common`):** `AccessRule.pluginId` is now REQUIRED, and
|
|
62
|
+
`access()` / `accessPair()` require a `pluginId` option. `isAccessRuleSatisfied`
|
|
63
|
+
matches ONLY the fully-qualified `{pluginId}.{ruleId}` form - the previous
|
|
64
|
+
unqualified fallback is removed, because it was a cross-plugin
|
|
65
|
+
privilege-escalation flaw. Any code constructing an `AccessRule` or calling
|
|
66
|
+
`access()`/`accessPair()` must supply the owning `pluginId`.
|
|
67
|
+
|
|
68
|
+
Verified live against an anonymous caller: read pages resolve (qualified match),
|
|
69
|
+
manage actions are denied, manage->read escalation and `*` still work.
|
|
70
|
+
|
|
71
|
+
- Updated dependencies [0626782]
|
|
72
|
+
- Updated dependencies [56e7c75]
|
|
73
|
+
- Updated dependencies [56e7c75]
|
|
74
|
+
- @checkstack/auth-common@0.8.3
|
|
75
|
+
- @checkstack/frontend-api@0.9.0
|
|
76
|
+
- @checkstack/common@0.15.0
|
|
77
|
+
- @checkstack/notification-common@1.3.3
|
|
78
|
+
|
|
79
|
+
## 2.3.3
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- Updated dependencies [fb705df]
|
|
84
|
+
- @checkstack/frontend-api@0.8.0
|
|
85
|
+
- @checkstack/auth-common@0.8.2
|
|
86
|
+
- @checkstack/common@0.14.1
|
|
87
|
+
- @checkstack/notification-common@1.3.2
|
|
88
|
+
|
|
3
89
|
## 2.3.2
|
|
4
90
|
|
|
5
91
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/catalog-common",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.4",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@checkstack/common": "0.
|
|
13
|
-
"@checkstack/auth-common": "0.8.
|
|
14
|
-
"@checkstack/frontend-api": "0.
|
|
15
|
-
"@checkstack/notification-common": "1.3.
|
|
12
|
+
"@checkstack/common": "0.15.0",
|
|
13
|
+
"@checkstack/auth-common": "0.8.3",
|
|
14
|
+
"@checkstack/frontend-api": "0.9.0",
|
|
15
|
+
"@checkstack/notification-common": "1.3.3",
|
|
16
16
|
"@orpc/contract": "^1.14.4",
|
|
17
17
|
"zod": "^4.2.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"typescript": "^5.7.2",
|
|
21
21
|
"@checkstack/tsconfig": "0.0.7",
|
|
22
|
-
"@checkstack/scripts": "0.
|
|
22
|
+
"@checkstack/scripts": "0.6.1"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"typecheck": "tsgo -b",
|
package/src/access.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { accessPair } from "@checkstack/common";
|
|
2
2
|
|
|
3
|
+
import { pluginMetadata } from "./plugin-metadata";
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Access rules for the Catalog plugin.
|
|
5
7
|
*
|
|
@@ -25,6 +27,7 @@ export const catalogAccess = {
|
|
|
25
27
|
},
|
|
26
28
|
},
|
|
27
29
|
{
|
|
30
|
+
pluginId: pluginMetadata.pluginId,
|
|
28
31
|
idParam: "systemId",
|
|
29
32
|
listKey: "systems",
|
|
30
33
|
},
|
|
@@ -33,16 +36,22 @@ export const catalogAccess = {
|
|
|
33
36
|
/**
|
|
34
37
|
* Group access (global, no team-based filtering).
|
|
35
38
|
*/
|
|
36
|
-
group: accessPair(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
group: accessPair(
|
|
40
|
+
"group",
|
|
41
|
+
{
|
|
42
|
+
read: {
|
|
43
|
+
description: "View groups",
|
|
44
|
+
isDefault: true,
|
|
45
|
+
isPublic: true,
|
|
46
|
+
},
|
|
47
|
+
manage: {
|
|
48
|
+
description: "Create, update, and delete groups",
|
|
49
|
+
},
|
|
41
50
|
},
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
{
|
|
52
|
+
pluginId: pluginMetadata.pluginId,
|
|
44
53
|
},
|
|
45
|
-
|
|
54
|
+
),
|
|
46
55
|
|
|
47
56
|
/**
|
|
48
57
|
* Environment access (global, no team-based filtering).
|
|
@@ -51,29 +60,41 @@ export const catalogAccess = {
|
|
|
51
60
|
* groups): a free-form set of custom fields that any system can belong
|
|
52
61
|
* to many-to-many.
|
|
53
62
|
*/
|
|
54
|
-
environment: accessPair(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
environment: accessPair(
|
|
64
|
+
"environment",
|
|
65
|
+
{
|
|
66
|
+
read: {
|
|
67
|
+
description: "View environments",
|
|
68
|
+
isDefault: true,
|
|
69
|
+
isPublic: true,
|
|
70
|
+
},
|
|
71
|
+
manage: {
|
|
72
|
+
description: "Create, update, and delete environments",
|
|
73
|
+
},
|
|
59
74
|
},
|
|
60
|
-
|
|
61
|
-
|
|
75
|
+
{
|
|
76
|
+
pluginId: pluginMetadata.pluginId,
|
|
62
77
|
},
|
|
63
|
-
|
|
78
|
+
),
|
|
64
79
|
|
|
65
80
|
/**
|
|
66
81
|
* View access (global, user-only).
|
|
67
82
|
*/
|
|
68
|
-
view: accessPair(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
view: accessPair(
|
|
84
|
+
"view",
|
|
85
|
+
{
|
|
86
|
+
read: {
|
|
87
|
+
description: "View saved views",
|
|
88
|
+
isDefault: true,
|
|
89
|
+
},
|
|
90
|
+
manage: {
|
|
91
|
+
description: "Manage saved views",
|
|
92
|
+
},
|
|
72
93
|
},
|
|
73
|
-
|
|
74
|
-
|
|
94
|
+
{
|
|
95
|
+
pluginId: pluginMetadata.pluginId,
|
|
75
96
|
},
|
|
76
|
-
|
|
97
|
+
),
|
|
77
98
|
};
|
|
78
99
|
|
|
79
100
|
/**
|
package/src/slots.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createSlot } from "@checkstack/frontend-api";
|
|
2
|
-
import type { IconName } from "@checkstack/common";
|
|
2
|
+
import type { IconName, AccessRule } from "@checkstack/common";
|
|
3
3
|
import type { System } from "./types";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -175,6 +175,14 @@ export interface SystemSignal {
|
|
|
175
175
|
* there is no more specific page than the system itself.
|
|
176
176
|
*/
|
|
177
177
|
href?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Access rule required to view {@link href}'s target page. When set, the
|
|
180
|
+
* dashboard renders the signal as a LINK only if the user satisfies this rule,
|
|
181
|
+
* and as plain text otherwise - so a user is never offered a link that would
|
|
182
|
+
* immediately hit "Access Denied". Omit only when the target needs no specific
|
|
183
|
+
* permission (the link is then always rendered).
|
|
184
|
+
*/
|
|
185
|
+
accessRule?: AccessRule;
|
|
178
186
|
/** ISO timestamp the signal started — shown as a "since" hint and used as a sort tie-break. */
|
|
179
187
|
since?: string;
|
|
180
188
|
/** Lucide icon name (PascalCase), rendered by `@checkstack/ui`'s `DynamicIcon`. */
|