@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 +20 -8
- package/agent-meta/manifest.json +2 -2
- package/package.json +12 -12
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
|
-
- `
|
|
8
|
-
- `
|
|
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 {
|
|
22
|
-
import {
|
|
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
|
-
//
|
|
25
|
-
|
|
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
|
-
|
|
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
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/server-auth-otp",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"generatedAt": "2026-08-
|
|
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.
|
|
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.
|
|
26
|
-
"@owlmeans/auth-otp": "^0.1.
|
|
27
|
-
"@owlmeans/basic-ids": "^0.1.
|
|
28
|
-
"@owlmeans/context": "^0.1.
|
|
29
|
-
"@owlmeans/mailer": "^0.1.
|
|
30
|
-
"@owlmeans/oidc": "^0.1.
|
|
31
|
-
"@owlmeans/redis-resource": "^0.1.
|
|
32
|
-
"@owlmeans/resource": "^0.1.
|
|
33
|
-
"@owlmeans/server-auth": "^0.1.
|
|
34
|
-
"@owlmeans/server-auth-identity": "^0.1.
|
|
35
|
-
"@owlmeans/server-context": "^0.1.
|
|
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:*",
|