@constructive-io/express-context 0.6.1 → 0.8.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/esm/pg-settings.js +4 -0
- package/package.json +9 -9
- package/pg-settings.js +4 -0
- package/types.d.ts +1 -0
package/esm/pg-settings.js
CHANGED
|
@@ -30,6 +30,10 @@ export function buildPgSettings(input) {
|
|
|
30
30
|
if (token?.session_id) {
|
|
31
31
|
settings['jwt.claims.session_id'] = token.session_id;
|
|
32
32
|
}
|
|
33
|
+
// Principal identity (service accounts / bots)
|
|
34
|
+
if (token?.principal_id) {
|
|
35
|
+
settings['jwt.claims.principal_id'] = token.principal_id;
|
|
36
|
+
}
|
|
33
37
|
// Database context
|
|
34
38
|
if (api.databaseId) {
|
|
35
39
|
settings['jwt.claims.database_id'] = api.databaseId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/express-context",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Extractable Express middleware for Constructive tenant context — domain resolution, JWT auth, pgSettings, and withPgClient",
|
|
5
5
|
"author": "Constructive <developers@constructive.io>",
|
|
6
6
|
"homepage": "https://github.com/constructive-io/constructive",
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@constructive-io/url-domains": "^2.
|
|
33
|
-
"@pgpmjs/env": "^2.
|
|
34
|
-
"@pgpmjs/logger": "^2.
|
|
35
|
-
"@pgpmjs/server-utils": "^3.
|
|
36
|
-
"@pgpmjs/types": "^2.
|
|
32
|
+
"@constructive-io/url-domains": "^2.18.0",
|
|
33
|
+
"@pgpmjs/env": "^2.26.0",
|
|
34
|
+
"@pgpmjs/logger": "^2.13.0",
|
|
35
|
+
"@pgpmjs/server-utils": "^3.14.0",
|
|
36
|
+
"@pgpmjs/types": "^2.30.0",
|
|
37
37
|
"lru-cache": "^11.2.7",
|
|
38
38
|
"pg": "^8.21.0",
|
|
39
|
-
"pg-cache": "^3.
|
|
40
|
-
"pg-query-context": "^2.
|
|
39
|
+
"pg-cache": "^3.13.0",
|
|
40
|
+
"pg-query-context": "^2.18.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/express": "^5.0.6",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"jwt",
|
|
60
60
|
"pgSettings"
|
|
61
61
|
],
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "958154492690368ffffef974122ea243c68055e2"
|
|
63
63
|
}
|
package/pg-settings.js
CHANGED
|
@@ -33,6 +33,10 @@ function buildPgSettings(input) {
|
|
|
33
33
|
if (token?.session_id) {
|
|
34
34
|
settings['jwt.claims.session_id'] = token.session_id;
|
|
35
35
|
}
|
|
36
|
+
// Principal identity (service accounts / bots)
|
|
37
|
+
if (token?.principal_id) {
|
|
38
|
+
settings['jwt.claims.principal_id'] = token.principal_id;
|
|
39
|
+
}
|
|
36
40
|
// Database context
|
|
37
41
|
if (api.databaseId) {
|
|
38
42
|
settings['jwt.claims.database_id'] = api.databaseId;
|
package/types.d.ts
CHANGED