@spinajs/configuration-http 2.0.491 → 2.0.495
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/README.md +34 -34
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.mjs.tsbuildinfo +1 -1
- package/package.json +76 -76
package/README.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# `@spinajs/configuration-http`
|
|
2
|
-
|
|
3
|
-
HTTP API for reading and updating database-stored configuration values managed by
|
|
4
|
-
[`@spinajs/configuration-db-source`](../configuration-db-source).
|
|
5
|
-
|
|
6
|
-
It exposes a read + update CRUD surface over the `configuration` table. Entries
|
|
7
|
-
themselves are created by code that exposes config options (`expose: true`), so
|
|
8
|
-
this API intentionally does **not** create or delete arbitrary entries — it only
|
|
9
|
-
lets operators tune existing values.
|
|
10
|
-
|
|
11
|
-
## Endpoints
|
|
12
|
-
|
|
13
|
-
| Method | Path | Permission | Description |
|
|
14
|
-
| ------ | ------------------------ | ----------- | -------------------------------------------- |
|
|
15
|
-
| GET | `/configuration` | `readAny` | List all entries (optional `?group=` filter) |
|
|
16
|
-
| GET | `/configuration/:slug` | `readAny` | Get a single entry by slug |
|
|
17
|
-
| PATCH | `/configuration/:slug` | `updateAny` | Update an entry's `Value` (+ `Default`/`Watch`) |
|
|
18
|
-
|
|
19
|
-
All routes require a valid session (`AuthorizedPolicy`) and are guarded by
|
|
20
|
-
`RbacPolicy` on the `configuration` resource.
|
|
21
|
-
|
|
22
|
-
Incoming values are validated against the entry `Type` and `Meta` constraints
|
|
23
|
-
(min/max, oneOf/manyOf, date bounds) and stored in their canonical string form.
|
|
24
|
-
|
|
25
|
-
## RBAC
|
|
26
|
-
|
|
27
|
-
The package ships a dedicated `configuration` role granting `read:any` /
|
|
28
|
-
`update:any` on the `configuration` resource, and extends `admin` with it. Grant
|
|
29
|
-
the `configuration` role (or `admin`) to give an account access to the API.
|
|
30
|
-
|
|
31
|
-
## Notes
|
|
32
|
-
|
|
33
|
-
Writes are persisted to the database only. The running application picks up the
|
|
34
|
-
change through the db-source watch poll, and only for entries with `Watch = true`.
|
|
1
|
+
# `@spinajs/configuration-http`
|
|
2
|
+
|
|
3
|
+
HTTP API for reading and updating database-stored configuration values managed by
|
|
4
|
+
[`@spinajs/configuration-db-source`](../configuration-db-source).
|
|
5
|
+
|
|
6
|
+
It exposes a read + update CRUD surface over the `configuration` table. Entries
|
|
7
|
+
themselves are created by code that exposes config options (`expose: true`), so
|
|
8
|
+
this API intentionally does **not** create or delete arbitrary entries — it only
|
|
9
|
+
lets operators tune existing values.
|
|
10
|
+
|
|
11
|
+
## Endpoints
|
|
12
|
+
|
|
13
|
+
| Method | Path | Permission | Description |
|
|
14
|
+
| ------ | ------------------------ | ----------- | -------------------------------------------- |
|
|
15
|
+
| GET | `/configuration` | `readAny` | List all entries (optional `?group=` filter) |
|
|
16
|
+
| GET | `/configuration/:slug` | `readAny` | Get a single entry by slug |
|
|
17
|
+
| PATCH | `/configuration/:slug` | `updateAny` | Update an entry's `Value` (+ `Default`/`Watch`) |
|
|
18
|
+
|
|
19
|
+
All routes require a valid session (`AuthorizedPolicy`) and are guarded by
|
|
20
|
+
`RbacPolicy` on the `configuration` resource.
|
|
21
|
+
|
|
22
|
+
Incoming values are validated against the entry `Type` and `Meta` constraints
|
|
23
|
+
(min/max, oneOf/manyOf, date bounds) and stored in their canonical string form.
|
|
24
|
+
|
|
25
|
+
## RBAC
|
|
26
|
+
|
|
27
|
+
The package ships a dedicated `configuration` role granting `read:any` /
|
|
28
|
+
`update:any` on the `configuration` resource, and extends `admin` with it. Grant
|
|
29
|
+
the `configuration` role (or `admin`) to give an account access to the API.
|
|
30
|
+
|
|
31
|
+
## Notes
|
|
32
|
+
|
|
33
|
+
Writes are persisted to the database only. The running application picks up the
|
|
34
|
+
change through the db-source watch poll, and only for entries with `Watch = true`.
|