@madauth/server 0.3.0-beta.2 → 0.4.0-beta.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.
@@ -1,5 +1,5 @@
1
1
  import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
2
- import { S as StoreAdapter } from '../schema-3yhCc2jH.js';
2
+ import { S as StoreAdapter } from '../schema-DTeiSuQB.js';
3
3
 
4
4
  interface DynamoDbAdapterOptions {
5
5
  /** The table, with the partition key `pk` and the sort key `sk` (both strings). */
@@ -1,4 +1,4 @@
1
- import { S as StoreAdapter } from '../schema-3yhCc2jH.js';
1
+ import { S as StoreAdapter } from '../schema-DTeiSuQB.js';
2
2
 
3
3
  /**
4
4
  * Stores madAuth's records in a SQLite file using Node's built-in `node:sqlite` (Node 22.13 or newer).
package/dist/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as StoreAdapter } from './schema-3yhCc2jH.js';
1
+ import { S as StoreAdapter } from './schema-DTeiSuQB.js';
2
2
 
3
3
  /** The parts of a test runner the contract needs; Vitest, Jest and node:test with `expect` all fit. */
4
4
  interface ContractRunner {
package/dist/testing.js CHANGED
@@ -29,6 +29,8 @@ function testAccount(overrides = {}) {
29
29
  failedAttempts: 0,
30
30
  lockedUntil: 0,
31
31
  email: null,
32
+ lastUsedStep: 0,
33
+ setupId: null,
32
34
  createdAt: 17e11,
33
35
  ...overrides
34
36
  };
@@ -7,6 +7,11 @@ interface MadauthUser {
7
7
  picture?: string;
8
8
  /** What admins attached to the user, e.g. `{ roles: ['admin'] }`. Absent without claims. */
9
9
  claims?: Record<string, unknown>;
10
+ /**
11
+ * How this session was authenticated (RFC 8176): `pwd` (password), `google`, `otp` (the authenticator
12
+ * app, on its own or as the second factor), e.g. `['pwd', 'otp']`. Present on a user that comes with a session.
13
+ */
14
+ amr?: string[];
10
15
  }
11
16
 
12
17
  export type { MadauthUser as M };
package/dist/verify.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JWTVerifyGetKey } from 'jose';
2
- import { M as MadauthUser } from './user-BMWEWREH.js';
2
+ import { M as MadauthUser } from './user-BZs84sui.js';
3
3
 
4
4
  interface SessionVerifierOptions {
5
5
  /** The madAuth server's public base URL (its MADAUTH_ISSUER). */
package/dist/verify.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  SESSION_COOKIE,
3
3
  SESSION_TYP,
4
4
  userFromClaims
5
- } from "./chunk-DCDTO5LG.js";
5
+ } from "./chunk-A7UYZRBL.js";
6
6
  import {
7
7
  SIGNING_ALG
8
8
  } from "./chunk-JDQLSL36.js";
@@ -1,5 +1,5 @@
1
1
  /** Every `type` madAuth sends. */
2
- declare const WEBHOOK_TYPES: readonly ["email.verify", "email.reset", "email.already_registered", "email.no_password", "signup.before", "user.created", "email.verified", "email.password_reset", "user.signed_in", "user.deleted", "user.claims_changed"];
2
+ declare const WEBHOOK_TYPES: readonly ["email.verify", "email.reset", "email.already_registered", "email.no_password", "signup.before", "user.created", "email.verified", "email.password_reset", "user.signed_in", "user.deleted", "user.claims_changed", "totp.enabled", "totp.disabled", "totp.recovery_code_used"];
3
3
  type WebhookType = (typeof WEBHOOK_TYPES)[number];
4
4
  /** How old a call may be before receivers reject it, so a captured call can't be replayed. */
5
5
  declare const WEBHOOK_TOLERANCE_SECONDS: number;
package/dist/webhook.d.ts CHANGED
@@ -1 +1 @@
1
- export { a as WEBHOOK_TOLERANCE_SECONDS, b as WEBHOOK_TYPES, c as WebhookType, g as generateWebhookSecret, s as signWebhook, v as verifyWebhook } from './webhook-j5u9Kv9l.js';
1
+ export { a as WEBHOOK_TOLERANCE_SECONDS, b as WEBHOOK_TYPES, c as WebhookType, g as generateWebhookSecret, s as signWebhook, v as verifyWebhook } from './webhook-B6P50ocX.js';
package/dist/webhook.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  generateWebhookSecret,
5
5
  signWebhook,
6
6
  verifyWebhook
7
- } from "./chunk-3QRKWLR7.js";
7
+ } from "./chunk-Y7ZSUROX.js";
8
8
  export {
9
9
  WEBHOOK_TOLERANCE_SECONDS,
10
10
  WEBHOOK_TYPES,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@madauth/server",
3
- "version": "0.3.0-beta.2",
4
- "description": "madAuth server: Google and e-mail & password sign-in with madAuth sessions, for Docker, AWS Lambda and Azure Functions.",
3
+ "version": "0.4.0-beta.1",
4
+ "description": "madAuth server: Google, e-mail & password and authenticator-app sign-in with madAuth sessions, for Docker, AWS Lambda and Azure Functions.",
5
5
  "license": "MIT",
6
6
  "author": "David Neuy",
7
7
  "homepage": "https://github.com/inouiw/madAuth#readme",