@madauth/server 0.2.0-beta.2 → 0.3.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-BSgYVRpd.js';
2
+ import { S as StoreAdapter } from '../schema-3yhCc2jH.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-BSgYVRpd.js';
1
+ import { S as StoreAdapter } from '../schema-3yhCc2jH.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-BSgYVRpd.js';
1
+ import { S as StoreAdapter } from './schema-3yhCc2jH.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
@@ -14,6 +14,7 @@ function testUser(overrides = {}) {
14
14
  sessionVersion: 0,
15
15
  lastMailAt: 0,
16
16
  wrongCodes: 0,
17
+ claims: null,
17
18
  createdAt: 17e11,
18
19
  ...overrides
19
20
  };
@@ -27,6 +28,7 @@ function testAccount(overrides = {}) {
27
28
  secret: "hash",
28
29
  failedAttempts: 0,
29
30
  lockedUntil: 0,
31
+ email: null,
30
32
  createdAt: 17e11,
31
33
  ...overrides
32
34
  };
@@ -0,0 +1,12 @@
1
+ /** The signed-in user as returned to apps. */
2
+ interface MadauthUser {
3
+ /** Stable id (`usr_…`), the same whichever way the user signs in. */
4
+ id: string;
5
+ email?: string;
6
+ name?: string;
7
+ picture?: string;
8
+ /** What admins attached to the user, e.g. `{ roles: ['admin'] }`. Absent without claims. */
9
+ claims?: Record<string, unknown>;
10
+ }
11
+
12
+ 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-C1A3BfOo.js';
2
+ import { M as MadauthUser } from './user-BMWEWREH.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-7CTAB3QV.js";
5
+ } from "./chunk-DCDTO5LG.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", "signup.before", "user.created", "email.verified", "password.reset", "user.signed_in", "user.deleted", "roles.changed"];
2
+ declare const WEBHOOK_TYPES: readonly ["email.verify", "email.reset", "email.already_registered", "signup.before", "user.created", "email.verified", "email.password_reset", "user.signed_in", "user.deleted", "user.claims_changed"];
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-ltwulgcB.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-DCDP6SaE.js';
package/dist/webhook.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  generateWebhookSecret,
5
5
  signWebhook,
6
6
  verifyWebhook
7
- } from "./chunk-6EJDVZCD.js";
7
+ } from "./chunk-NPNM26J3.js";
8
8
  export {
9
9
  WEBHOOK_TOLERANCE_SECONDS,
10
10
  WEBHOOK_TYPES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madauth/server",
3
- "version": "0.2.0-beta.2",
3
+ "version": "0.3.0-beta.1",
4
4
  "description": "madAuth server: Google and e-mail & password sign-in with madAuth sessions, for Docker, AWS Lambda and Azure Functions.",
5
5
  "license": "MIT",
6
6
  "author": "David Neuy",
@@ -1,12 +0,0 @@
1
- /** The signed-in user as returned to apps. */
2
- interface MadauthUser {
3
- /** Stable id, e.g. `google:<sub>`. */
4
- id: string;
5
- email?: string;
6
- name?: string;
7
- picture?: string;
8
- /** The roles of the user's e-mail address, e.g. `['admin']`. Absent without roles. */
9
- roles?: string[];
10
- }
11
-
12
- export type { MadauthUser as M };