Skip to content
pegma-devPublic

About

First-party identity for Pegma hosts: passkeys-first, email-code fallback, no passwords - user records over storage-core, no external provider.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Identity

License: MIT

First-party identity for Pegma hosts: passkeys-first, email-code fallback, no passwords — user records in your own storage, no external provider.

Important

@pegma/identity@0.1.0 is the first advertised supported release, published from the protected signed v0.1.0 tag through trusted-publisher OIDC. Its public API remains unstable. pegma.dev composes it in production with Sessions, Mail, durable Rate Limit policies, and @pegma/authorization-identity@0.1.2.

What it is — and refuses to be

It answers one question: who is this, and how do they prove it? Account creation, passkey sign-in, email one-time codes for enrollment/fallback/ recovery, email change — issuing verified identity claims the host turns into a session (@pegma/sessions) and links into @pegma/authorization-core through a deliberately tiny adapter.

Refused, loudly:

  • Passwords. Not a phase — a refusal. No password table, no reset flow, no breach class. Passkeys are phishing-resistant and breach-inert; an emailed code covers everything else.
  • Being an OIDC/OAuth2 server for third parties. That is a product with a standards surface, not a component.
  • Social login. External providers exist for that; issuer-namespaced identity links already let a host run both side by side.
  • MFA beyond passkey + email, profiles, admin UIs, org management.

One honest admission, stated rather than buried: an account recoverable by emailed code is exactly as secure as the mailbox behind it. Every consumer service works this way; almost none say it. We say it.

Passkey lifecycle settings

Identity keeps passkey enrollment and removal bounded in storage. The default settings allow 10 active or in-flight credentials and 20 retained credential records per principal. Completed registration proofs become eligible for collection after 24 hours; proofs and capacity reservations for registrations that did not complete are collected after the same grace period once no credential record references them. Revoked credential records remain for 30 days before collection. Hosts may set the active limit from 1 to 64 and the retained limit from the active limit through 128. Proof and revoked-record retention accept positive millisecond values up to 30 and 365 days, respectively. Configure them with passkeyMaxActiveCredentials, passkeyMaxRetainedCredentials, passkeyRegistrationProofRetentionMs, and passkeyTombstoneRetentionMs.

Run sweepPasskeys() to collect eligible registration proofs, expired revoked records, and abandoned reservations. Persist and pass its cursor until hasMore is false, as with sweepChallenges(). A limit_exceeded IdentityError is returned when a principal has reached a configured credential limit.

Development

npm install -g corepack
corepack enable
pnpm install --frozen-lockfile

The gate runs on Node.js 22 and 24, where Corepack is bundled. On Node 25 or newer, install Corepack before enabling it.

See CONTRIBUTING.md for the complete gate.

License

MIT © RetireGolden, LLC

About

First-party identity for Pegma hosts: passkeys-first, email-code fallback, no passwords - user records over storage-core, no external provider.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages