@constructive-io/express-context 0.27.0 → 0.28.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.
@@ -30,6 +30,17 @@ export function buildPgSettings(input) {
30
30
  if (token?.session_id) {
31
31
  settings['jwt.claims.session_id'] = token.session_id;
32
32
  }
33
+ // Session lineage (token exchange chains)
34
+ if (token?.root_session_id) {
35
+ settings['jwt.claims.root_session_id'] = token.root_session_id;
36
+ }
37
+ if (token?.parent_session_id) {
38
+ settings['jwt.claims.parent_session_id'] = token.parent_session_id;
39
+ }
40
+ // Declared purpose of the credential
41
+ if (token?.intent) {
42
+ settings['jwt.claims.intent'] = token.intent;
43
+ }
33
44
  // Principal identity (service accounts / bots)
34
45
  if (token?.principal_id) {
35
46
  settings['jwt.claims.principal_id'] = token.principal_id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/express-context",
3
- "version": "0.27.0",
3
+ "version": "0.28.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",
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@constructive-io/url-domains": "^2.30.1",
33
- "@pgpmjs/env": "^2.43.3",
33
+ "@pgpmjs/env": "^2.43.4",
34
34
  "@pgpmjs/logger": "^2.25.1",
35
- "@pgpmjs/server-utils": "^3.27.3",
36
- "@pgpmjs/types": "^2.53.1",
35
+ "@pgpmjs/server-utils": "^3.27.4",
36
+ "@pgpmjs/types": "^2.53.2",
37
37
  "lru-cache": "^11.2.7",
38
38
  "pg": "^8.21.0",
39
- "pg-cache": "^3.27.3",
39
+ "pg-cache": "^3.27.4",
40
40
  "pg-query-context": "^2.30.1"
41
41
  },
42
42
  "devDependencies": {
@@ -59,5 +59,5 @@
59
59
  "jwt",
60
60
  "pgSettings"
61
61
  ],
62
- "gitHead": "6e2d71a9eb4e1f49f0de0b2b594b2f811de97442"
62
+ "gitHead": "01e073830677c0587bab564b7d575a06b5156f0c"
63
63
  }
package/pg-settings.js CHANGED
@@ -33,6 +33,17 @@ function buildPgSettings(input) {
33
33
  if (token?.session_id) {
34
34
  settings['jwt.claims.session_id'] = token.session_id;
35
35
  }
36
+ // Session lineage (token exchange chains)
37
+ if (token?.root_session_id) {
38
+ settings['jwt.claims.root_session_id'] = token.root_session_id;
39
+ }
40
+ if (token?.parent_session_id) {
41
+ settings['jwt.claims.parent_session_id'] = token.parent_session_id;
42
+ }
43
+ // Declared purpose of the credential
44
+ if (token?.intent) {
45
+ settings['jwt.claims.intent'] = token.intent;
46
+ }
36
47
  // Principal identity (service accounts / bots)
37
48
  if (token?.principal_id) {
38
49
  settings['jwt.claims.principal_id'] = token.principal_id;
package/types.d.ts CHANGED
@@ -152,6 +152,12 @@ export type ConstructiveAPIToken = {
152
152
  session_id?: string;
153
153
  access_level?: string;
154
154
  kind?: string;
155
+ /** Session lineage: the top of this session's exchange chain. */
156
+ root_session_id?: string;
157
+ /** Session lineage: the session this one was exchanged from, if any. */
158
+ parent_session_id?: string;
159
+ /** Caller-declared purpose recorded on the credential at exchange time. */
160
+ intent?: string;
155
161
  [key: string]: unknown;
156
162
  };
157
163
  export interface BillingConfig {