@pgpm/jwt-claims 0.17.0 → 0.19.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/Makefile CHANGED
@@ -1,5 +1,5 @@
1
1
  EXTENSION = pgpm-jwt-claims
2
- DATA = sql/pgpm-jwt-claims--0.15.3.sql
2
+ DATA = sql/pgpm-jwt-claims--0.15.5.sql
3
3
 
4
4
  PG_CONFIG = pg_config
5
5
  PGXS := $(shell $(PG_CONFIG) --pgxs)
@@ -0,0 +1,18 @@
1
+ -- Deploy schemas/jwt_private/procedures/current_session_id to pg
2
+ -- Retrieves the current session ID from JWT claims (private/internal use)
3
+
4
+ -- requires: schemas/jwt_private/schema
5
+
6
+ BEGIN;
7
+
8
+ -- Returns the current session UUID from the JWT claims
9
+ -- Used for session tracking, revocation, and audit logging
10
+ -- This is kept private to prevent session IDs from being exposed to the frontend
11
+ CREATE FUNCTION jwt_private.current_session_id()
12
+ RETURNS uuid
13
+ AS $$
14
+ SELECT nullif(current_setting('jwt.claims.session_id', true), '')::uuid;
15
+ $$
16
+ LANGUAGE 'sql' STABLE;
17
+
18
+ COMMIT;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpm/jwt-claims",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "JWT claim handling and validation functions",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "contributors": [
@@ -21,11 +21,11 @@
21
21
  "test:watch": "jest --watch"
22
22
  },
23
23
  "devDependencies": {
24
- "pgpm": "^1.3.0"
24
+ "pgpm": "^4.2.3"
25
25
  },
26
26
  "dependencies": {
27
- "@pgpm/types": "0.17.0",
28
- "@pgpm/verify": "0.17.0"
27
+ "@pgpm/types": "0.19.0",
28
+ "@pgpm/verify": "0.19.0"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
@@ -35,5 +35,5 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/constructive-io/pgpm-modules/issues"
37
37
  },
38
- "gitHead": "8eb8b9e3a6784fb45a3a9e86838f8417f061925c"
38
+ "gitHead": "83be2dd4b07831c8c4f903437d20d350a673d19b"
39
39
  }
@@ -1,6 +1,6 @@
1
1
  # pgpm-jwt-claims extension
2
2
  comment = 'pgpm-jwt-claims extension'
3
- default_version = '0.15.3'
3
+ default_version = '0.15.5'
4
4
  module_pathname = '$libdir/pgpm-jwt-claims'
5
5
  requires = 'plpgsql,uuid-ossp,pgpm-types,pgpm-verify'
6
6
  relocatable = false
package/pgpm.plan CHANGED
@@ -16,3 +16,4 @@ schemas/jwt_public/procedures/current_origin [schemas/jwt_public/schema] 2017-08
16
16
  schemas/jwt_private/schema 2020-12-17T06:47:34Z Dan Lynch <dlynch@Dans-MBP-3> # add schemas/jwt_private/schema
17
17
  schemas/jwt_private/procedures/current_database_id [schemas/jwt_private/schema] 2020-12-17T23:22:28Z Dan Lynch <dlynch@Dans-MBP-3> # add schemas/jwt_private/procedures/current_database_id
18
18
  schemas/jwt_private/procedures/current_token_id [schemas/jwt_private/schema] 2017-08-11T08:11:51Z skitch <skitch@5b0c196eeb62> # add schemas/jwt_private/procedures/current_token_id
19
+ schemas/jwt_private/procedures/current_session_id [schemas/jwt_private/schema] 2026-01-28T05:44:00Z Dan Lynch <dlynch@constructive.io> # add schemas/jwt_private/procedures/current_session_id
@@ -0,0 +1,7 @@
1
+ -- Revert schemas/jwt_private/procedures/current_session_id from pg
2
+
3
+ BEGIN;
4
+
5
+ DROP FUNCTION jwt_private.current_session_id;
6
+
7
+ COMMIT;
@@ -140,4 +140,8 @@ $EOFCODE$ LANGUAGE plpgsql STABLE;
140
140
 
141
141
  CREATE FUNCTION jwt_private.current_token_id() RETURNS uuid AS $EOFCODE$
142
142
  SELECT nullif(current_setting('jwt.claims.token_id', true), '')::uuid;
143
- $EOFCODE$ LANGUAGE sql STABLE;
143
+ $EOFCODE$ LANGUAGE sql STABLE;
144
+
145
+ CREATE FUNCTION jwt_private.current_session_id() RETURNS uuid AS $EOFCODE$
146
+ SELECT nullif(current_setting('jwt.claims.session_id', true), '')::uuid;
147
+ $EOFCODE$ LANGUAGE sql STABLE;
@@ -0,0 +1,7 @@
1
+ -- Verify schemas/jwt_private/procedures/current_session_id on pg
2
+
3
+ BEGIN;
4
+
5
+ SELECT verify_function ('jwt_private.current_session_id');
6
+
7
+ ROLLBACK;