@stratum-hq/control-plane 0.2.4 → 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/LICENSE +21 -0
- package/README.md +66 -0
- package/package.json +6 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Christian Crank
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @stratum-hq/control-plane
|
|
2
|
+
|
|
3
|
+
The [Stratum](https://github.com/stratum-hq/Stratum) control plane — a [Fastify](https://fastify.dev) REST API server that exposes tenant, config, permission, API-key, webhook, audit, consent, region, and ABAC management over HTTP. Pair it with `@stratum-hq/sdk` for polyglot stacks or service separation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @stratum-hq/control-plane
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Most deployments run it as a standalone service rather than importing it. A container image and Compose file ship with the [Stratum repo](https://github.com/stratum-hq/Stratum).
|
|
12
|
+
|
|
13
|
+
## Running
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
DATABASE_URL=postgres://stratum:stratum_dev@localhost:5432/stratum \
|
|
17
|
+
JWT_SECRET=your-secret \
|
|
18
|
+
node dist/index.js
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
On startup the server runs database migrations, then listens on `PORT` (default `3001`). It handles `SIGTERM`/`SIGINT` for graceful shutdown. OpenAPI docs are served via `@fastify/swagger-ui`.
|
|
22
|
+
|
|
23
|
+
## Configuration
|
|
24
|
+
|
|
25
|
+
| Variable | Default | Description |
|
|
26
|
+
|----------|---------|-------------|
|
|
27
|
+
| `PORT` | `3001` | Listen port |
|
|
28
|
+
| `DATABASE_URL` | `postgres://stratum:stratum_dev@localhost:5432/stratum` | PostgreSQL connection string |
|
|
29
|
+
| `JWT_SECRET` | dev fallback | JWT signing secret — **required** in production/staging (server refuses to start without it) |
|
|
30
|
+
| `ALLOWED_ORIGINS` | `localhost:3000,3300` | Comma-separated CORS allowlist |
|
|
31
|
+
| `RATE_LIMIT_MAX` | `100` | Requests per window |
|
|
32
|
+
| `RATE_LIMIT_WINDOW` | `1 minute` | Rate-limit window |
|
|
33
|
+
| `REDIS_URL` | — | Optional; enables distributed rate limiting |
|
|
34
|
+
| `NODE_ENV` | `development` | Environment |
|
|
35
|
+
|
|
36
|
+
Security middleware (`@fastify/helmet`, CORS, rate limiting) is enabled by default.
|
|
37
|
+
|
|
38
|
+
## API Surface
|
|
39
|
+
|
|
40
|
+
All routes are versioned under `/api/v1`:
|
|
41
|
+
|
|
42
|
+
| Prefix | Resource |
|
|
43
|
+
|--------|----------|
|
|
44
|
+
| `/api/v1/tenants` | Tenant CRUD + hierarchy |
|
|
45
|
+
| `/api/v1/tenants/:id/config` | Config entries |
|
|
46
|
+
| `/api/v1/tenants/:id/permissions` | Permission policies |
|
|
47
|
+
| `/api/v1/tenants/:tenantId/abac-policies` | ABAC policies |
|
|
48
|
+
| `/api/v1/tenants/:tenantId/consent` | GDPR consent records |
|
|
49
|
+
| `/api/v1/api-keys` | API-key management |
|
|
50
|
+
| `/api/v1/webhooks` | Webhook subscriptions |
|
|
51
|
+
| `/api/v1/audit-logs` | Audit log queries |
|
|
52
|
+
| `/api/v1/regions` | Multi-region config |
|
|
53
|
+
| `/api/v1/roles` | RBAC roles |
|
|
54
|
+
| `/api/v1/config` | Config diff |
|
|
55
|
+
| `/api/v1/maintenance` | Retention / purge tasks |
|
|
56
|
+
|
|
57
|
+
A `/health` endpoint reports server and Redis status.
|
|
58
|
+
|
|
59
|
+
## Links
|
|
60
|
+
|
|
61
|
+
- Documentation: https://docs.stratum-hq.org
|
|
62
|
+
- GitHub: https://github.com/stratum-hq/Stratum
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT © Christian Crank
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stratum-hq/control-plane",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Stratum control plane REST API server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"multi-tenancy",
|
|
@@ -57,5 +57,10 @@
|
|
|
57
57
|
"tsx": "^4.7.0",
|
|
58
58
|
"typescript": "^5.4.0",
|
|
59
59
|
"vitest": "^1.6.0"
|
|
60
|
+
},
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "https://github.com/stratum-hq/Stratum.git",
|
|
64
|
+
"directory": "packages/control-plane"
|
|
60
65
|
}
|
|
61
66
|
}
|