@authhero/drizzle 1.4.1 → 1.5.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.
@@ -43,6 +43,20 @@
43
43
  "when": 1786446917782,
44
44
  "tag": "0005_page_hooks",
45
45
  "breakpoints": true
46
+ },
47
+ {
48
+ "idx": 6,
49
+ "version": "6",
50
+ "when": 1787240699556,
51
+ "tag": "0006_refresh_token_session_id",
52
+ "breakpoints": true
53
+ },
54
+ {
55
+ "idx": 7,
56
+ "version": "6",
57
+ "when": 1787240700556,
58
+ "tag": "0007_refresh_token_session_id_backfill",
59
+ "breakpoints": true
46
60
  }
47
61
  ]
48
62
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "1.4.1",
14
+ "version": "1.5.0",
15
15
  "files": [
16
16
  "dist",
17
17
  "src/schema",
@@ -35,8 +35,8 @@
35
35
  "dependencies": {
36
36
  "drizzle-orm": "^0.45.2",
37
37
  "nanoid": "^5.1.11",
38
- "@authhero/adapter-interfaces": "4.8.0",
39
- "@authhero/proxy": "0.10.6"
38
+ "@authhero/adapter-interfaces": "4.9.0",
39
+ "@authhero/proxy": "0.10.8"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@hono/zod-openapi": "^1.4.0",
@@ -44,6 +44,17 @@ export const refreshTokens = sqliteTable(
44
44
  .references(() => tenants.id, { onDelete: "cascade" }),
45
45
  client_id: text("client_id", { length: 191 }).notNull(),
46
46
  login_id: text("login_id", { length: 26 }).notNull(),
47
+ // Auth0's `session_id`. Intentionally NOT a foreign key: the session is
48
+ // expected to be cleaned up before the token, so this pointer is allowed
49
+ // to dangle. Carries revocation semantics only, never cascade delete.
50
+ session_id: text("session_id", { length: 26 }),
51
+ // Auth-event facts denormalised from the login session at mint time.
52
+ organization: text("organization", { length: 191 }),
53
+ auth_connection: text("auth_connection", { length: 255 }),
54
+ auth_strategy_strategy: text("auth_strategy_strategy", { length: 64 }),
55
+ auth_strategy_strategy_type: text("auth_strategy_strategy_type", {
56
+ length: 64,
57
+ }),
47
58
  user_id: text("user_id", { length: 255 }),
48
59
  resource_servers: text("resource_servers").notNull(),
49
60
  device: text("device").notNull(),
@@ -72,6 +83,11 @@ export const refreshTokens = sqliteTable(
72
83
  table.token_lookup,
73
84
  ),
74
85
  index("idx_refresh_tokens_family_id").on(table.tenant_id, table.family_id),
86
+ // Backs the one-hop revoke cascade: session revoked -> its tokens revoked.
87
+ index("idx_refresh_tokens_session_id").on(
88
+ table.tenant_id,
89
+ table.session_id,
90
+ ),
75
91
  ],
76
92
  );
77
93