@checkstack/healthcheck-common 0.1.0 → 0.2.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 +87 -0
- package/package.json +1 -1
- package/src/rpc-contract.ts +11 -1
- package/src/schemas.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,92 @@
|
|
|
1
1
|
# @checkstack/healthcheck-common
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8e43507: # Teams and Resource-Level Access Control
|
|
8
|
+
|
|
9
|
+
This release introduces a comprehensive Teams system for organizing users and controlling access to resources at a granular level.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
### Team Management
|
|
14
|
+
|
|
15
|
+
- Create, update, and delete teams with name and description
|
|
16
|
+
- Add/remove users from teams
|
|
17
|
+
- Designate team managers with elevated privileges
|
|
18
|
+
- View team membership and manager status
|
|
19
|
+
|
|
20
|
+
### Resource-Level Access Control
|
|
21
|
+
|
|
22
|
+
- Grant teams access to specific resources (systems, health checks, incidents, maintenances)
|
|
23
|
+
- Configure read-only or manage permissions per team
|
|
24
|
+
- Resource-level "Team Only" mode that restricts access exclusively to team members
|
|
25
|
+
- Separate `resourceAccessSettings` table for resource-level settings (not per-grant)
|
|
26
|
+
- Automatic cleanup of grants when teams are deleted (database cascade)
|
|
27
|
+
|
|
28
|
+
### Middleware Integration
|
|
29
|
+
|
|
30
|
+
- Extended `autoAuthMiddleware` to support resource access checks
|
|
31
|
+
- Single-resource pre-handler validation for detail endpoints
|
|
32
|
+
- Automatic list filtering for collection endpoints
|
|
33
|
+
- S2S endpoints for access verification
|
|
34
|
+
|
|
35
|
+
### Frontend Components
|
|
36
|
+
|
|
37
|
+
- `TeamsTab` component for managing teams in Auth Settings
|
|
38
|
+
- `TeamAccessEditor` component for assigning team access to resources
|
|
39
|
+
- Resource-level "Team Only" toggle in `TeamAccessEditor`
|
|
40
|
+
- Integration into System, Health Check, Incident, and Maintenance editors
|
|
41
|
+
|
|
42
|
+
## Breaking Changes
|
|
43
|
+
|
|
44
|
+
### API Response Format Changes
|
|
45
|
+
|
|
46
|
+
List endpoints now return objects with named keys instead of arrays directly:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
// Before
|
|
50
|
+
const systems = await catalogApi.getSystems();
|
|
51
|
+
|
|
52
|
+
// After
|
|
53
|
+
const { systems } = await catalogApi.getSystems();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Affected endpoints:
|
|
57
|
+
|
|
58
|
+
- `catalog.getSystems` → `{ systems: [...] }`
|
|
59
|
+
- `healthcheck.getConfigurations` → `{ configurations: [...] }`
|
|
60
|
+
- `incident.listIncidents` → `{ incidents: [...] }`
|
|
61
|
+
- `maintenance.listMaintenances` → `{ maintenances: [...] }`
|
|
62
|
+
|
|
63
|
+
### User Identity Enrichment
|
|
64
|
+
|
|
65
|
+
`RealUser` and `ApplicationUser` types now include `teamIds: string[]` field with team memberships.
|
|
66
|
+
|
|
67
|
+
## Documentation
|
|
68
|
+
|
|
69
|
+
See `docs/backend/teams.md` for complete API reference and integration guide.
|
|
70
|
+
|
|
71
|
+
- 97c5a6b: Add UUID-based collector identification for better multiple collector support
|
|
72
|
+
|
|
73
|
+
**Breaking Change**: Existing health check configurations with collectors need to be recreated.
|
|
74
|
+
|
|
75
|
+
- Each collector instance now has a unique UUID assigned on creation
|
|
76
|
+
- Collector results are stored under the UUID key with `_collectorId` and `_assertionFailed` metadata
|
|
77
|
+
- Auto-charts correctly display separate charts for each collector instance
|
|
78
|
+
- Charts are now grouped by collector instance with clear headings
|
|
79
|
+
- Assertion status card shows pass/fail for each collector
|
|
80
|
+
- Renamed "Success" to "HTTP Success" to clarify it's about HTTP request success
|
|
81
|
+
- Fixed deletion of collectors not persisting to database
|
|
82
|
+
- Fixed duplicate React key warnings in auto-chart grid
|
|
83
|
+
|
|
84
|
+
### Patch Changes
|
|
85
|
+
|
|
86
|
+
- Updated dependencies [8e43507]
|
|
87
|
+
- @checkstack/common@0.1.0
|
|
88
|
+
- @checkstack/signal-common@0.0.4
|
|
89
|
+
|
|
3
90
|
## 0.1.0
|
|
4
91
|
|
|
5
92
|
### Minor Changes
|
package/package.json
CHANGED
package/src/rpc-contract.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import {
|
|
3
3
|
createClientDefinition,
|
|
4
|
+
createResourceAccessList,
|
|
4
5
|
type ProcedureMetadata,
|
|
5
6
|
} from "@checkstack/common";
|
|
6
7
|
import { pluginMetadata } from "./plugin-metadata";
|
|
@@ -25,6 +26,12 @@ import {
|
|
|
25
26
|
// Base builder with full metadata support
|
|
26
27
|
const _base = oc.$meta<ProcedureMetadata>({});
|
|
27
28
|
|
|
29
|
+
// Resource access configurations for team-based access control
|
|
30
|
+
const configListAccess = createResourceAccessList(
|
|
31
|
+
"configuration",
|
|
32
|
+
"configurations"
|
|
33
|
+
);
|
|
34
|
+
|
|
28
35
|
// --- Response Schemas for Evaluated Status ---
|
|
29
36
|
|
|
30
37
|
const SystemCheckStatusSchema = z.object({
|
|
@@ -74,8 +81,11 @@ export const healthCheckContract = {
|
|
|
74
81
|
.meta({
|
|
75
82
|
userType: "authenticated",
|
|
76
83
|
permissions: [permissions.healthCheckRead.id],
|
|
84
|
+
resourceAccess: [configListAccess],
|
|
77
85
|
})
|
|
78
|
-
.output(
|
|
86
|
+
.output(
|
|
87
|
+
z.object({ configurations: z.array(HealthCheckConfigurationSchema) })
|
|
88
|
+
),
|
|
79
89
|
|
|
80
90
|
createConfiguration: _base
|
|
81
91
|
.meta({
|
package/src/schemas.ts
CHANGED
|
@@ -56,9 +56,11 @@ export type CollectorAssertion = z.infer<typeof CollectorAssertionSchema>;
|
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* A collector configuration entry within a health check.
|
|
59
|
-
* Each entry includes the collector ID, its config, and per-collector assertions.
|
|
59
|
+
* Each entry includes a unique ID, the collector type ID, its config, and per-collector assertions.
|
|
60
60
|
*/
|
|
61
61
|
export const CollectorConfigEntrySchema = z.object({
|
|
62
|
+
/** Unique ID for this collector instance (UUID) */
|
|
63
|
+
id: z.string(),
|
|
62
64
|
/** Fully-qualified collector ID (e.g., collector-hardware.cpu) */
|
|
63
65
|
collectorId: z.string(),
|
|
64
66
|
/** Collector-specific configuration */
|