@owlmeans/server-auth-otp 0.1.22-rc.0 → 0.2.0-alpha.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.
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ types the service, and on this package only where the server wires itself up.
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
bun add @owlmeans/server-auth-otp@^0.
|
|
15
|
+
bun add @owlmeans/server-auth-otp@^0.2.0-alpha.1
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Concepts
|
|
@@ -44,8 +44,7 @@ bun add @owlmeans/server-auth-otp@^0.1.22-rc.0
|
|
|
44
44
|
### Wire the server
|
|
45
45
|
|
|
46
46
|
```typescript
|
|
47
|
-
import {
|
|
48
|
-
import { makeMailgunMailerService } from '@owlmeans/server-mailer-mailgun'
|
|
47
|
+
import { appendSmtpMailer } from '@owlmeans/mailer-smtp'
|
|
49
48
|
import { makeRedisResource } from '@owlmeans/redis-resource'
|
|
50
49
|
import {
|
|
51
50
|
OTP_RESOURCE, appendOtpPlugin, makeOtpService, makeRedisOtpChallengeStore, makeRedisThrottleService,
|
|
@@ -54,7 +53,7 @@ import {
|
|
|
54
53
|
context.registerResource(makeRedisResource(OTP_RESOURCE)) // challenge and throttle storage
|
|
55
54
|
context.registerService(makeRedisOtpChallengeStore()) // OTP_CHALLENGE_STORE
|
|
56
55
|
context.registerService(makeRedisThrottleService()) // OTP_THROTTLE_SERVICE
|
|
57
|
-
context
|
|
56
|
+
appendSmtpMailer(context, { authenticated: true, verifyOnInit: true }) // the mailer host delivers the code
|
|
58
57
|
context.registerService(makeOtpService()) // OTP_SERVICE
|
|
59
58
|
|
|
60
59
|
appendOtpPlugin(context) // plugin under 'email-otp'
|
|
@@ -173,8 +172,8 @@ malformed address is `AuthenFailed('otp:email')`.
|
|
|
173
172
|
- [`@owlmeans/auth-otp`](../auth-otp) — `OtpService` type and the shared OTP constants
|
|
174
173
|
- [`@owlmeans/server-auth`](../server-auth) — the auth-manager plugin registry this plugin joins
|
|
175
174
|
- [`@owlmeans/server-auth-identity`](../server-auth-identity) — `IdentityLinkingService`, which maps the address to an account
|
|
176
|
-
- [`@owlmeans/mailer`](../mailer) — `
|
|
177
|
-
- [`@owlmeans/
|
|
175
|
+
- [`@owlmeans/mailer`](../mailer) — the mailer host (`MAILER_SERVICE`) and the console transport for tests
|
|
176
|
+
- [`@owlmeans/mailer-smtp`](../mailer-smtp) — the SMTP transport; provider HTTP transports live in OwlMeans connect
|
|
178
177
|
- [`@owlmeans/redis-resource`](../redis-resource) — the Redis resource behind the stores and throttle
|
|
179
178
|
|
|
180
179
|
The `server-auth-otp` skill covers the flow and its schema gotchas for agents.
|
|
@@ -187,7 +186,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
187
186
|
your project's skill store (`.agents/skills/`):
|
|
188
187
|
|
|
189
188
|
```sh
|
|
190
|
-
npx @owlmeans/agent-skills@^0.
|
|
189
|
+
npx @owlmeans/agent-skills@^0.2.0-alpha.2
|
|
191
190
|
```
|
|
192
191
|
|
|
193
192
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 3,
|
|
3
3
|
"package": "@owlmeans/server-auth-otp",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"generatedAt": "2026-11-
|
|
4
|
+
"version": "0.2.0-alpha.1",
|
|
5
|
+
"generatedAt": "2026-11-12T14:18:05.447Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ metadata:
|
|
|
8
8
|
|
|
9
9
|
# Using `@owlmeans/server-auth-otp`
|
|
10
10
|
|
|
11
|
-
**Install:** `"@owlmeans/server-auth-otp": "^0.
|
|
11
|
+
**Install:** `"@owlmeans/server-auth-otp": "^0.2.0-alpha.1"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
Email OTP authentication plugin for the OwlMeans auth-manager plugin system. Relies on `@owlmeans/auth-otp` for the OTP service interface, a Redis resource for code storage, and a `MailerService` to send codes.
|
|
14
14
|
|
|
@@ -48,16 +48,16 @@ the contracts package, never to the implementation.
|
|
|
48
48
|
```ts
|
|
49
49
|
import { makeOtpService, appendOtpPlugin, OTP_RESOURCE } from '@owlmeans/server-auth-otp'
|
|
50
50
|
import { makeRedisResource } from '@owlmeans/redis-resource'
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
51
|
+
import { appendMailerTransport, createConsoleMailerTransport } from '@owlmeans/mailer'
|
|
52
|
+
import { appendSmtpMailer } from '@owlmeans/mailer-smtp'
|
|
53
53
|
|
|
54
54
|
// 1. Register the Redis code-cache resource.
|
|
55
55
|
context.registerResource(makeRedisResource(OTP_RESOURCE))
|
|
56
56
|
|
|
57
|
-
// 2.
|
|
58
|
-
context
|
|
57
|
+
// 2. Give the mailer host under MAILER_SERVICE a transport (console for dev/tests, a real one for prod).
|
|
58
|
+
appendMailerTransport(context, createConsoleMailerTransport())
|
|
59
59
|
// or:
|
|
60
|
-
context
|
|
60
|
+
appendSmtpMailer(context, { authenticated: true, verifyOnInit: true })
|
|
61
61
|
|
|
62
62
|
// 3. Register the OTP service (reads from Redis + Mailer).
|
|
63
63
|
context.registerService(makeOtpService())
|
|
@@ -170,8 +170,8 @@ names another address. Expose it only behind a developer-only, signed and allow-
|
|
|
170
170
|
## Related
|
|
171
171
|
|
|
172
172
|
- `@owlmeans/auth-otp` — the `OtpService` interface and the shared constants
|
|
173
|
-
- `@owlmeans/mailer` — `
|
|
174
|
-
- `@owlmeans/
|
|
173
|
+
- `@owlmeans/mailer` — the mailer host (`MAILER_SERVICE`), the console transport
|
|
174
|
+
- `@owlmeans/mailer-smtp` — the SMTP transport; provider HTTP transports live in OwlMeans connect
|
|
175
175
|
- `server-auth` skill — the auth-manager plugin system this plugin registers into
|
|
176
176
|
- `server-auth-identity` skill — how the linked profile and its organization entity are stored
|
|
177
177
|
- `auth-protocol` skill — error hierarchy and identity read rules
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/server-auth-otp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://owlmeans.com/docs/",
|
|
6
6
|
"repository": {
|
|
@@ -32,23 +32,23 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@owlmeans/auth": "^0.
|
|
36
|
-
"@owlmeans/auth-otp": "^0.
|
|
37
|
-
"@owlmeans/context": "^0.
|
|
38
|
-
"@owlmeans/error": "^0.
|
|
39
|
-
"@owlmeans/log": "^0.
|
|
40
|
-
"@owlmeans/mailer": "^0.
|
|
41
|
-
"@owlmeans/oidc": "^0.
|
|
42
|
-
"@owlmeans/redis-resource": "^0.
|
|
43
|
-
"@owlmeans/resource": "^0.
|
|
44
|
-
"@owlmeans/server-auth": "^0.
|
|
45
|
-
"@owlmeans/server-auth-identity": "^0.
|
|
46
|
-
"@owlmeans/server-context": "^0.
|
|
35
|
+
"@owlmeans/auth": "^0.2.0-alpha.0",
|
|
36
|
+
"@owlmeans/auth-otp": "^0.2.0-alpha.0",
|
|
37
|
+
"@owlmeans/context": "^0.2.0-alpha.0",
|
|
38
|
+
"@owlmeans/error": "^0.2.0-alpha.0",
|
|
39
|
+
"@owlmeans/log": "^0.2.0-alpha.0",
|
|
40
|
+
"@owlmeans/mailer": "^0.2.0-alpha.0",
|
|
41
|
+
"@owlmeans/oidc": "^0.2.0-alpha.1",
|
|
42
|
+
"@owlmeans/redis-resource": "^0.2.0-alpha.1",
|
|
43
|
+
"@owlmeans/resource": "^0.2.0-alpha.0",
|
|
44
|
+
"@owlmeans/server-auth": "^0.2.0-alpha.1",
|
|
45
|
+
"@owlmeans/server-auth-identity": "^0.2.0-alpha.1",
|
|
46
|
+
"@owlmeans/server-context": "^0.2.0-alpha.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@owlmeans/dep-config": "^0.
|
|
50
|
-
"@owlmeans/redis": "^0.
|
|
51
|
-
"@owlmeans/test-integration": "^0.
|
|
49
|
+
"@owlmeans/dep-config": "^0.2.0-alpha.0",
|
|
50
|
+
"@owlmeans/redis": "^0.2.0-alpha.1",
|
|
51
|
+
"@owlmeans/test-integration": "^0.2.0-alpha.1",
|
|
52
52
|
"@types/bun": "^1.4.4",
|
|
53
53
|
"nodemon": "^3.1.14",
|
|
54
54
|
"typescript": "^7.0.2"
|