Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/github-workflows",
"version": "0.0.0-beta.1",
"version": "0.0.0-beta.3",
"private": true,
"engines": {
"node": ">=24.0"
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.6/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.8/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
2,168 changes: 1,135 additions & 1,033 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/monorepo",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "",
"private": true,
"type": "module",
Expand All @@ -12,17 +12,17 @@
"prepare": "husky",
"git:pre-commit": "npm run git:lint-staged && npm run git:test-staged",
"git:commit-msg": "commitlint --config commitlint.config.cjs --edit",
"git:lint-staged": "biome check --staged --no-errors-on-unmatched --files-ignore-unknown=true",
"git:lint-staged": "npm run test:lint",
"git:test-staged": "which node",
"lint": "biome check --write --no-errors-on-unmatched --files-ignore-unknown=true",
"test": "npm run test:lint && npm run test:unit && npm run test:types && npm run test:sast && npm run test:perf && npm run test:dast",
"test:lint": "biome check --write --no-errors-on-unmatched --files-ignore-unknown=true",
"test:lint": "biome check --staged --no-errors-on-unmatched",
"test:unit": "node --test --test-concurrency 1 --experimental-test-coverage --test-coverage-lines=98 --test-coverage-branches=95 --test-coverage-functions=97 --test-coverage-exclude=**/mock.js --test-coverage-exclude=**/*.test.js --test-coverage-exclude=**/table/*",
"test:sast": "npm run test:sast:license && npm run test:sast:lockfile && npm run test:sast:trivy && npm run test:sast:semgrep && npm run test:sast:trufflehog",
"test:sast:license": "license-check-and-add check -f license.json",
"test:sast:lockfile": "lockfile-lint --path package-lock.json --type npm --allowed-hosts npm --validate-https",
"test:sast:semgrep": "semgrep scan --config auto",
"test:sast:trivy": "trivy fs --scanners vuln,license --include-dev-deps --ignored-licenses 0BSD,Apache-2.0,BSD-1-Clause,BSD-2-Clause,BSD-3-Clause,CC0-1.0,CC-BY-4.0,ISC,MIT --exit-code 1 --disable-telemetry .",
"test:sast:trivy": "trivy fs --scanners vuln,license --include-dev-deps --ignored-licenses 0BSD,Apache-2.0,BSD-1-Clause,BSD-2-Clause,BSD-3-Clause,CC0-1.0,CC-BY-4.0,ISC,MIT,Python-2.0 --exit-code 1 --disable-telemetry .",
"test:sast:trufflehog": "trufflehog filesystem --only-verified --log-level=-1 ./",
"test:types": "which tstyche > /dev/null 2>&1 && tstyche || echo 'tstyche not found, skipping type tests'",
"test:perf": "node --test ./**/*.perf.js",
Expand All @@ -41,7 +41,7 @@
"audit": "npm audit fix --workspaces",
"release:license:add": "license-check-and-add add -f license.json",
"release:license:remove": "license-check-and-add remove -f license.json",
"release:sync": "npm version $npm_package_version --workspaces && find ./packages -name \"package.json\" -exec sed -i '' -E \"s|\\\"@1auth/(.*)\\\": ([^,]*)|\\\"@1auth/\\1\\\": $(npm pkg get version)|g\" {} \\; && npm run rm && npm install",
"release:sync": "npm version $npm_package_version --workspaces; find ./packages -name \"package.json\" -exec sed -i '' -E \"s|\\\"@1auth/(.*)\\\": ([^,]*)|\\\"@1auth/\\1\\\": $(npm pkg get version)|g\" {} \\; && npm run rm && npm install",
"release:tag": "git tag $npm_package_version && git push --tags"
},
"repository": {
Expand Down Expand Up @@ -80,11 +80,9 @@
},
"overrides": {
"@sveltejs/kit": {
"cookie": "0.7.2"
"cookie": "^0.7.2"
},
"license-check-and-add": {
"minimatch": "^10.2.4"
}
"fast-xml-parser": "5.5.8"
},
"devEngines": {
"runtime": {
Expand Down
6 changes: 3 additions & 3 deletions packages/account-username/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/account-username",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "Username validation and management for account authentication",
"type": "module",
"engines": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"homepage": "https://github.com/willfarrell/1auth",
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
"dependencies": {
"@1auth/account": "0.0.0-beta.2",
"@1auth/crypto": "0.0.0-beta.2"
"@1auth/account": "0.0.0-beta.3",
"@1auth/crypto": "0.0.0-beta.3"
}
}
4 changes: 2 additions & 2 deletions packages/account/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/account",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "User account management with encrypted storage and lifecycle operations",
"type": "module",
"engines": {
Expand Down Expand Up @@ -56,6 +56,6 @@
"homepage": "https://github.com/willfarrell/1auth",
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
"dependencies": {
"@1auth/crypto": "0.0.0-beta.2"
"@1auth/crypto": "0.0.0-beta.3"
}
}
6 changes: 3 additions & 3 deletions packages/authn-access-token/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/authn-access-token",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "Access token authentication for API and service-to-service communication",
"type": "module",
"engines": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"homepage": "https://github.com/willfarrell/1auth",
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
"dependencies": {
"@1auth/authn": "0.0.0-beta.2",
"@1auth/crypto": "0.0.0-beta.2"
"@1auth/authn": "0.0.0-beta.3",
"@1auth/crypto": "0.0.0-beta.3"
}
}
6 changes: 3 additions & 3 deletions packages/authn-recovery-codes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/authn-recovery-codes",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "One-time recovery code generation and verification for account recovery",
"type": "module",
"engines": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"homepage": "https://github.com/willfarrell/1auth",
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
"dependencies": {
"@1auth/authn": "0.0.0-beta.2",
"@1auth/crypto": "0.0.0-beta.2"
"@1auth/authn": "0.0.0-beta.3",
"@1auth/crypto": "0.0.0-beta.3"
}
}
8 changes: 4 additions & 4 deletions packages/authn-webauthn/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/authn-webauthn",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "WebAuthn/FIDO2 authentication implementation for passwordless login",
"type": "module",
"engines": {
Expand Down Expand Up @@ -54,9 +54,9 @@
"homepage": "https://github.com/willfarrell/1auth",
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
"dependencies": {
"@1auth/account": "0.0.0-beta.2",
"@1auth/authn": "0.0.0-beta.2",
"@1auth/crypto": "0.0.0-beta.2",
"@1auth/account": "0.0.0-beta.3",
"@1auth/authn": "0.0.0-beta.3",
"@1auth/crypto": "0.0.0-beta.3",
"@simplewebauthn/server": "13.3.0"
}
}
4 changes: 2 additions & 2 deletions packages/authn/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/authn",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "Core authentication module with multi-factor authentication support",
"type": "module",
"engines": {
Expand Down Expand Up @@ -56,6 +56,6 @@
"homepage": "https://github.com/willfarrell/1auth",
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
"dependencies": {
"@1auth/crypto": "0.0.0-beta.2"
"@1auth/crypto": "0.0.0-beta.3"
}
}
4 changes: 2 additions & 2 deletions packages/crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/crypto",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "Cryptographic utilities for encryption, hashing, and signing with modern algorithms",
"type": "module",
"engines": {
Expand Down Expand Up @@ -53,6 +53,6 @@
"homepage": "https://github.com/willfarrell/1auth",
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
"dependencies": {
"nanoid": "5.1.6"
"nanoid": "5.1.7"
}
}
8 changes: 4 additions & 4 deletions packages/messenger-email-address/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/messenger-email-address",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "Email address messenger for email verification and notifications",
"type": "module",
"engines": {
Expand Down Expand Up @@ -53,9 +53,9 @@
"homepage": "https://github.com/willfarrell/1auth",
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
"dependencies": {
"@1auth/authn": "0.0.0-beta.2",
"@1auth/crypto": "0.0.0-beta.2",
"@1auth/messenger": "0.0.0-beta.2",
"@1auth/authn": "0.0.0-beta.3",
"@1auth/crypto": "0.0.0-beta.3",
"@1auth/messenger": "0.0.0-beta.3",
"tr46": "6.0.0"
}
}
6 changes: 3 additions & 3 deletions packages/messenger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/messenger",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "Messaging framework for sending notifications and verification codes",
"type": "module",
"engines": {
Expand Down Expand Up @@ -57,7 +57,7 @@
"homepage": "https://github.com/willfarrell/1auth",
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
"dependencies": {
"@1auth/authn": "0.0.0-beta.2",
"@1auth/crypto": "0.0.0-beta.2"
"@1auth/authn": "0.0.0-beta.3",
"@1auth/crypto": "0.0.0-beta.3"
}
}
32 changes: 32 additions & 0 deletions packages/notify-sqs/index.perf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2003 - 2026 will Farrell, and 1Auth contributors.
// SPDX-License-Identifier: MIT
import { Bench } from "tinybench";

