@dunx/auth 2.0.1 → 2.1.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.
Files changed (2) hide show
  1. package/README.md +4 -4
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -17,7 +17,7 @@ bun add @dunx/auth better-auth
17
17
 
18
18
  `drizzle-orm` **is** an optional peer, needed only by `@dunx/auth/drizzle` - which is
19
19
  its own subpath precisely so that a Prisma, Kysely or MongoDB app never loads it.
20
- `dist/index.js` contains no reference to drizzle, which is the test a peer has to
20
+ `dist/index.js` contains no reference to drizzle, the test a peer has to
21
21
  pass to be called optional.
22
22
 
23
23
  There is no dunx sign-in flow, no dunx session table, no dunx password reset and no
@@ -136,7 +136,7 @@ plugin's `Authorization: Bearer <token>` both work, and then reads the metadata
136
136
  `@dunx/http` already had:
137
137
 
138
138
  - **`@Public()`** - skipped outright. No session lookup, no rejection, no role check.
139
- That is what makes the guard safe to install globally: `AuthHandler` is `@Public()`,
139
+ The guard is safe to install globally for that reason: `AuthHandler` is `@Public()`,
140
140
  and a sign-in endpoint that required a session could never be reached.
141
141
  - **`@Roles('admin', 'editor')`** - a 403 unless the caller holds one of them.
142
142
  `@dunx/openapi` already reads the same key for its security schemes.
@@ -175,7 +175,7 @@ implements natively, and it is already how `@dunx/core` carries request state.
175
175
  It is a **second** store rather than a key in `RequestContext`, because that one is
176
176
  the log record - every field in it is serialized into every line the request writes,
177
177
  so a session object there would be noise on each entry and a redaction hazard in the
178
- ones that matter. What does go there is `userId`, which is why every log line inside a
178
+ ones that matter. `userId` does go there, so every log line inside a
179
179
  guarded request is already correlated to the user.
180
180
 
181
181
  ### Plugin types
@@ -225,7 +225,7 @@ AuthModule.forRootAsync({
225
225
  Sessions, verification values and rate-limit counters then live in Redis instead of
226
226
  costing a database round trip per request.
227
227
 
228
- All five methods are implemented, not the three that are mandatory. `getAndDelete` and
228
+ All five methods are implemented, beyond the three that are mandatory. `getAndDelete` and
229
229
  `increment` are optional in better-auth's interface because most clients cannot do
230
230
  them atomically - `Bun.RedisClient` can, through `GETDEL` and `INCR`. Without them
231
231
  better-auth falls back to read-then-delete for single-use credentials, which is a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dunx/auth",
3
- "version": "2.0.1",
3
+ "version": "2.1.1",
4
4
  "description": "Better Auth for dunx: its handler mounted on Bun.serve, a session guard reading @Public() and @Roles(), the caller in async context, and Bun.password hashing",
5
5
  "keywords": [
6
6
  "auth",
@@ -58,8 +58,8 @@
58
58
  "drizzle-orm": "^0.45.2"
59
59
  },
60
60
  "peerDependencies": {
61
- "@dunx/core": "^2.0.1",
62
- "@dunx/http": "^2.0.1",
61
+ "@dunx/core": "^2.1.1",
62
+ "@dunx/http": "^2.1.1",
63
63
  "@types/bun": ">=1.3.0",
64
64
  "better-auth": "^1.6.25",
65
65
  "drizzle-orm": "^0.45.2"