Skip to content

Make auth setup storage-aware and support existing Postgres clients - #34

Open
absolutejs wants to merge 18 commits into
mainfrom
fix/storage-aware-setup
Open

absolutejs wants to merge 18 commits into
mainfrom
fix/storage-aware-setup

Conversation

@absolutejs

Copy link
Copy Markdown
Owner

Auth installation previously required DATABASE_URL and ran migrations even when memory sessions were selected. Setup now reads the explicit adapter choice, skips migrations only for memory storage, and fails clearly when persistent storage lacks configuration. The Neon adapter is labeled accurately.

Adds createPostgresAuthSessionStore for existing Drizzle PostgreSQL clients while preserving the Neon convenience API. Released as 0.80.0.

Validation: full package gate passed (616 tests, four environment-dependent skips, types, lint, build and package verification). Separately ran the real PostgreSQL integration test: credentials and sessions survived closing and reopening the driver. Storage setup tests cover missing, unknown, memory and persistent configuration.

absolutejs and others added 15 commits August 27, 2026 23:23
The linked-provider resolver marked a grant `revoked` and its binding
`disconnected` the moment a call reported `unauthorized`, then refused to
resolve at all. That is right for a sign-in identity, where nothing works
again until the person authorizes. It is wrong for a connector: those calls
fail because an app installation was dropped from a repository or a project
was unshared, and shutting the connection over one refusal fixes nothing,
because the credential was never the problem.

`failurePolicy: 'record'` writes the same failure detail and leaves both
statuses alone. The default stays `latch`.

Also exports what a consumer needs to hold these rows in a database it
already has: the two store constructors (renamed off `Neon`, since neither
is Neon-specific — the Neon helpers are the ones that open a connection),
the table definitions, and the resolver's option and refresh types.
These are instants — `Date.now()` in, `getTime()` out — and a `timestamp
without time zone` cannot hold one. The driver writes a Date as its UTC wall
clock and reads a naive value back as local, so a process outside UTC gets
every one of them back shifted by its own offset.

On a token expiry that is not a display problem. A grant reads as good for
hours after it died, so nothing refreshes and every call in between is
refused — with no clue in the data, which says the token is fine.

A consumer whose tables already exist converts with the zone the values were
written in: ALTER ... TYPE timestamptz USING <column> AT TIME ZONE 'UTC'.
Changes are written as typed entries under changelog/unreleased/ and released
with `absolute-changelog release`, which writes changelog.json for programs and
a generated CHANGELOG.md for people and ships both in the package. The gate in
check:package reconciles the entries against this package's own published types
at release time, so an export that moves without an entry stops the release.

Whatever CHANGELOG.md said before is kept verbatim as changelog/history.md and
printed under "Earlier releases" — history stays history, and nothing here
invents structured entries out of prose somebody already wrote.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01YLTtukf66SFhQoMdVNJVDu
`check:package` is a chain somebody chooses to run. `prepublishOnly` is one npm
and bun run themselves, whatever started the publish — a release script, a bare
`npm publish`, a CI job, somebody in a hurry at the end of a day. A rule that
can be walked around eventually is.

Also moves to @absolutejs/changelog 0.2.0, whose gate compares against the
newest version the registry actually has rather than the one in package.json.
Between `release` and `publish` those differ, and asking the registry for a
version nobody can fetch got nothing back and passed — the check went quiet at
the one moment it exists for.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01YLTtukf66SFhQoMdVNJVDu
0.4.0, after three adversarial reviews of it. The two that matter here:

The surface it compares was every name declared anywhere under dist, not what
this package actually exports — so withdrawing a name from an entry point,
which is one of the most ordinary breaking changes there is, was invisible.
It now walks the export graph from the entry points this manifest declares.

And it passed when it had not checked: no dist, a dist under another name,
types as .d.mts, a registry that would not answer. Each of those is a failure
now, with --offline as the way to say you meant it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01YLTtukf66SFhQoMdVNJVDu
0.4.0, after three adversarial reviews of it. The two that matter here:

The surface it compares was every name declared anywhere under dist, not what
this package actually exports — so withdrawing a name from an entry point,
which is one of the most ordinary breaking changes there is, was invisible.
It now walks the export graph from the entry points this manifest declares.

And it passed when it had not checked: no dist, a dist under another name,
types as .d.mts, a registry that would not answer. Each of those is a failure
now, with --offline as the way to say you meant it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01YLTtukf66SFhQoMdVNJVDu
`bun publish` runs lifecycle scripts without `node_modules/.bin` on the PATH,
so `prepublishOnly: "absolute-changelog check"` was `command not found` — the
gate meant to make a publish unskippable made it impossible, in ninety-five
packages at once. It went unnoticed because the one package publishing during
that window invokes its own source rather than the binary.

It runs `bun run check:package` now, which resolves the binary and, being the
whole chain, closes the other half of the same hole: a publish that skipped
`check:package` was skipping the typecheck, the lint, the tests and the build
with it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01YLTtukf66SFhQoMdVNJVDu
Release 0.79.0 with distinct default token endpoints, configuration validation, and regression coverage for both plugin orders.
Distinguish reconnect, retry, and provider configuration failures; persist safe recovery metadata and clear it after successful refresh.

Co-authored-by: Codex <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 50812057-7f46-4389-a31c-049bbf5577d0


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

absolutejs and others added 3 commits September 21, 2026 23:04
Use atomic, durable timed budgets with independent recovery attempts and single-use recovery consumption. Add the MFA migration, regression coverage, and declaration build support.

Co-authored-by: Codex <[email protected]>
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.

1 participant