cursedauth 0.9.0 → 0.9.1

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.
Files changed (70) hide show
  1. package/dist/_bunOnly.d.ts +2 -0
  2. package/dist/_bunOnly.d.ts.map +1 -0
  3. package/dist/_bunOnly.js +11 -0
  4. package/dist/_bunOnly.js.map +1 -0
  5. package/dist/account/AccountMenu.d.ts +2 -2
  6. package/dist/account/AccountMenu.d.ts.map +1 -1
  7. package/dist/account/AccountMenu.js +8 -8
  8. package/dist/account/AccountMenu.js.map +1 -1
  9. package/dist/account/AccountNotice.d.ts +1 -1
  10. package/dist/account/AccountNotice.d.ts.map +1 -1
  11. package/dist/account/AccountNotice.js +3 -3
  12. package/dist/account/AccountNotice.js.map +1 -1
  13. package/dist/account/accountNotice.state.d.ts +1 -1
  14. package/dist/account/accountNotice.state.d.ts.map +1 -1
  15. package/dist/account/accountNotice.state.js +2 -2
  16. package/dist/account/accountNotice.state.js.map +1 -1
  17. package/dist/accountSlot.client.d.ts +1 -1
  18. package/dist/accountSlot.client.d.ts.map +1 -1
  19. package/dist/accountSlot.client.js +1 -1
  20. package/dist/accountSlot.client.js.map +1 -1
  21. package/dist/auth.d.ts +1 -1
  22. package/dist/auth.d.ts.map +1 -1
  23. package/dist/auth.js +3 -3
  24. package/dist/auth.js.map +1 -1
  25. package/dist/auth.server.js +1 -1
  26. package/dist/auth.server.js.map +1 -1
  27. package/dist/contentCensus.d.ts +1 -1
  28. package/dist/contentCensus.d.ts.map +1 -1
  29. package/dist/d1Stores.d.ts +4 -4
  30. package/dist/d1Stores.d.ts.map +1 -1
  31. package/dist/d1Stores.js +3 -3
  32. package/dist/d1Stores.js.map +1 -1
  33. package/dist/index.d.ts +8 -8
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +7 -7
  36. package/dist/index.js.map +1 -1
  37. package/dist/ssoAutoSignIn.js +2 -2
  38. package/dist/ssoAutoSignIn.js.map +1 -1
  39. package/dist/ssoConsumer.server.d.ts +3 -3
  40. package/dist/ssoConsumer.server.d.ts.map +1 -1
  41. package/dist/ssoConsumer.server.js +6 -6
  42. package/dist/ssoConsumer.server.js.map +1 -1
  43. package/dist/ssoTestHarness.d.ts +1 -1
  44. package/dist/ssoTestHarness.d.ts.map +1 -1
  45. package/dist/ssoTestHarness.js +2 -2
  46. package/dist/ssoTestHarness.js.map +1 -1
  47. package/dist/userSessions.core.d.ts +1 -1
  48. package/dist/userSessions.core.d.ts.map +1 -1
  49. package/dist/userSessions.core.js +4 -4
  50. package/dist/userSessions.core.js.map +1 -1
  51. package/dist/userSessions.d.ts +2 -2
  52. package/dist/userSessions.d.ts.map +1 -1
  53. package/dist/userSessions.js +2 -2
  54. package/dist/userSessions.js.map +1 -1
  55. package/package.json +4 -4
  56. package/src/_bunOnly.ts +13 -0
  57. package/src/account/AccountMenu.tsx +8 -8
  58. package/src/account/AccountNotice.tsx +5 -5
  59. package/src/account/accountNotice.state.ts +3 -3
  60. package/src/accountSlot.client.ts +1 -1
  61. package/src/auth.server.ts +1 -1
  62. package/src/auth.ts +3 -3
  63. package/src/contentCensus.ts +1 -1
  64. package/src/d1Stores.ts +4 -4
  65. package/src/index.ts +8 -8
  66. package/src/ssoAutoSignIn.ts +2 -2
  67. package/src/ssoConsumer.server.ts +7 -7
  68. package/src/ssoTestHarness.ts +2 -2
  69. package/src/userSessions.core.ts +4 -4
  70. package/src/userSessions.ts +2 -2
