@allodium/auth 0.0.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.
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @allodium/auth — first-party authentication you own outright.
3
+ *
4
+ * Being extracted from a production Next.js SaaS (custom WebAuthn passkeys, Google OIDC,
5
+ * argon2 password sessions, rotating refresh tokens) as its Directus migration proceeds.
6
+ * The design contract, so consumers can build against it today:
7
+ *
8
+ * - Passwords: argon2id via `node-argon2`. Directus-compatible: hashes produced by
9
+ * Directus verify unchanged (parameters are read from the hash string), so migrations
10
+ * require zero password resets.
11
+ * - Sessions: server-side session rows (id, user_id, token hash, device label, expiry),
12
+ * httpOnly cookies, multiple concurrent sessions per user.
13
+ * - Refresh: short-lived access + rotating single-use refresh, with single-flight
14
+ * middleware guidance for the rotation race (or sliding sessions — your choice).
15
+ * - OIDC: provider-agnostic authorization-code flow (Google first), same-domain
16
+ * callbacks, one-identity-per-provider policy hooks.
17
+ * - Passkeys: @simplewebauthn-based ceremonies; credentials in your Postgres.
18
+ * - Reset: single-use hashed tokens + your SMTP; anti-enumeration (always-200) contract.
19
+ * - Tenancy: membership/role helpers for the org-per-row multi-tenant pattern.
20
+ */
21
+ export declare const AUTH_PACKAGE_STATUS: "scaffolding";
22
+ /** The session shape consumers can rely on across versions. */
23
+ export interface AllodiumSession {
24
+ id: string;
25
+ userId: string;
26
+ createdAt: Date;
27
+ expiresAt: Date;
28
+ deviceLabel?: string | null;
29
+ }
30
+ /** Placeholder to keep the package importable while extraction proceeds. */
31
+ export declare function version(): string;
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,mBAAmB,EAAG,aAAsB,CAAC;AAE1D,+DAA+D;AAC/D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,4EAA4E;AAC5E,wBAAgB,OAAO,IAAI,MAAM,CAEhC"}
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @allodium/auth — first-party authentication you own outright.
3
+ *
4
+ * Being extracted from a production Next.js SaaS (custom WebAuthn passkeys, Google OIDC,
5
+ * argon2 password sessions, rotating refresh tokens) as its Directus migration proceeds.
6
+ * The design contract, so consumers can build against it today:
7
+ *
8
+ * - Passwords: argon2id via `node-argon2`. Directus-compatible: hashes produced by
9
+ * Directus verify unchanged (parameters are read from the hash string), so migrations
10
+ * require zero password resets.
11
+ * - Sessions: server-side session rows (id, user_id, token hash, device label, expiry),
12
+ * httpOnly cookies, multiple concurrent sessions per user.
13
+ * - Refresh: short-lived access + rotating single-use refresh, with single-flight
14
+ * middleware guidance for the rotation race (or sliding sessions — your choice).
15
+ * - OIDC: provider-agnostic authorization-code flow (Google first), same-domain
16
+ * callbacks, one-identity-per-provider policy hooks.
17
+ * - Passkeys: @simplewebauthn-based ceremonies; credentials in your Postgres.
18
+ * - Reset: single-use hashed tokens + your SMTP; anti-enumeration (always-200) contract.
19
+ * - Tenancy: membership/role helpers for the org-per-row multi-tenant pattern.
20
+ */
21
+ export const AUTH_PACKAGE_STATUS = 'scaffolding';
22
+ /** Placeholder to keep the package importable while extraction proceeds. */
23
+ export function version() {
24
+ return '0.0.1';
25
+ }
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAsB,CAAC;AAW1D,4EAA4E;AAC5E,MAAM,UAAU,OAAO;IACrB,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@allodium/auth",
3
+ "version": "0.0.1",
4
+ "description": "First-party auth you own: argon2 passwords, session store, rotating refresh, OIDC, WebAuthn passkeys, reset emails, tenant membership.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": ["dist"],
16
+ "scripts": {
17
+ "build": "tsc -p tsconfig.json",
18
+ "typecheck": "tsc -p tsconfig.json --noEmit"
19
+ },
20
+ "engines": { "node": ">=20" }
21
+ }