r/adonisjs • • 4d ago

Sharing 10 pre-release AdonisJS 7 packages I've been building. Looking for API & DX feedback before npm

I've been building an AdonisJS 7 app and kept extracting the plumbing I didn't want to rewrite or get subtly wrong: password resets, session revocation, team role matrices, operator impersonation, soft deletes, SQLite backups, idempotent writes, etc.

These are still pre-release (distributed as GitHub release .tgz archives, not published to npm yet). Honestly, if I don't draw a line and share them now, I'll tinker on them forever, so right at the end of the day, I'm putting them out for Show Off Sunday to get eyes on the APIs and hear what feels right (or awkward) to other AdonisJS 7 devs.

Account & Auth (headless - keep your user model, routes, and UI)

  • Account Kit (v0.12.0):
    • Password reset, signup & email verification, invitations, account settings, magic links, tracked sessions (with sliding + absolute lifetimes and admin revocation), password screening, and optional social linking.
    • Handles the transaction, locking, and token edge cases while leaving routes and UI to your app.
  • Account Admission (v0.2.0):
    • Domain allowlists, invite evidence, and approval queues on top of Account Kit.
  • Access Control (v0.6.0):
    • Team/workspace memberships and a ranked role matrix with compile-time resource:operation permission keys, atomic ownership transfer, scope middleware, and Bouncer abilities.
  • Masquerade (v0.9.0):
    • Server-side operator impersonation without logging in as the target user.
    • Read-only by default, explicit edit approval, sensitive route blocking, audit ledger, and support for both sessions and opaque access tokens.
  • Confirm Action with Password (v0.8.0):
    • Short-lived, single-use password re-confirmation bound to the session, credential revision, operation, and request payload, spent in the same transaction as the protected write.

Lucid & SQLite

  • Lucid Soft Delete (v0.5.0):
    • withSoftDeletes mixin for AdonisJS 7 Lucid models. Handles OR-predicate wrapping, relation subqueries, group limits, and transactional bulk receipts, tested across SQLite, PostgreSQL, and MySQL.
  • Lucid Checked Columns (v0.5.0):
    • u/column helpers for JSON, ISO date, and ISO timestamp columns that validate on both write (prepare) and read (consume) so corrupt rows fail loudly.
  • SQLite Backup (v0.6.0):
    • Verified, immutable online SQLite backup bundles (db:backup, db:upgrade) with integrity/foreign-key checks and prepare-only restore.

HTTP & Reliability

  • Request Deduplication (v0.5.0):
    • Idempotency guard for AdonisJS 7 + SQLite: reserves a receipt inside the same transaction as your writes so double-clicks/retries return the first result and failed writes retry fresh.
  • Origin Guard (v0.5.0):
    • Stateless cross-site write protection using Origin and Sec-Fetch-Site headers (no tokens to issue), plus origin parsing and private-peer helpers.

(There's also a companion Starter Examples repo showing them wired into Edge, Inertia Vue/React, and API apps.)

Design goals across the set

  • Built specifically for AdonisJS 7 (Node 24+, Lucid 22, TypeScript 5.9/6).
  • Fail-closed defaults and real-database integration tests (SQLite, plus PostgreSQL/MySQL on the packages that target them), plus packed-consumer smoke tests in CI.
  • Scoped test fakes using using (fakeAccountKit, fakeMasquerade, fakeAdmission, fakePasswordConfirmations, fakeSqliteBackup) so app tests don't need to monkey-patch booted services.

Looking for feedback on

  • Does anything in the APIs, ace configure flow, or naming feel un-idiomatic for AdonisJS 7?
  • Which of these would you actually want on npm first, and what's missing before you'd trust it in a real project?
  • Where have I just got things wrong?

Thanks folks.

8 Upvotes

1 comment sorted by

1

u/web-dev-kev 2d ago

Quick update: security hardening & new features across the repos

The joy of actually releasing/announcing these repo's led to 48 hours of panic of how I the code might be judged. So since posting, every repo has been through three passes:

  • OWASP security review across the whole suite (plus repeatable security scans in CI)
  • Implicit state review & fixes to tighten up lifecycle, locking, and transaction edge cases
  • Updated my AdonisJS convention skill (plus the mechanical check script in code-conventions) to better match Friends of AdonisJS (y'all are awesome)

---

Here are the highlights worth knowing if you’re thinking of using any of these (and sorry it's quite bullet-pointy, its how my brain documents so i can scan easier):

  • Account Kit (v0.16.0):

    • Safer defaults out of the box:

      • bearer tokens now default to a 1-hour expiry with no abilities unless you opt in,
      • new setups block common passwords by default.
    • Option to hide whether an email is already registered on signup.
    • Users can immediately request a fresh activation link if signup email delivery fails.
    • "Sign out everywhere" now also clears pending magic links, social sign-ins, and browser sessions.
  • Account Admission (v0.8.0):

    • Much more flexible invite flows:

      • auto-approve invited users when they accept,
      • or record invites as optional evidence without making them mandatory.
    • Tracks whether an approval came from a user or an operator command, even if that approver is later deleted.
  • Access Control (v0.9.1):

    • Can now strictly require Account Admission for invites (instead of silently skipping if not registered).
    • Owners can manage or remove memberships that still hold old/retired roles.
  • Masquerade (v0.12.2):

    • Context token enforcement is on by default for new setups.
    • New masquerade:routes --verify command to catch unprotected routes.
    • New helper to check a support edit session is still active inside your write transaction.
  • Confirm Action with Password (v0.11.1):

    • Requires an authorisation policy by default (or an explicit opt-out if your app handles it).

Dogfooding note (coming next in Account Kit):

Using these in a real app caught a UX rough edge: Account Kit’s strict email verification (built to prevent pre-registration hijacking for OWASP compliance) asks users to set a password on the verification link, which feels clunky if they already entered one on signup.

Right now an email-first signup flow avoids that, and we’re adding opt-in confirm-only email verification (plus first-class email-first registration) in #1104, which should land this week.

  • Request Deduplication (v0.8.0):

    • Control who’s allowed to see a replayed response (and redact sensitive fields on replay),
  • SQLite Backup (v0.9.0):

    • Opt-in Ed25519 signing for backups.
    • Pruning now verifies your backups before deleting older ones, so a corrupted backup never pushes out a good one.