Skip to content

feat(auth): defer jose + lazy secretStore/stepUp for Ready density - #1403

Merged
cursor[bot] merged 5 commits into
mainfrom
cursor/gateway-auth-ready-lazy-a621
Oct 26, 2026
Merged

cursor[bot] merged 5 commits into
mainfrom
cursor/gateway-auth-ready-lazy-a621

Conversation

@danielsmithdevelopment

Copy link
Copy Markdown
Owner

Summary

Next Ready density lever after tools/auth thin (#1402):

  • jose: loaded via createRequire on first OIDC verify; tsup marks jose external so gateway chunks do not inline it
  • createClawQLAuth: secretStore / stepUp are lazy getters (construct on first access) — equal-arm apiKey/noAuth listen does not open SQLite or build TOTP store layers
  • clawql-auth/gateway: re-exports stores from resolve / types only (avoids stores barrel side effects)

Remasure (Bun --smol, N=2k equal-arm)

Arm Anon median
Catalog-on ~125.2 MB (JSON)
Catalog-off ~124.2 MB (JSON)

Noise band vs tools-auth tip (~124.6 MB). Structural win for oidc-off Ready and for avoiding SQLite/TOTP construct at listen.

Stack

Based on cursor/tools-auth-ready-lazy-a621 (#1402) so dashboard sources import + OSV body-parser/fast-uri bumps are included.

Next (not in this PR)

createClawQLAuth still statically imports ./step-up + ./api-keys (lazy getters defer construct only). Candidate: createRequire / dynamic load for those modules.

Test plan

  • npm run build -w clawql-auth — jose via createRequire in gateway chunk
  • vitest clawql-auth — 194 tests pass
  • Remasure JSON + memory-plateau.md updated
  • CI green on this branch
Open in Web Open in Cursor 

@cursor
cursor Bot force-pushed the cursor/gateway-auth-ready-lazy-a621 branch from 72a029e to 05d8ede Compare October 23, 2026 22:27
@cursor
cursor Bot changed the base branch from cursor/tools-auth-ready-lazy-a621 to main October 23, 2026 22:27
cursoragent and others added 5 commits October 26, 2026 06:24
OIDC verify loads jose via createRequire on first use; tsup keeps jose
external. createClawQLAuth exposes secretStore/stepUp as lazy getters so
equal-arm apiKey/noAuth listen does not open SQLite or build TOTP layers.
Gateway barrel exports stores from resolve/types only.

Co-authored-by: Daniel Smith <danielsmithdevelopment@gmail.com>
Equal-arm catalog-on ~125.2 MB / catalog-off ~124.2 MB — noise vs tools-auth
~124.6 MB tip; structural defer for oidc-off Ready documented.

Co-authored-by: Daniel Smith <danielsmithdevelopment@gmail.com>
Co-authored-by: Daniel Smith <danielsmithdevelopment@gmail.com>
Co-authored-by: Daniel Smith <danielsmithdevelopment@gmail.com>
@cursor
cursor Bot force-pushed the cursor/gateway-auth-ready-lazy-a621 branch from 841550b to 080cf1c Compare October 26, 2026 06:24
@cursor
cursor Bot merged commit 746a53b into main Oct 26, 2026
24 checks passed
@cursor
cursor Bot deleted the cursor/gateway-auth-ready-lazy-a621 branch October 26, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants