@owlmeans/server-auth-otp 0.1.17 → 0.1.18-rc.0

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.
package/README.md CHANGED
@@ -4,9 +4,9 @@ Email OTP `AuthPlugin` for OwlMeans servers — passwordless login via time-limi
4
4
 
5
5
  ## Overview
6
6
 
7
- - `makeOtpPlugin(context)` — factory for the `AuthPlugin` that handles `OTP_AUTH_TYPE` authentication requests
8
- - `OtpService` — issues email challenges and verifies submitted codes; backed by `@owlmeans/auth-otp`
9
- - Integrates with `@owlmeans/server-auth` plugin registry — plugs in alongside other auth strategies
7
+ - `appendOtpPlugin(context)` — registers the `AuthPlugin` that handles `OTP_AUTH_TYPE` (`'email-otp'`) authentication requests
8
+ - `makeOtpService(alias?)` — issues email challenges and verifies submitted codes; backed by `@owlmeans/auth-otp`
9
+ - Integrates with the `@owlmeans/server-auth` plugin registry — plugs in alongside other auth strategies
10
10
  - Resolves identities through `@owlmeans/server-auth-identity` after OTP verification
11
11
 
12
12
  ## Installation
@@ -18,14 +18,26 @@ bun add @owlmeans/server-auth-otp
18
18
  ## Usage
19
19
 
20
20
  ```typescript
21
- import { makeOtpPlugin, OTP_SERVICE } from '@owlmeans/server-auth-otp'
22
- import { registerPlugin } from '@owlmeans/server-auth/manager/plugins'
21
+ import { makeRedisResource } from '@owlmeans/redis-resource'
22
+ import { OTP_RESOURCE, OTP_SERVICE } from '@owlmeans/auth-otp'
23
+ import { appendOtpPlugin, makeOtpService } from '@owlmeans/server-auth-otp'
24
+ import { MAILER_SERVICE } from '@owlmeans/mailer'
25
+ import { makeSmtpMailerService } from '@owlmeans/mailer-smtp'
23
26
 
24
- // Register in a server context that already has an OtpService wired
25
- registerPlugin(context, makeOtpPlugin(context))
27
+ context.registerResource(makeRedisResource(OTP_RESOURCE)) // challenge store
28
+ context.registerService(makeSmtpMailerService(MAILER_SERVICE))
29
+ context.registerService(makeOtpService(OTP_SERVICE))
30
+
31
+ appendOtpPlugin(context) // registers the plugin factory under 'email-otp'
26
32
  ```
27
33
 
28
- The OTP service must be backed by a transport (e.g. `@owlmeans/mailer` → `@owlmeans/server-mailer-mailgun`) that can deliver the one-time code.
34
+ `appendOtpPlugin` writes into a module-level registry, so it is a global side effect: the
35
+ `context` it takes is only returned for chaining, and the plugin factory receives the live
36
+ context per request.
37
+
38
+ The OTP service must be backed by a transport that can deliver the one-time code —
39
+ `@owlmeans/mailer-smtp` (SMTP) or `@owlmeans/server-mailer-mailgun` (Mailgun HTTP API),
40
+ registered under `MAILER_SERVICE`. Override the alias with `cfg.otp.mailerAlias`.
29
41
 
30
42
  <!-- owlmeans:agent-guidance:start -->
31
43
  ## Agent guidance
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/server-auth-otp",
4
- "version": "0.1.17",
5
- "generatedAt": "2026-08-15T13:01:19.932Z",
4
+ "version": "0.1.18-rc.0",
5
+ "generatedAt": "2026-08-16T22:20:50.506Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/server-auth-otp",
3
- "version": "0.1.17",
3
+ "version": "0.1.18-rc.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -22,17 +22,17 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@owlmeans/auth": "^0.1.17",
26
- "@owlmeans/auth-otp": "^0.1.17",
27
- "@owlmeans/basic-ids": "^0.1.17",
28
- "@owlmeans/context": "^0.1.17",
29
- "@owlmeans/mailer": "^0.1.17",
30
- "@owlmeans/oidc": "^0.1.17",
31
- "@owlmeans/redis-resource": "^0.1.17",
32
- "@owlmeans/resource": "^0.1.17",
33
- "@owlmeans/server-auth": "^0.1.17",
34
- "@owlmeans/server-auth-identity": "^0.1.17",
35
- "@owlmeans/server-context": "^0.1.17"
25
+ "@owlmeans/auth": "^0.1.18-rc.0",
26
+ "@owlmeans/auth-otp": "^0.1.18-rc.0",
27
+ "@owlmeans/basic-ids": "^0.1.18-rc.0",
28
+ "@owlmeans/context": "^0.1.18-rc.0",
29
+ "@owlmeans/mailer": "^0.1.18-rc.0",
30
+ "@owlmeans/oidc": "^0.1.18-rc.0",
31
+ "@owlmeans/redis-resource": "^0.1.18-rc.0",
32
+ "@owlmeans/resource": "^0.1.18-rc.0",
33
+ "@owlmeans/server-auth": "^0.1.18-rc.0",
34
+ "@owlmeans/server-auth-identity": "^0.1.18-rc.0",
35
+ "@owlmeans/server-context": "^0.1.18-rc.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@owlmeans/dep-config": "workspace:*",