package/src/index.ts CHANGED
@@ -30,7 +30,7 @@ export {
30
30
  type SsoConsumer,
31
31
  type SsoConsumerOptions,
32
32
  type SsoUser,
33
- } from "./ssoConsumer.server";
33
+ } from "./ssoConsumer.server.js";
34
34
  export {
35
35
  createSqliteSessionRows,
36
36
  createUserSessionStore,
@@ -45,7 +45,7 @@ export {
45
45
  type UserSessionStore,
46
46
  type UserSessionStoreCoreOptions,
47
47
  type UserSessionStoreOptions,
48
- } from "./userSessions";
48
+ } from "./userSessions.js";
49
49
  /*
50
50
  * The `sso_users` seam. 🔴 `cursedauth/d1-stores` is deliberately NOT re-exported from
51
51
  * this barrel: it has no reason to be here (a Worker cannot import this file at all —
@@ -59,7 +59,7 @@ export {
59
59
  SSO_USERS_DDL,
60
60
  type SsoUserRow,
61
61
  type SsoUserStore,
62
- } from "./ssoUsers";
62
+ } from "./ssoUsers.js";
63
63
  export {
64
64
  DEFAULT_GATE_PATH,
65
65
  type GatedMountPlan,
@@ -67,14 +67,14 @@ export {
67
67
  type Mounter,
68
68
  mountGatedApp,
69
69
  type SessionGate,
70
- } from "./mountGatedApp";
71
- export { type CensusCounter, countingCensus, sharedCensus } from "./contentCensus";
70
+ } from "./mountGatedApp.js";
71
+ export { type CensusCounter, countingCensus, sharedCensus } from "./contentCensus.js";
72
72
  export {
73
73
  LOCAL_AUTH_URL,
74
74
  STAGE_IDENTITY_ENV,
75
75
  stageIdentityIsLocal,
76
- } from "./stageIdentity";
77
- export type { ContentCensus, ContentCensusUser } from "./sso";
76
+ } from "./stageIdentity.js";
77
+ export type { ContentCensus, ContentCensusUser } from "./sso.js";
78
78
  /*
79
79
  * The bearer-token half of the boundary. `getSessionClaims` was the only piece this
80
80
  * barrel published until 2026-09-15, because the four apps graduated before `roms`
@@ -98,4 +98,4 @@ export {
98
98
  SESSION_CLAIMS_KEY,
99
99
  type SessionClaims,
100
100
  type SessionVerifier,
101
- } from "./auth.server";
101
+ } from "./auth.server.js";
@@ -52,8 +52,8 @@
52
52
  * from `ssoConsumer.server.ts`: that module pulls in `bun:sqlite` and hono,
53
53
  * and this one runs in a browser. `ssoAutoSignIn.test.ts` pins them equal. */
54
54
  import { useEffect, useRef, useState } from "react";
55
- import { currentAccountSlot } from "./accountSlot.client";
56
- import { ACCOUNT_SLOT_PARAM } from "./accountSlots";
55
+ import { currentAccountSlot } from "./accountSlot.client.js";
56
+ import { ACCOUNT_SLOT_PARAM } from "./accountSlots.js";
57
57
 
58
58
  export const SSO_START_PATH = "/api/auth/sso/start";