import notifySqs, { trigger } from "./index.js";

const mockClient = { send: async () => ({}) };
notifySqs({
client: mockClient,
queueUrl: "https://sqs.us-east-1.amazonaws.com/123/test-queue",
});

const suite = new Bench({ name: "@1auth/notify-sqs" });

suite
.add("trigger with minimal args", async () => {
await trigger("template-1", "user-123");
})
.add("trigger with full args", async () => {
await trigger(
"template-1",
"user-123",
{ token: "abc123" },
{ messengers: [{ type: "email", value: "test@test.com" }] },
);
});

suite.addEventListener("complete", () => {
console.table(suite.table());
});

suite.run();
100 changes: 100 additions & 0 deletions packages/notify-sqs/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// Copyright 2003 - 2026 will Farrell, and 1Auth contributors.
// SPDX-License-Identifier: MIT
import { deepEqual, equal, ok } from "node:assert/strict";
import { describe, it, mock } from "node:test";

import notifySqs, { trigger } from "./index.js";

describe("notify-sqs", () => {
it("should configure with custom options", () => {
const mockClient = { send: mock.fn() };
notifySqs({
client: mockClient,
queueUrl: "https://sqs.us-east-1.amazonaws.com/123/test-queue",
});
ok(true);
});

it("should send message to SQS with correct params", async () => {
const mockSend = mock.fn(async () => ({}));
const mockClient = { send: mockSend };
notifySqs({
client: mockClient,
queueUrl: "https://sqs.us-east-1.amazonaws.com/123/test-queue",
log: false,
});

await trigger(
"template-1",
"user-123",
{ token: "abc" },
{ messengers: [] },
);

const lastCall = mockSend.mock.calls[mockSend.mock.callCount() - 1];
const command = lastCall.arguments[0];
const parsed = JSON.parse(command.input.MessageBody);
deepEqual(parsed, {
id: "template-1",
sub: "user-123",
data: { token: "abc" },
options: { messengers: [] },
});
});

it("should resolve queueUrl from queueName if not provided", async () => {
const mockSend = mock.fn(async (cmd) => {
if (cmd.input?.QueueName) {
return {
QueueUrl: "https://sqs.us-east-1.amazonaws.com/123/resolved-queue",
};
}
return {};
});
const mockClient = { send: mockSend };
notifySqs({
client: mockClient,
queueUrl: undefined,
queueName: "my-queue",
log: false,
});

await trigger("template-1", "user-123");

// First call should be GetQueueUrlCommand, second should be SendMessageCommand
equal(mockSend.mock.callCount(), 2);
});

it("should log when log option is set", async () => {
const mockSend = mock.fn(async () => ({}));
const mockLog = mock.fn();
const mockClient = { send: mockSend };
notifySqs({
client: mockClient,
queueUrl: "https://sqs.us-east-1.amazonaws.com/123/test-queue",
log: mockLog,
});

await trigger("template-1", "user-123");

equal(mockLog.mock.callCount(), 1);
ok(mockLog.mock.calls[0].arguments[0].includes("@1auth/notify-sqs"));
});

it("should use default empty data and options", async () => {
const mockSend = mock.fn(async () => ({}));
const mockClient = { send: mockSend };
notifySqs({
client: mockClient,
queueUrl: "https://sqs.us-east-1.amazonaws.com/123/test-queue",
log: false,
});

await trigger("template-1", "user-123");

const lastCall = mockSend.mock.calls[mockSend.mock.callCount() - 1];
const parsed = JSON.parse(lastCall.arguments[0].input.MessageBody);
deepEqual(parsed.data, {});
deepEqual(parsed.options, {});
});
});
2 changes: 1 addition & 1 deletion packages/notify-sqs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@1auth/notify-sqs",
"version": "0.0.0-beta.2",
"version": "0.0.0-beta.3",
"description": "AWS SQS notification implementation for scalable message queuing",
"type": "module",
"engines": {
Expand Down
Loading
Loading