@checkstack/healthcheck-backend 0.2.0 → 0.3.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 +84 -0
- package/package.json +1 -1
- package/src/index.ts +5 -5
- package/src/router.test.ts +1 -1
- package/src/router.ts +2 -2
- package/src/service.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# @checkstack/healthcheck-backend
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9faec1f: # Unified AccessRule Terminology Refactoring
|
|
8
|
+
|
|
9
|
+
This release completes a comprehensive terminology refactoring from "permission" to "accessRule" across the entire codebase, establishing a consistent and modern access control vocabulary.
|
|
10
|
+
|
|
11
|
+
## Changes
|
|
12
|
+
|
|
13
|
+
### Core Infrastructure (`@checkstack/common`)
|
|
14
|
+
|
|
15
|
+
- Introduced `AccessRule` interface as the primary access control type
|
|
16
|
+
- Added `accessPair()` helper for creating read/manage access rule pairs
|
|
17
|
+
- Added `access()` builder for individual access rules
|
|
18
|
+
- Replaced `Permission` type with `AccessRule` throughout
|
|
19
|
+
|
|
20
|
+
### API Changes
|
|
21
|
+
|
|
22
|
+
- `env.registerPermissions()` → `env.registerAccessRules()`
|
|
23
|
+
- `meta.permissions` → `meta.access` in RPC contracts
|
|
24
|
+
- `usePermission()` → `useAccess()` in frontend hooks
|
|
25
|
+
- Route `permission:` field → `accessRule:` field
|
|
26
|
+
|
|
27
|
+
### UI Changes
|
|
28
|
+
|
|
29
|
+
- "Roles & Permissions" tab → "Roles & Access Rules"
|
|
30
|
+
- "You don't have permission..." → "You don't have access..."
|
|
31
|
+
- All permission-related UI text updated
|
|
32
|
+
|
|
33
|
+
### Documentation & Templates
|
|
34
|
+
|
|
35
|
+
- Updated 18 documentation files with AccessRule terminology
|
|
36
|
+
- Updated 7 scaffolding templates with `accessPair()` pattern
|
|
37
|
+
- All code examples use new AccessRule API
|
|
38
|
+
|
|
39
|
+
## Migration Guide
|
|
40
|
+
|
|
41
|
+
### Backend Plugins
|
|
42
|
+
|
|
43
|
+
```diff
|
|
44
|
+
- import { permissionList } from "./permissions";
|
|
45
|
+
- env.registerPermissions(permissionList);
|
|
46
|
+
+ import { accessRules } from "./access";
|
|
47
|
+
+ env.registerAccessRules(accessRules);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### RPC Contracts
|
|
51
|
+
|
|
52
|
+
```diff
|
|
53
|
+
- .meta({ userType: "user", permissions: [permissions.read.id] })
|
|
54
|
+
+ .meta({ userType: "user", access: [access.read] })
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Frontend Hooks
|
|
58
|
+
|
|
59
|
+
```diff
|
|
60
|
+
- const canRead = accessApi.usePermission(permissions.read.id);
|
|
61
|
+
+ const canRead = accessApi.useAccess(access.read);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Routes
|
|
65
|
+
|
|
66
|
+
```diff
|
|
67
|
+
- permission: permissions.entityRead.id,
|
|
68
|
+
+ accessRule: access.read,
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Updated dependencies [9faec1f]
|
|
74
|
+
- Updated dependencies [827b286]
|
|
75
|
+
- Updated dependencies [f533141]
|
|
76
|
+
- Updated dependencies [aa4a8ab]
|
|
77
|
+
- @checkstack/backend-api@0.3.0
|
|
78
|
+
- @checkstack/catalog-backend@0.2.0
|
|
79
|
+
- @checkstack/catalog-common@1.1.0
|
|
80
|
+
- @checkstack/command-backend@0.1.0
|
|
81
|
+
- @checkstack/common@0.2.0
|
|
82
|
+
- @checkstack/healthcheck-common@0.3.0
|
|
83
|
+
- @checkstack/integration-backend@0.1.0
|
|
84
|
+
- @checkstack/signal-common@0.1.0
|
|
85
|
+
- @checkstack/queue-api@0.0.5
|
|
86
|
+
|
|
3
87
|
## 0.2.0
|
|
4
88
|
|
|
5
89
|
### Minor Changes
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import * as schema from "./schema";
|
|
6
6
|
import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
healthCheckAccessRules,
|
|
9
|
+
healthCheckAccess,
|
|
9
10
|
pluginMetadata,
|
|
10
11
|
healthCheckContract,
|
|
11
12
|
healthcheckRoutes,
|
|
12
|
-
permissions,
|
|
13
13
|
} from "@checkstack/healthcheck-common";
|
|
14
14
|
import {
|
|
15
15
|
createBackendPlugin,
|
|
@@ -55,7 +55,7 @@ let storedEmitHook: EmitHookFn | undefined;
|
|
|
55
55
|
export default createBackendPlugin({
|
|
56
56
|
metadata: pluginMetadata,
|
|
57
57
|
register(env) {
|
|
58
|
-
env.
|
|
58
|
+
env.registerAccessRules(healthCheckAccessRules);
|
|
59
59
|
|
|
60
60
|
// Register hooks as integration events
|
|
61
61
|
const integrationEvents = env.getExtensionPoint(
|
|
@@ -142,7 +142,7 @@ export default createBackendPlugin({
|
|
|
142
142
|
route:
|
|
143
143
|
resolveRoute(healthcheckRoutes.routes.config) +
|
|
144
144
|
"?action=create",
|
|
145
|
-
|
|
145
|
+
requiredAccessRules: [healthCheckAccess.configuration.manage],
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
id: "manage",
|
|
@@ -151,7 +151,7 @@ export default createBackendPlugin({
|
|
|
151
151
|
iconName: "HeartPulse",
|
|
152
152
|
shortcuts: ["meta+shift+h", "ctrl+shift+h"],
|
|
153
153
|
route: resolveRoute(healthcheckRoutes.routes.config),
|
|
154
|
-
|
|
154
|
+
requiredAccessRules: [healthCheckAccess.configuration.manage],
|
|
155
155
|
},
|
|
156
156
|
],
|
|
157
157
|
});
|
package/src/router.test.ts
CHANGED
package/src/router.ts
CHANGED
|
@@ -14,8 +14,8 @@ import { toJsonSchemaWithChartMeta } from "./schema-utils";
|
|
|
14
14
|
/**
|
|
15
15
|
* Creates the healthcheck router using contract-based implementation.
|
|
16
16
|
*
|
|
17
|
-
* Auth and
|
|
18
|
-
* based on the contract's meta.userType and meta.
|
|
17
|
+
* Auth and access rules are automatically enforced via autoAuthMiddleware
|
|
18
|
+
* based on the contract's meta.userType and meta.access.
|
|
19
19
|
*/
|
|
20
20
|
export const createHealthCheckRouter = (
|
|
21
21
|
database: NodePgDatabase<typeof schema>,
|
package/src/service.ts
CHANGED
|
@@ -491,7 +491,7 @@ export class HealthCheckService {
|
|
|
491
491
|
|
|
492
492
|
/**
|
|
493
493
|
* Get detailed health check run history with full result data.
|
|
494
|
-
* Restricted to users with manage
|
|
494
|
+
* Restricted to users with manage access.
|
|
495
495
|
*/
|
|
496
496
|
async getDetailedHistory(props: {
|
|
497
497
|
systemId?: string;
|
|
@@ -530,7 +530,7 @@ export class HealthCheckService {
|
|
|
530
530
|
.limit(limit)
|
|
531
531
|
.offset(offset);
|
|
532
532
|
|
|
533
|
-
// Return with full result data for manage
|
|
533
|
+
// Return with full result data for manage access
|
|
534
534
|
return {
|
|
535
535
|
runs: runs.map((run) => ({
|
|
536
536
|
id: run.id,
|