59
59
  /**
@@ -31,10 +31,10 @@ import type { KeyObject } from "node:crypto";
31
31
  import { createPublicKey } from "node:crypto";
32
32
  import type { Database } from "bun:sqlite";
33
33
  import type { Context, Hono, MiddlewareHandler, Next } from "hono";
34
- import { stageIdentityIsLocal } from "./stageIdentity";
35
- import { SESSION_CLAIMS_KEY, type SessionClaims } from "./auth.server";
36
- import { isSecureRequest } from "./secureRequest";
37
- import { createSqliteSsoUserStore, type SsoUserRow, type SsoUserStore } from "./ssoUsers";
34
+ import { stageIdentityIsLocal } from "./stageIdentity.js";
35
+ import { SESSION_CLAIMS_KEY, type SessionClaims } from "./auth.server.js";
36
+ import { isSecureRequest } from "./secureRequest.js";
37
+ import { createSqliteSsoUserStore, type SsoUserRow, type SsoUserStore } from "./ssoUsers.js";
38
38
  import {
39
39
  CENSUS_MAX_SUBJECTS,
40
40
  type ContentCensus,
@@ -47,7 +47,7 @@ import {
47
47
  verifyGrant,
48
48
  verifyRevocation,
49
49
  verifySessionsRequest,
50
- } from "./sso";
50
+ } from "./sso.js";
51
51
  import {
52
52
  ACCOUNT_DRIFT_STATUS,
53
53
  accountDriftBody,
@@ -55,8 +55,8 @@ import {
55
55
  MAX_ACCOUNT_SLOTS,
56
56
  normalizeSlot,
57
57
  withSlot,
58
- } from "./accountSlots";
59
- import type { UserSessionStore } from "./userSessions";
58
+ } from "./accountSlots.js";
59
+ import type { UserSessionStore } from "./userSessions.js";
60
60
 
61
61
  export const SSO_CALLBACK_PATH = "/api/auth/sso/callback";
62
62
  export const SSO_START_PATH = "/api/auth/sso/start";
@@ -14,8 +14,8 @@
14
14
  * app had copied.
15
15
  */
16
16
  import type { Hono } from "hono";
17
- import { generateSsoKeyPair, mintGrant, type SsoKeyPair } from "./sso";
18
- import { SSO_CALLBACK_PATH } from "./ssoConsumer.server";
17
+ import { generateSsoKeyPair, mintGrant, type SsoKeyPair } from "./sso.js";
18
+ import { SSO_CALLBACK_PATH } from "./ssoConsumer.server.js";
19
19
 
20
20
  /** A user as the accounts satellite would know them — the shape grants are minted from. */
21
21
  export interface SeededTestUser {
@@ -65,22 +65,22 @@ import {
65
65
  normalizeSlot,
66
66
  slotCookieName,
67
67
  slotFromUrl,
68
- } from "./accountSlots";
68
+ } from "./accountSlots.js";
69
69
  import {
70
70
  clientAddressOf,
71
71
  clientFactsOf,
72
72
  clientUserAgentOf,
73
73
  describePlace,
74
74
  type PlaceLookup,
75
- } from "./clientDescription";
75
+ } from "./clientDescription.js";
76
76
  // 🔴 The compare, not a copy of it. This module carried its OWN `constantTimeEqual`
77
77
  // until 2026-09-17 — a `node:crypto` `timingSafeEqual` with both sides padded to a
78
78
  // common length — while `constantTime.ts` sat two files away with the same contract.
79
79
  // That made an eighth copy of this primitive inside the very package that publishes
80
80
  // it. Both forms were correct; neither knew about the other, which is the whole
81
81
  // failure mode.
82
- import { constantTimeEqual } from "./constantTime";
83
- import { isSecureRequest } from "./secureRequest";
82
+ import { constantTimeEqual } from "./constantTime.js";
83
+ import { isSecureRequest } from "./secureRequest.js";
84
84
 
85
85
  /**
86
86
  * One row of the `sessions` table, as both implementations hand it over.
@@ -35,7 +35,7 @@ import {
35
35
  type SessionRows,
36
36
  type UserSessionStore,
37
37
  type UserSessionStoreCoreOptions,
38
- } from "./userSessions.core";
38
+ } from "./userSessions.core.js";
39
39
 
40
40
  export {
41
41
  createUserSessionStoreOver,
@@ -48,7 +48,7 @@ export {
48
48
  type SlotOccupant,
49
49
  type UserSessionStore,
50
50
  type UserSessionStoreCoreOptions,
51
- } from "./userSessions.core";
51
+ } from "./userSessions.core.js";
52
52
 
53
53
  export interface UserSessionStoreOptions extends UserSessionStoreCoreOptions {
54
54
  dbPath: string;