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
102 changes: 51 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.2.2

- Works with `@inkanjs/inkan`, the new name of the core (it was `@vxnsin/inkan`). Install
`@inkanjs/inkan` 0.9.2 or later next to it.

## 0.2.1

- The generated routes mark the statuses no example can show as `untested`, with the reason
Expand Down
6 changes: 3 additions & 3 deletions packages/auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Node 22.18 or newer, inkan 0.8 (`register()` refuses other versions). MIT licens
## Quick start

```js
import { inkan, t } from "@vxnsin/inkan";
import { inkan, t } from "@inkanjs/inkan";
import { auth } from "@inkanjs/auth";

const login = auth({
Expand Down Expand Up @@ -296,8 +296,8 @@ typed their address. Without `emailVerified`, make a new account or refuse.

Sessions, refresh tokens and TOTP steps live in `store`; the brute-force counters in
`bruteForce.store`, a second one. Both are inkan `Store`s, by default `memoryStore()` from
@vxnsin/inkan: in memory, per process. Any `Store` works, such as @inkanjs/redis, @inkanjs/mongo, @inkanjs/mysql and @inkanjs/postgres (coming with inkan 0.8), or one you
write against the interface (`storeConformance` from `@vxnsin/inkan/testing` checks it):
@inkanjs/inkan: in memory, per process. Any `Store` works, such as @inkanjs/redis, @inkanjs/mongo, @inkanjs/mysql and @inkanjs/postgres (coming with inkan 0.8), or one you
write against the interface (`storeConformance` from `@inkanjs/inkan/testing` checks it):

```js
import { redisStore } from "@inkanjs/redis";
Expand Down
10 changes: 5 additions & 5 deletions packages/auth/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Context, memoryStore as coreMemoryStore, Plugin, ProblemBody, Schema, Security, Store as CoreStore } from "@vxnsin/inkan";
import type { Context, memoryStore as coreMemoryStore, Plugin, ProblemBody, Schema, Security, Store as CoreStore } from "@inkanjs/inkan";
import type { AsymmetricKey, Duration, JwksOptions, JwtAlgorithm, JwtPayload, Secret } from "./lib/jwt.js";
import type { OAuthTokens, OAuthUser, Provider } from "./lib/oauth.js";
import type { ScryptParams } from "./lib/password.js";
Expand All @@ -12,7 +12,7 @@ export { randomToken, hashToken, safeEqual } from "./lib/tokens.js";
export { github, google, oidcProvider } from "./lib/oauth.js";
export type { OAuth2Provider, OAuthTokens, OAuthUser, OidcProvider, Provider } from "./lib/oauth.js";

declare module "@vxnsin/inkan" {
declare module "@inkanjs/inkan" {
interface RouteMeta {
/**
* What @inkanjs/auth asks of the caller. `roles`: at least one of them (403 otherwise).
Expand Down Expand Up @@ -54,11 +54,11 @@ export interface UserSource<U> {
updatePasswordHash?(id: any, hash: string): Awaitable<unknown>;
}

/** @deprecated Use `Store` from "@vxnsin/inkan"; TTLs are in milliseconds since 0.2. */
/** @deprecated Use `Store` from "@inkanjs/inkan"; TTLs are in milliseconds since 0.2. */
export type Store = CoreStore;
/** @deprecated Use `Store` from "@vxnsin/inkan"; TTLs are in milliseconds since 0.2. */
/** @deprecated Use `Store` from "@inkanjs/inkan"; TTLs are in milliseconds since 0.2. */
export type AuthStore = CoreStore;
/** @deprecated Use `memoryStore` from "@vxnsin/inkan": this is the same function, re-exported. */
/** @deprecated Use `memoryStore` from "@inkanjs/inkan": this is the same function, re-exported. */
export declare const memoryStore: typeof coreMemoryStore;

export interface SessionOptions {
Expand Down
4 changes: 2 additions & 2 deletions packages/auth/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @inkanjs/auth: the inkan plugin, and the building blocks it is made of for apps that need
// them on their own (password reset tokens, tokens for other services, account linking).
export { auth } from "./lib/plugin.js";
/** @deprecated the core's `memoryStore` from @vxnsin/inkan, re-exported for 0.1 code. */
export { memoryStore } from "@vxnsin/inkan";
/** @deprecated the core's `memoryStore` from @inkanjs/inkan, re-exported for 0.1 code. */
export { memoryStore } from "@inkanjs/inkan";
export { AuthError } from "./lib/errors.js";
export { signJwt, verifyJwt, jwksSource } from "./lib/jwt.js";
export { hashPassword, verifyPassword, needsRehash } from "./lib/password.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// for a scheme this plugin cannot verify is refused, never waved through.
import { Buffer } from "node:buffer";
import { randomBytes } from "node:crypto";
import { HttpProblem, memoryStore, plugin, problem, reply, t } from "@vxnsin/inkan";
import { HttpProblem, memoryStore, plugin, problem, reply, t } from "@inkanjs/inkan";
import { AuthError } from "./errors.js";
import { isObject, secureUrl } from "./http.js";
import { jwksSource, signJwt, verifyJwt } from "./jwt.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/lib/store.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// What the plugin keeps between requests (sessions, refresh tokens, login counters, the last
// TOTP step) lives in an inkan `Store`: `memoryStore()` from @vxnsin/inkan by default, or any
// TOTP step) lives in an inkan `Store`: `memoryStore()` from @inkanjs/inkan by default, or any
// adapter (Redis, a database) whose add, take and increment are atomic across processes.
// What is left here is the lock for the few steps that read and then write within one process.

Expand Down
6 changes: 3 additions & 3 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inkanjs/auth",
"version": "0.2.1",
"version": "0.2.2",
"description": "Authentication for inkan without dependencies: sessions, JWTs, API keys, passwords, TOTP and OAuth on node:crypto alone.",
"type": "module",
"license": "MIT",
Expand Down Expand Up @@ -41,10 +41,10 @@
"node": ">=22.18"
},
"peerDependencies": {
"@vxnsin/inkan": ">=0.8.0 <1.0.0"
"@inkanjs/inkan": ">=0.8.0 <1.0.0"
},
"devDependencies": {
"@vxnsin/inkan": "^0.8.0"
"@inkanjs/inkan": "^0.9.2"
},
"scripts": {
"test": "node --import ../../scripts/no-deprecations.js --test \"test/*.test.ts\""
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/test/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// What the plugin tests share: a few users, a clock to move, and a cookie jar for inject.
import { inkan, type InjectResponse } from "@vxnsin/inkan";
import { inkan, type InjectResponse } from "@inkanjs/inkan";
import { auth, hashPassword, type AuthOptions } from "../index.js";

export const SECRET = "test-secret-that-is-long-enough-0123456789";
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/test/plugin-credentials.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, after } from "node:test";
import assert from "node:assert/strict";
import { createHash, createHmac, generateKeyPairSync } from "node:crypto";
import { inkan } from "@vxnsin/inkan";
import { inkan } from "@inkanjs/inkan";
import { auth, signJwt } from "../index.js";
import { SECRET, clock, makeUsers, type User } from "./app.ts";
import { json, serve } from "./server.ts";
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/test/plugin-docs.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import { inkan, t } from "@vxnsin/inkan";
import { inkan, t } from "@inkanjs/inkan";
import { auth, github } from "../index.js";
import { FAST, SECRET, makeUsers, type User } from "./app.ts";

Expand Down
Loading
Loading