@constructive-io/graphql-server 4.36.4 → 4.37.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.
|
@@ -241,7 +241,9 @@ const buildPreset = (pool, schemas, anonRole, roleName, databaseSettings) => {
|
|
|
241
241
|
if (req.token.kind) {
|
|
242
242
|
pgSettings['jwt.claims.kind'] = req.token.kind;
|
|
243
243
|
}
|
|
244
|
-
//
|
|
244
|
+
// Principal identity — always set; equals user_id for human sessions
|
|
245
|
+
pgSettings['jwt.claims.principal_id'] = req.token.principal_id || req.token.user_id;
|
|
246
|
+
// Enforce read-only transactions for read_only credentials
|
|
245
247
|
if (req.token.access_level === 'read_only') {
|
|
246
248
|
pgSettings['default_transaction_read_only'] = 'on';
|
|
247
249
|
}
|
package/middleware/graphile.js
CHANGED
|
@@ -250,7 +250,9 @@ const buildPreset = (pool, schemas, anonRole, roleName, databaseSettings) => {
|
|
|
250
250
|
if (req.token.kind) {
|
|
251
251
|
pgSettings['jwt.claims.kind'] = req.token.kind;
|
|
252
252
|
}
|
|
253
|
-
//
|
|
253
|
+
// Principal identity — always set; equals user_id for human sessions
|
|
254
|
+
pgSettings['jwt.claims.principal_id'] = req.token.principal_id || req.token.user_id;
|
|
255
|
+
// Enforce read-only transactions for read_only credentials
|
|
254
256
|
if (req.token.access_level === 'read_only') {
|
|
255
257
|
pgSettings['default_transaction_read_only'] = 'on';
|
|
256
258
|
}
|
package/middleware/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.37.0",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Constructive GraphQL Server",
|
|
6
6
|
"main": "index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@constructive-io/csrf": "^0.15.0",
|
|
45
|
-
"@constructive-io/express-context": "^0.
|
|
45
|
+
"@constructive-io/express-context": "^0.7.0",
|
|
46
46
|
"@constructive-io/graphql-env": "^3.13.1",
|
|
47
47
|
"@constructive-io/graphql-types": "^3.12.1",
|
|
48
48
|
"@constructive-io/s3-utils": "^2.18.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@pgpmjs/logger": "^2.12.0",
|
|
53
53
|
"@pgpmjs/server-utils": "^3.13.1",
|
|
54
54
|
"@pgpmjs/types": "^2.29.1",
|
|
55
|
-
"agentic-server": "0.
|
|
55
|
+
"agentic-server": "0.7.0",
|
|
56
56
|
"cors": "^2.8.6",
|
|
57
57
|
"deepmerge": "^4.3.1",
|
|
58
58
|
"express": "^5.2.1",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"graphile-build-pg": "5.0.2",
|
|
64
64
|
"graphile-cache": "^3.13.2",
|
|
65
65
|
"graphile-config": "1.0.1",
|
|
66
|
-
"graphile-settings": "^5.
|
|
66
|
+
"graphile-settings": "^5.9.0",
|
|
67
67
|
"graphile-utils": "5.0.1",
|
|
68
68
|
"graphql": "16.13.0",
|
|
69
69
|
"graphql-upload": "^13.0.0",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"nodemon": "^3.1.14",
|
|
91
91
|
"ts-node": "^10.9.2"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "03d9e7ed4808d1d957b495a33980022172494340"
|
|
94
94
|
}
|