@stratum-hq/sdk 1.3.1 → 1.4.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/README.md +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -67,7 +67,7 @@ app.get("/data", (req, res) => {
|
|
|
67
67
|
## Features
|
|
68
68
|
|
|
69
69
|
- **`StratumClient`**: HTTP client for the control plane API (`resolveTenant`, `getTenantTree`, `createTenant`, `createWebhook`, `listRegions`, …) with a built-in LRU cache. Mutations made through the client invalidate affected entries (a move clears the whole cache); changes made elsewhere, such as a suspension or a config or permission change, are picked up when the entry expires, so the cache TTL (`cache.ttlMs`, default 60s) bounds how stale a context can be.
|
|
70
|
-
- **`expressMiddleware` / `fastifyPlugin`**: resolve the tenant from a JWT claim, `X-Tenant-ID` header, or custom resolvers (tried in that order), then populate `req.tenant`.
|
|
70
|
+
- **`expressMiddleware` / `fastifyPlugin`**: resolve the tenant from a JWT claim, `X-Tenant-ID` header, or custom resolvers (tried in that order), then populate `req.tenant`. Resolving a tenant needs only the `read` scope: give the app server a `read` key scoped to its tenant, which also resolves that tenant's descendants. In `resolved_config`, a sensitive value inherited from an ancestor arrives masked (`value: null`, `masked: true`) unless the key belongs to the tenant that set it.
|
|
71
71
|
- **AsyncLocalStorage context**: `getTenantContext()` and `runWithTenantContext()` make the resolved context available to services that never see the request object.
|
|
72
72
|
- **Custom resolvers**: supply async functions (e.g. subdomain- or query-based) via the `resolvers` option.
|
|
73
73
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stratum-hq/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Multi-tenant context for Express and Fastify: tenant resolution middleware and HTTP client for the Stratum control plane",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"multi-tenancy",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"registry": "https://registry.npmjs.org/"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@stratum-hq/core": "^1.
|
|
46
|
+
"@stratum-hq/core": "^1.6.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/express": "^4.17.0",
|