@nwire/auth 0.9.2 → 0.10.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/dist/auth.d.ts +9 -3
- package/dist/auth.js +19 -8
- package/dist/identity.d.ts +1 -2
- package/dist/identity.js +5 -8
- package/dist/routes.d.ts +33 -35
- package/dist/routes.js +29 -40
- package/dist/user.d.ts +0 -1
- package/dist/user.js +0 -1
- package/package.json +8 -5
- package/dist/__tests__/auth.test.d.ts +0 -6
- package/dist/__tests__/auth.test.d.ts.map +0 -1
- package/dist/__tests__/auth.test.js +0 -91
- package/dist/__tests__/auth.test.js.map +0 -1
- package/dist/__tests__/identity.test.d.ts +0 -12
- package/dist/__tests__/identity.test.d.ts.map +0 -1
- package/dist/__tests__/identity.test.js +0 -141
- package/dist/__tests__/identity.test.js.map +0 -1
- package/dist/__tests__/routes.test.d.ts +0 -12
- package/dist/__tests__/routes.test.d.ts.map +0 -1
- package/dist/__tests__/routes.test.js +0 -99
- package/dist/__tests__/routes.test.js.map +0 -1
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js.map +0 -1
- package/dist/resolvers.d.ts +0 -65
- package/dist/resolvers.d.ts.map +0 -1
- package/dist/resolvers.js +0 -181
- package/dist/resolvers.js.map +0 -1
- package/dist/routes.d.ts.map +0 -1
- package/dist/routes.js.map +0 -1
- package/dist/user.d.ts.map +0 -1
- package/dist/user.js.map +0 -1
package/dist/auth.d.ts
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
*
|
|
9
9
|
* See: architecture-sketch.html §05 (Adapters tier).
|
|
10
10
|
*/
|
|
11
|
-
import type { ActionDefinition,
|
|
11
|
+
import type { ActionDefinition, HandlerContext } from "@nwire/forge";
|
|
12
|
+
import type { DispatchMiddleware, PluginDefinition } from "@nwire/app";
|
|
12
13
|
import { NwireError } from "@nwire/handler";
|
|
13
14
|
export interface Authorizer {
|
|
14
15
|
/**
|
|
@@ -39,7 +40,12 @@ export declare function authzMiddleware(options: AuthzMiddlewareOptions): Dispat
|
|
|
39
40
|
* createApp({ plugins: [authPlugin({ authorizer })] })
|
|
40
41
|
*/
|
|
41
42
|
export declare function authPlugin(options: AuthzMiddlewareOptions): PluginDefinition;
|
|
43
|
+
/**
|
|
44
|
+
* Dev/test Authorizer that allows every action. Use as a placeholder while
|
|
45
|
+
* the real policy isn't ready, or in tests where authz isn't under test.
|
|
46
|
+
* Never ship in production — every dispatch passes regardless of identity.
|
|
47
|
+
*/
|
|
48
|
+
export declare const allowAllAuthorizer: Authorizer;
|
|
42
49
|
export type { User } from "./user.js";
|
|
43
50
|
export { identityPlugin, type IdpAdapter, type IdentityPluginOptions, type SignInInput, type RegisterInput, type AuthTokens, } from "./identity.js";
|
|
44
|
-
export {
|
|
45
|
-
//# sourceMappingURL=auth.d.ts.map
|
|
51
|
+
export { authWires, signInRoute, signInHandler, signOutRoute, signOutHandler, refreshRoute, refreshHandler, registerRoute, registerHandler, requestPasswordResetRoute, requestPasswordResetHandler, resetPasswordRoute, resetPasswordHandler, verifyEmailRoute, verifyEmailHandler, meRoute, meHandler, type AuthWiresOptions, } from "./routes.js";
|
package/dist/auth.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* See: architecture-sketch.html §05 (Adapters tier).
|
|
10
10
|
*/
|
|
11
|
-
import { definePlugin } from "@nwire/
|
|
11
|
+
import { definePlugin } from "@nwire/app";
|
|
12
12
|
import { NwireError } from "@nwire/handler";
|
|
13
13
|
export class UnauthorizedError extends NwireError {
|
|
14
14
|
constructor(message = "unauthorized") {
|
|
@@ -24,7 +24,9 @@ export class ForbiddenError extends NwireError {
|
|
|
24
24
|
}
|
|
25
25
|
export function authzMiddleware(options) {
|
|
26
26
|
const enforceAll = options.enforceAll ?? true;
|
|
27
|
-
return async (next,
|
|
27
|
+
return async (next, actionRaw, _input, ctxRaw) => {
|
|
28
|
+
const action = actionRaw;
|
|
29
|
+
const ctx = ctxRaw;
|
|
28
30
|
if (!enforceAll && action.policy === undefined) {
|
|
29
31
|
return next();
|
|
30
32
|
}
|
|
@@ -37,14 +39,23 @@ export function authzMiddleware(options) {
|
|
|
37
39
|
* createApp({ plugins: [authPlugin({ authorizer })] })
|
|
38
40
|
*/
|
|
39
41
|
export function authPlugin(options) {
|
|
40
|
-
return definePlugin("auth", {
|
|
41
|
-
|
|
42
|
+
return definePlugin("auth", ({ runtime }) => {
|
|
43
|
+
runtime.use(authzMiddleware(options));
|
|
42
44
|
});
|
|
43
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Dev/test Authorizer that allows every action. Use as a placeholder while
|
|
48
|
+
* the real policy isn't ready, or in tests where authz isn't under test.
|
|
49
|
+
* Never ship in production — every dispatch passes regardless of identity.
|
|
50
|
+
*/
|
|
51
|
+
export const allowAllAuthorizer = {
|
|
52
|
+
authorize() {
|
|
53
|
+
/* allow */
|
|
54
|
+
},
|
|
55
|
+
};
|
|
44
56
|
export { identityPlugin, } from "./identity.js";
|
|
45
57
|
// ─── HTTP routes — canonical auth surface ──────────────────────────
|
|
46
|
-
// `
|
|
47
|
-
//
|
|
58
|
+
// `authWires()` returns every `{ binding, handler }` pair for the
|
|
59
|
+
// canonical auth operations; individual `{name}Route` + `{name}Handler`
|
|
48
60
|
// pairs are exported for apps that wire by hand.
|
|
49
|
-
export {
|
|
50
|
-
//# sourceMappingURL=auth.js.map
|
|
61
|
+
export { authWires, signInRoute, signInHandler, signOutRoute, signOutHandler, refreshRoute, refreshHandler, registerRoute, registerHandler, requestPasswordResetRoute, requestPasswordResetHandler, resetPasswordRoute, resetPasswordHandler, verifyEmailRoute, verifyEmailHandler, meRoute, meHandler, } from "./routes.js";
|
package/dist/identity.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Optional flows depend on the IdP's capabilities — gracefully degrade.
|
|
15
15
|
*/
|
|
16
|
-
import type { PluginDefinition } from "@nwire/
|
|
16
|
+
import type { PluginDefinition } from "@nwire/app";
|
|
17
17
|
import type { User } from "./user.js";
|
|
18
18
|
/**
|
|
19
19
|
* Sub-shape: tokens the adapter mints on sign-in or refresh. Most adapters
|
|
@@ -82,4 +82,3 @@ export interface IdentityPluginOptions {
|
|
|
82
82
|
* usual hook).
|
|
83
83
|
*/
|
|
84
84
|
export declare function identityPlugin(options: IdentityPluginOptions): PluginDefinition;
|
|
85
|
-
//# sourceMappingURL=identity.d.ts.map
|
package/dist/identity.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Optional flows depend on the IdP's capabilities — gracefully degrade.
|
|
15
15
|
*/
|
|
16
|
-
import { definePlugin } from "@nwire/
|
|
16
|
+
import { definePlugin } from "@nwire/app";
|
|
17
17
|
/**
|
|
18
18
|
* Identity plugin — registers the adapter on the container. HTTP-level
|
|
19
19
|
* token extraction (Authorization header, session cookie, etc.) lives in
|
|
@@ -22,14 +22,11 @@ import { definePlugin } from "@nwire/forge";
|
|
|
22
22
|
*/
|
|
23
23
|
export function identityPlugin(options) {
|
|
24
24
|
const name = options.name ?? "idp";
|
|
25
|
-
return definePlugin("identity", {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
shutdown: async () => {
|
|
25
|
+
return definePlugin("identity", ({ bind, dispose }) => {
|
|
26
|
+
bind(name, options.adapter);
|
|
27
|
+
dispose(async () => {
|
|
30
28
|
if (options.adapter.shutdown)
|
|
31
29
|
await options.adapter.shutdown();
|
|
32
|
-
}
|
|
30
|
+
});
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
|
-
//# sourceMappingURL=identity.js.map
|
package/dist/routes.d.ts
CHANGED
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auth routes — `{name}Route` + `{name}Handler` pairs for every canonical
|
|
3
|
-
* identity operation.
|
|
4
|
-
* the `
|
|
3
|
+
* identity operation. Use `authWires()` to mount the full set in one go,
|
|
4
|
+
* or import the individual `{Route, Handler}` pairs and wire them by hand.
|
|
5
5
|
*
|
|
6
|
-
* import {
|
|
7
|
-
* import {
|
|
8
|
-
*
|
|
9
|
-
* const api = mountAuth(httpInterface({ prefix: "/api/v1" }));
|
|
10
|
-
* // mounts: POST /auth/sign-in, /sign-out, /refresh, /register,
|
|
11
|
-
* // /request-password-reset, /reset-password, /verify-email,
|
|
12
|
-
* // GET /auth/me
|
|
6
|
+
* import { createApp } from "@nwire/app";
|
|
7
|
+
* import { identityPlugin, authWires } from "@nwire/auth";
|
|
13
8
|
*
|
|
14
9
|
* const app = createApp({
|
|
10
|
+
* appName: "api",
|
|
15
11
|
* plugins: [identityPlugin({ adapter })],
|
|
16
|
-
* ...
|
|
17
12
|
* });
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
13
|
+
* for (const { binding, handler } of authWires()) {
|
|
14
|
+
* app.wire(binding, handler);
|
|
15
|
+
* }
|
|
21
16
|
*
|
|
22
17
|
* Each handler reads `idp` from the container (registered by
|
|
23
18
|
* `identityPlugin`) and delegates the business logic to the adapter.
|
|
24
|
-
* Apps that want only a subset of operations import individual
|
|
25
|
-
* `{Route, Handler}` pairs and wire them by hand instead of using
|
|
26
|
-
* `mountAuth`.
|
|
27
19
|
*/
|
|
28
20
|
import { z } from "zod";
|
|
29
|
-
import { type
|
|
21
|
+
import { type RouteBinding } from "@nwire/wires/http";
|
|
22
|
+
type AuthHandlerCtx = {
|
|
23
|
+
resolve<T>(name: string): T;
|
|
24
|
+
};
|
|
25
|
+
type AuthHandler<TInput, TOutput = unknown> = (input: TInput, ctx: AuthHandlerCtx) => Promise<TOutput> | TOutput;
|
|
30
26
|
declare const SignInBody: z.ZodObject<{
|
|
31
27
|
email: z.ZodEmail;
|
|
32
28
|
password: z.ZodString;
|
|
@@ -64,36 +60,38 @@ type ResetPasswordInput = z.output<typeof ResetPasswordBody>;
|
|
|
64
60
|
type VerifyEmailInput = z.output<typeof VerifyEmailBody>;
|
|
65
61
|
type MeInput = z.output<typeof MeBody>;
|
|
66
62
|
export declare const signInRoute: RouteBinding<SignInInput>;
|
|
67
|
-
export declare const signInHandler:
|
|
63
|
+
export declare const signInHandler: AuthHandler<SignInInput>;
|
|
68
64
|
export declare const signOutRoute: RouteBinding<SignOutInput>;
|
|
69
|
-
export declare const signOutHandler:
|
|
65
|
+
export declare const signOutHandler: AuthHandler<SignOutInput>;
|
|
70
66
|
export declare const refreshRoute: RouteBinding<RefreshInput>;
|
|
71
|
-
export declare const refreshHandler:
|
|
67
|
+
export declare const refreshHandler: AuthHandler<RefreshInput>;
|
|
72
68
|
export declare const registerRoute: RouteBinding<RegisterInput>;
|
|
73
|
-
export declare const registerHandler:
|
|
69
|
+
export declare const registerHandler: AuthHandler<RegisterInput>;
|
|
74
70
|
export declare const requestPasswordResetRoute: RouteBinding<RequestPwResetInput>;
|
|
75
|
-
export declare const requestPasswordResetHandler:
|
|
71
|
+
export declare const requestPasswordResetHandler: AuthHandler<RequestPwResetInput>;
|
|
76
72
|
export declare const resetPasswordRoute: RouteBinding<ResetPasswordInput>;
|
|
77
|
-
export declare const resetPasswordHandler:
|
|
73
|
+
export declare const resetPasswordHandler: AuthHandler<ResetPasswordInput>;
|
|
78
74
|
export declare const verifyEmailRoute: RouteBinding<VerifyEmailInput>;
|
|
79
|
-
export declare const verifyEmailHandler:
|
|
75
|
+
export declare const verifyEmailHandler: AuthHandler<VerifyEmailInput>;
|
|
80
76
|
export declare const meRoute: RouteBinding<MeInput>;
|
|
81
|
-
export declare const meHandler:
|
|
82
|
-
export interface
|
|
77
|
+
export declare const meHandler: AuthHandler<MeInput>;
|
|
78
|
+
export interface AuthWiresOptions {
|
|
83
79
|
/** Pick which routes to mount. Default — all. */
|
|
84
80
|
readonly include?: ReadonlyArray<"signIn" | "signOut" | "refresh" | "register" | "requestPasswordReset" | "resetPassword" | "verifyEmail" | "me">;
|
|
85
81
|
}
|
|
86
82
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* to mount only a subset (e.g. an app that doesn't expose registration).
|
|
83
|
+
* `authWires(options?)` — returns the canonical auth route wires as
|
|
84
|
+
* `{ binding, handler }` pairs. Use with `app.wire(...)`:
|
|
90
85
|
*
|
|
91
|
-
* const
|
|
92
|
-
*
|
|
86
|
+
* const app = createApp({ appName: "auth" });
|
|
87
|
+
* for (const { binding, handler } of authWires()) {
|
|
88
|
+
* app.wire(binding, handler);
|
|
89
|
+
* }
|
|
93
90
|
*
|
|
94
|
-
*
|
|
95
|
-
* mountAuth(api, { include: ["signIn", "signOut", "me"] });
|
|
91
|
+
* `options.include` mounts only a subset.
|
|
96
92
|
*/
|
|
97
|
-
export declare function
|
|
93
|
+
export declare function authWires(options?: AuthWiresOptions): ReadonlyArray<{
|
|
94
|
+
binding: unknown;
|
|
95
|
+
handler: unknown;
|
|
96
|
+
}>;
|
|
98
97
|
export {};
|
|
99
|
-
//# sourceMappingURL=routes.d.ts.map
|
package/dist/routes.js
CHANGED
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auth routes — `{name}Route` + `{name}Handler` pairs for every canonical
|
|
3
|
-
* identity operation.
|
|
4
|
-
* the `
|
|
3
|
+
* identity operation. Use `authWires()` to mount the full set in one go,
|
|
4
|
+
* or import the individual `{Route, Handler}` pairs and wire them by hand.
|
|
5
5
|
*
|
|
6
|
-
* import {
|
|
7
|
-
* import {
|
|
8
|
-
*
|
|
9
|
-
* const api = mountAuth(httpInterface({ prefix: "/api/v1" }));
|
|
10
|
-
* // mounts: POST /auth/sign-in, /sign-out, /refresh, /register,
|
|
11
|
-
* // /request-password-reset, /reset-password, /verify-email,
|
|
12
|
-
* // GET /auth/me
|
|
6
|
+
* import { createApp } from "@nwire/app";
|
|
7
|
+
* import { identityPlugin, authWires } from "@nwire/auth";
|
|
13
8
|
*
|
|
14
9
|
* const app = createApp({
|
|
10
|
+
* appName: "api",
|
|
15
11
|
* plugins: [identityPlugin({ adapter })],
|
|
16
|
-
* ...
|
|
17
12
|
* });
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
13
|
+
* for (const { binding, handler } of authWires()) {
|
|
14
|
+
* app.wire(binding, handler);
|
|
15
|
+
* }
|
|
21
16
|
*
|
|
22
17
|
* Each handler reads `idp` from the container (registered by
|
|
23
18
|
* `identityPlugin`) and delegates the business logic to the adapter.
|
|
24
|
-
* Apps that want only a subset of operations import individual
|
|
25
|
-
* `{Route, Handler}` pairs and wire them by hand instead of using
|
|
26
|
-
* `mountAuth`.
|
|
27
19
|
*/
|
|
28
20
|
import { z } from "zod";
|
|
29
21
|
import { defineResource, NotFound } from "@nwire/forge";
|
|
30
|
-
import { post, get } from "@nwire/http";
|
|
22
|
+
import { post, get } from "@nwire/wires/http";
|
|
31
23
|
import { response } from "@nwire/handler";
|
|
32
24
|
// ─── Resources (response shapes) ───────────────────────────────────
|
|
33
25
|
const UserResource = defineResource("User", {
|
|
@@ -83,7 +75,7 @@ export const signInRoute = post("/auth/sign-in", {
|
|
|
83
75
|
returns: [ok200SignIn],
|
|
84
76
|
},
|
|
85
77
|
});
|
|
86
|
-
export const signInHandler = async (
|
|
78
|
+
export const signInHandler = async (input, { resolve }) => {
|
|
87
79
|
const idp = resolve("idp");
|
|
88
80
|
const result = await idp.signIn({ email: input.email, password: input.password });
|
|
89
81
|
return ok200SignIn(result);
|
|
@@ -99,7 +91,7 @@ export const signOutRoute = post("/auth/sign-out", {
|
|
|
99
91
|
returns: [ok202],
|
|
100
92
|
},
|
|
101
93
|
});
|
|
102
|
-
export const signOutHandler = async (
|
|
94
|
+
export const signOutHandler = async (input, { resolve }) => {
|
|
103
95
|
const idp = resolve("idp");
|
|
104
96
|
await idp.signOut(input.token);
|
|
105
97
|
return ok202();
|
|
@@ -115,7 +107,7 @@ export const refreshRoute = post("/auth/refresh", {
|
|
|
115
107
|
returns: [ok200Tokens],
|
|
116
108
|
},
|
|
117
109
|
});
|
|
118
|
-
export const refreshHandler = async (
|
|
110
|
+
export const refreshHandler = async (input, { resolve }) => {
|
|
119
111
|
const idp = resolve("idp");
|
|
120
112
|
if (!idp.refresh)
|
|
121
113
|
throw NotFound({ operation: "auth.Refresh", reason: "not supported by adapter" });
|
|
@@ -133,7 +125,7 @@ export const registerRoute = post("/auth/register", {
|
|
|
133
125
|
returns: [ok200SignIn],
|
|
134
126
|
},
|
|
135
127
|
});
|
|
136
|
-
export const registerHandler = async (
|
|
128
|
+
export const registerHandler = async (input, { resolve }) => {
|
|
137
129
|
const idp = resolve("idp");
|
|
138
130
|
if (!idp.register)
|
|
139
131
|
throw NotFound({ operation: "auth.Register", reason: "not supported by adapter" });
|
|
@@ -158,7 +150,7 @@ export const requestPasswordResetRoute = post("/auth/request-password-reset", {
|
|
|
158
150
|
returns: [ok202],
|
|
159
151
|
},
|
|
160
152
|
});
|
|
161
|
-
export const requestPasswordResetHandler = async (
|
|
153
|
+
export const requestPasswordResetHandler = async (input, { resolve }) => {
|
|
162
154
|
const idp = resolve("idp");
|
|
163
155
|
if (!idp.requestPasswordReset)
|
|
164
156
|
throw NotFound({ operation: "auth.RequestPasswordReset" });
|
|
@@ -176,7 +168,7 @@ export const resetPasswordRoute = post("/auth/reset-password", {
|
|
|
176
168
|
returns: [ok202],
|
|
177
169
|
},
|
|
178
170
|
});
|
|
179
|
-
export const resetPasswordHandler = async (
|
|
171
|
+
export const resetPasswordHandler = async (input, { resolve }) => {
|
|
180
172
|
const idp = resolve("idp");
|
|
181
173
|
if (!idp.resetPassword)
|
|
182
174
|
throw NotFound({ operation: "auth.ResetPassword" });
|
|
@@ -194,7 +186,7 @@ export const verifyEmailRoute = post("/auth/verify-email", {
|
|
|
194
186
|
returns: [ok202],
|
|
195
187
|
},
|
|
196
188
|
});
|
|
197
|
-
export const verifyEmailHandler = async (
|
|
189
|
+
export const verifyEmailHandler = async (input, { resolve }) => {
|
|
198
190
|
const idp = resolve("idp");
|
|
199
191
|
if (!idp.verifyEmail)
|
|
200
192
|
throw NotFound({ operation: "auth.VerifyEmail" });
|
|
@@ -212,7 +204,7 @@ export const meRoute = get("/auth/me", {
|
|
|
212
204
|
returns: [ok200User],
|
|
213
205
|
},
|
|
214
206
|
});
|
|
215
|
-
export const meHandler = async (
|
|
207
|
+
export const meHandler = async (input, { resolve }) => {
|
|
216
208
|
const idp = resolve("idp");
|
|
217
209
|
const user = await idp.verifyToken(input.token);
|
|
218
210
|
if (!user)
|
|
@@ -220,17 +212,17 @@ export const meHandler = async ({ input, resolve }) => {
|
|
|
220
212
|
return ok200User(user);
|
|
221
213
|
};
|
|
222
214
|
/**
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
* to mount only a subset (e.g. an app that doesn't expose registration).
|
|
215
|
+
* `authWires(options?)` — returns the canonical auth route wires as
|
|
216
|
+
* `{ binding, handler }` pairs. Use with `app.wire(...)`:
|
|
226
217
|
*
|
|
227
|
-
* const
|
|
228
|
-
*
|
|
218
|
+
* const app = createApp({ appName: "auth" });
|
|
219
|
+
* for (const { binding, handler } of authWires()) {
|
|
220
|
+
* app.wire(binding, handler);
|
|
221
|
+
* }
|
|
229
222
|
*
|
|
230
|
-
*
|
|
231
|
-
* mountAuth(api, { include: ["signIn", "signOut", "me"] });
|
|
223
|
+
* `options.include` mounts only a subset.
|
|
232
224
|
*/
|
|
233
|
-
export function
|
|
225
|
+
export function authWires(options) {
|
|
234
226
|
const all = {
|
|
235
227
|
signIn: [signInRoute, signInHandler],
|
|
236
228
|
signOut: [signOutRoute, signOutHandler],
|
|
@@ -242,11 +234,8 @@ export function mountAuth(api, options) {
|
|
|
242
234
|
me: [meRoute, meHandler],
|
|
243
235
|
};
|
|
244
236
|
const keys = options?.include ?? Object.keys(all);
|
|
245
|
-
|
|
246
|
-
const [
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
return api;
|
|
237
|
+
return keys.map((k) => {
|
|
238
|
+
const [binding, handler] = all[k];
|
|
239
|
+
return { binding, handler };
|
|
240
|
+
});
|
|
251
241
|
}
|
|
252
|
-
//# sourceMappingURL=routes.js.map
|
package/dist/user.d.ts
CHANGED
package/dist/user.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nwire/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Nwire — authorization contract + middleware. Authorizer interface (throw-on-deny) + authzMiddleware. Per-action `policy` tag is opaque to the framework; the authorizer decides what each tag means.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auth",
|
|
@@ -29,15 +29,18 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"zod": "^4.0.0",
|
|
32
|
-
"@nwire/
|
|
33
|
-
"@nwire/handler": "0.
|
|
34
|
-
"@nwire/
|
|
32
|
+
"@nwire/app": "0.10.1",
|
|
33
|
+
"@nwire/handler": "0.10.1",
|
|
34
|
+
"@nwire/wires": "0.10.1",
|
|
35
|
+
"@nwire/forge": "0.10.1"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@types/node": "^22.19.9",
|
|
38
39
|
"typescript": "^5.9.3",
|
|
39
40
|
"vitest": "^4.0.18",
|
|
40
|
-
"@nwire/envelope": "0.
|
|
41
|
+
"@nwire/envelope": "0.10.1",
|
|
42
|
+
"@nwire/endpoint": "0.10.1",
|
|
43
|
+
"@nwire/koa": "0.10.1"
|
|
41
44
|
},
|
|
42
45
|
"scripts": {
|
|
43
46
|
"build": "tsc && node ../../scripts/fix-dist-extensions.mjs dist",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/auth.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* authzMiddleware contract — runs an Authorizer before the handler. Allows
|
|
3
|
-
* by returning, denies by throwing. Optional opt-out for policy-less actions.
|
|
4
|
-
*/
|
|
5
|
-
import { describe, it, expect } from "vitest";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { defineAction, defineHandler, Runtime } from "@nwire/forge";
|
|
8
|
-
import { seedEnvelope } from "@nwire/envelope";
|
|
9
|
-
import { authzMiddleware, UnauthorizedError, ForbiddenError } from "../auth.js";
|
|
10
|
-
describe("authzMiddleware", () => {
|
|
11
|
-
it("runs the handler when the authorizer returns", async () => {
|
|
12
|
-
const action = defineAction({ name: "auth.ok", schema: z.object({}) });
|
|
13
|
-
let ran = false;
|
|
14
|
-
const handler = defineHandler(action, async () => {
|
|
15
|
-
ran = true;
|
|
16
|
-
return undefined;
|
|
17
|
-
});
|
|
18
|
-
const allowAll = { async authorize() { } };
|
|
19
|
-
const runtime = new Runtime();
|
|
20
|
-
runtime.registerHandler(handler);
|
|
21
|
-
runtime.use(authzMiddleware({ authorizer: allowAll }));
|
|
22
|
-
await runtime.dispatch(action, {});
|
|
23
|
-
expect(ran).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
it("blocks the handler when the authorizer throws", async () => {
|
|
26
|
-
const action = defineAction({ name: "auth.deny", schema: z.object({}) });
|
|
27
|
-
let ran = false;
|
|
28
|
-
const handler = defineHandler(action, async () => {
|
|
29
|
-
ran = true;
|
|
30
|
-
return undefined;
|
|
31
|
-
});
|
|
32
|
-
const denyAll = {
|
|
33
|
-
async authorize() {
|
|
34
|
-
throw new UnauthorizedError("no token");
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
const runtime = new Runtime();
|
|
38
|
-
runtime.registerHandler(handler);
|
|
39
|
-
runtime.use(authzMiddleware({ authorizer: denyAll }));
|
|
40
|
-
await expect(runtime.dispatch(action, {})).rejects.toThrow(UnauthorizedError);
|
|
41
|
-
expect(ran).toBe(false);
|
|
42
|
-
});
|
|
43
|
-
it("reads action.policy and ctx.envelope.userId to decide", async () => {
|
|
44
|
-
const adminOnly = defineAction({
|
|
45
|
-
name: "auth.admin",
|
|
46
|
-
schema: z.object({}),
|
|
47
|
-
policy: "admin-only",
|
|
48
|
-
});
|
|
49
|
-
const handler = defineHandler(adminOnly, async () => undefined);
|
|
50
|
-
const adminAuthorizer = {
|
|
51
|
-
async authorize(action, ctx) {
|
|
52
|
-
if (action.policy === "admin-only" && ctx.envelope.userId !== "miri") {
|
|
53
|
-
throw new ForbiddenError("admins only");
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
const runtime = new Runtime();
|
|
58
|
-
runtime.registerHandler(handler);
|
|
59
|
-
runtime.use(authzMiddleware({ authorizer: adminAuthorizer }));
|
|
60
|
-
// Wrong user → forbidden
|
|
61
|
-
await expect(runtime.dispatch(adminOnly, {}, seedEnvelope({ userId: "avi" }))).rejects.toThrow(ForbiddenError);
|
|
62
|
-
// Right user → allowed
|
|
63
|
-
await runtime.dispatch(adminOnly, {}, seedEnvelope({ userId: "miri" }));
|
|
64
|
-
});
|
|
65
|
-
it("with enforceAll: false, skips actions that have no policy", async () => {
|
|
66
|
-
const publicAction = defineAction({ name: "auth.public", schema: z.object({}) });
|
|
67
|
-
const guardedAction = defineAction({
|
|
68
|
-
name: "auth.guarded",
|
|
69
|
-
schema: z.object({}),
|
|
70
|
-
policy: "login-required",
|
|
71
|
-
});
|
|
72
|
-
const handlerA = defineHandler(publicAction, async () => undefined);
|
|
73
|
-
const handlerB = defineHandler(guardedAction, async () => undefined);
|
|
74
|
-
let authorizerCalls = 0;
|
|
75
|
-
const authorizer = {
|
|
76
|
-
async authorize() {
|
|
77
|
-
authorizerCalls++;
|
|
78
|
-
throw new UnauthorizedError();
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
const runtime = new Runtime();
|
|
82
|
-
runtime.registerHandler(handlerA);
|
|
83
|
-
runtime.registerHandler(handlerB);
|
|
84
|
-
runtime.use(authzMiddleware({ authorizer, enforceAll: false }));
|
|
85
|
-
await runtime.dispatch(publicAction, {}); // skipped
|
|
86
|
-
expect(authorizerCalls).toBe(0);
|
|
87
|
-
await expect(runtime.dispatch(guardedAction, {})).rejects.toThrow(UnauthorizedError);
|
|
88
|
-
expect(authorizerCalls).toBe(1);
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
//# sourceMappingURL=auth.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.test.js","sourceRoot":"","sources":["../../src/__tests__/auth.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAC;AAE9F,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACvE,IAAI,GAAG,GAAG,KAAK,CAAC;QAChB,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE;YAC/C,GAAG,GAAG,IAAI,CAAC;YACX,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAe,EAAE,KAAK,CAAC,SAAS,KAAI,CAAC,EAAE,CAAC;QACtD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;QAC9B,OAAO,CAAC,eAAe,CAAC,OA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
3
|
-
* IdpAdapter is registered, and that the identityPlugin wires the adapter
|
|
4
|
-
* onto the container in time for resolvers to use it.
|
|
5
|
-
*
|
|
6
|
-
* We don't ship a real adapter at this layer (those live in
|
|
7
|
-
* @nwire/auth-better-auth / @nwire/auth-logto / @nwire/auth-passport).
|
|
8
|
-
* The test uses a hand-rolled fake adapter that captures calls so we can
|
|
9
|
-
* assert routing without depending on an external IdP.
|
|
10
|
-
*/
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=identity.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/identity.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Identity contract — proves canonical resolvers delegate to whatever
|
|
3
|
-
* IdpAdapter is registered, and that the identityPlugin wires the adapter
|
|
4
|
-
* onto the container in time for resolvers to use it.
|
|
5
|
-
*
|
|
6
|
-
* We don't ship a real adapter at this layer (those live in
|
|
7
|
-
* @nwire/auth-better-auth / @nwire/auth-logto / @nwire/auth-passport).
|
|
8
|
-
* The test uses a hand-rolled fake adapter that captures calls so we can
|
|
9
|
-
* assert routing without depending on an external IdP.
|
|
10
|
-
*/
|
|
11
|
-
import { describe, it, expect } from "vitest";
|
|
12
|
-
import { createApp, defineModule } from "@nwire/forge";
|
|
13
|
-
import { identityPlugin, SignIn, SignOut, Refresh, Register, Me, } from "../auth.js";
|
|
14
|
-
function fakeAdapter() {
|
|
15
|
-
const calls = [];
|
|
16
|
-
const users = new Map();
|
|
17
|
-
return {
|
|
18
|
-
calls,
|
|
19
|
-
users,
|
|
20
|
-
async verifyToken(token) {
|
|
21
|
-
calls.push({ name: "verifyToken", args: [token] });
|
|
22
|
-
return users.get(token) ?? null;
|
|
23
|
-
},
|
|
24
|
-
async signIn(input) {
|
|
25
|
-
calls.push({ name: "signIn", args: [input] });
|
|
26
|
-
const user = { id: "u_1", email: input.email ?? "x@y.z" };
|
|
27
|
-
users.set("tok-1", user);
|
|
28
|
-
return { user, tokens: { accessToken: "tok-1", refreshToken: "ref-1" } };
|
|
29
|
-
},
|
|
30
|
-
async signOut(token) {
|
|
31
|
-
calls.push({ name: "signOut", args: [token] });
|
|
32
|
-
users.delete(token);
|
|
33
|
-
},
|
|
34
|
-
async refresh(refreshToken) {
|
|
35
|
-
calls.push({ name: "refresh", args: [refreshToken] });
|
|
36
|
-
return { accessToken: "tok-2" };
|
|
37
|
-
},
|
|
38
|
-
async register(input) {
|
|
39
|
-
calls.push({ name: "register", args: [input] });
|
|
40
|
-
const user = { id: "u_new", email: input.email };
|
|
41
|
-
return { user, tokens: { accessToken: "tok-new" } };
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
const empty = defineModule("empty", {});
|
|
46
|
-
describe("identityPlugin + canonical resolvers", () => {
|
|
47
|
-
it("registers the adapter on the container under 'idp'", async () => {
|
|
48
|
-
const adapter = fakeAdapter();
|
|
49
|
-
const app = createApp({
|
|
50
|
-
modules: [empty],
|
|
51
|
-
plugins: [identityPlugin({ adapter })],
|
|
52
|
-
});
|
|
53
|
-
await app.start();
|
|
54
|
-
const resolved = app.runtime.getContainer().resolve("idp");
|
|
55
|
-
expect(resolved).toBe(adapter);
|
|
56
|
-
await app.stop();
|
|
57
|
-
});
|
|
58
|
-
it("SignIn delegates to adapter.signIn and returns user + tokens", async () => {
|
|
59
|
-
const adapter = fakeAdapter();
|
|
60
|
-
const app = createApp({
|
|
61
|
-
modules: [empty],
|
|
62
|
-
plugins: [identityPlugin({ adapter })],
|
|
63
|
-
});
|
|
64
|
-
await app.start();
|
|
65
|
-
const result = await app.callResolver(SignIn, {
|
|
66
|
-
input: { email: "alice@example.com", password: "secret123" },
|
|
67
|
-
});
|
|
68
|
-
expect(adapter.calls[0]?.name).toBe("signIn");
|
|
69
|
-
expect(result.body.user.id).toBe("u_1");
|
|
70
|
-
expect(result.body.tokens.accessToken).toBe("tok-1");
|
|
71
|
-
await app.stop();
|
|
72
|
-
});
|
|
73
|
-
it("SignOut + verify roundtrip — Me returns user before sign-out, NotFound after", async () => {
|
|
74
|
-
const adapter = fakeAdapter();
|
|
75
|
-
const app = createApp({
|
|
76
|
-
modules: [empty],
|
|
77
|
-
plugins: [identityPlugin({ adapter })],
|
|
78
|
-
});
|
|
79
|
-
await app.start();
|
|
80
|
-
await app.callResolver(SignIn, {
|
|
81
|
-
input: { email: "alice@example.com", password: "secret123" },
|
|
82
|
-
});
|
|
83
|
-
const me1 = await app.callResolver(Me, { input: { token: "tok-1" } });
|
|
84
|
-
expect(me1.body.id).toBe("u_1");
|
|
85
|
-
await app.callResolver(SignOut, { input: { token: "tok-1" } });
|
|
86
|
-
await expect(app.callResolver(Me, { input: { token: "tok-1" } })).rejects.toThrow();
|
|
87
|
-
await app.stop();
|
|
88
|
-
});
|
|
89
|
-
it("Refresh delegates when adapter supports it", async () => {
|
|
90
|
-
const adapter = fakeAdapter();
|
|
91
|
-
const app = createApp({
|
|
92
|
-
modules: [empty],
|
|
93
|
-
plugins: [identityPlugin({ adapter })],
|
|
94
|
-
});
|
|
95
|
-
await app.start();
|
|
96
|
-
const result = await app.callResolver(Refresh, { input: { refreshToken: "ref-1" } });
|
|
97
|
-
expect(result.body.accessToken).toBe("tok-2");
|
|
98
|
-
await app.stop();
|
|
99
|
-
});
|
|
100
|
-
it("Register returns user + initial tokens", async () => {
|
|
101
|
-
const adapter = fakeAdapter();
|
|
102
|
-
const app = createApp({
|
|
103
|
-
modules: [empty],
|
|
104
|
-
plugins: [identityPlugin({ adapter })],
|
|
105
|
-
});
|
|
106
|
-
await app.start();
|
|
107
|
-
const result = await app.callResolver(Register, {
|
|
108
|
-
input: { email: "new@example.com", password: "long-enough-password" },
|
|
109
|
-
});
|
|
110
|
-
expect(result.body.user.email).toBe("new@example.com");
|
|
111
|
-
expect(result.body.tokens.accessToken).toBe("tok-new");
|
|
112
|
-
await app.stop();
|
|
113
|
-
});
|
|
114
|
-
it("Refresh throws NotFound when adapter omits refresh()", async () => {
|
|
115
|
-
const adapter = fakeAdapter();
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
117
|
-
delete adapter.refresh;
|
|
118
|
-
const app = createApp({
|
|
119
|
-
modules: [empty],
|
|
120
|
-
plugins: [identityPlugin({ adapter })],
|
|
121
|
-
});
|
|
122
|
-
await app.start();
|
|
123
|
-
await expect(app.callResolver(Refresh, { input: { refreshToken: "x" } })).rejects.toThrow();
|
|
124
|
-
await app.stop();
|
|
125
|
-
});
|
|
126
|
-
it("adapter.shutdown is called on app.stop()", async () => {
|
|
127
|
-
let shutdownCalled = false;
|
|
128
|
-
const adapter = {
|
|
129
|
-
...fakeAdapter(),
|
|
130
|
-
shutdown: async () => { shutdownCalled = true; },
|
|
131
|
-
};
|
|
132
|
-
const app = createApp({
|
|
133
|
-
modules: [empty],
|
|
134
|
-
plugins: [identityPlugin({ adapter })],
|
|
135
|
-
});
|
|
136
|
-
await app.start();
|
|
137
|
-
await app.stop();
|
|
138
|
-
expect(shutdownCalled).toBe(true);
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
//# sourceMappingURL=identity.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.test.js","sourceRoot":"","sources":["../../src/__tests__/identity.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,cAAc,EACd,MAAM,EACN,OAAO,EACP,OAAO,EACP,QAAQ,EACR,EAAE,GAGH,MAAM,SAAS,CAAC;AAEjB,SAAS,WAAW;IAIlB,MAAM,KAAK,GAAwC,EAAE,CAAC;IACtD,MAAM,KAAK,GAAG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AAC,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;SACvC,CAAC,CAAC;QACH,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* End-to-end test for the new `{name}Route` + `{name}Handler` shape that
|
|
3
|
-
* supersedes the resolver-based exports. Boots a real http.Server, mounts
|
|
4
|
-
* every canonical auth route via `mountAuth(api)`, and exercises sign-in
|
|
5
|
-
* → me → sign-out via fetch.
|
|
6
|
-
*
|
|
7
|
-
* The fake adapter is the same one identity.test.ts uses — exercises the
|
|
8
|
-
* full path: routing → middleware → schema validation → container resolve
|
|
9
|
-
* → adapter call → resource projection → response.
|
|
10
|
-
*/
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=routes.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routes.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/routes.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* End-to-end test for the new `{name}Route` + `{name}Handler` shape that
|
|
3
|
-
* supersedes the resolver-based exports. Boots a real http.Server, mounts
|
|
4
|
-
* every canonical auth route via `mountAuth(api)`, and exercises sign-in
|
|
5
|
-
* → me → sign-out via fetch.
|
|
6
|
-
*
|
|
7
|
-
* The fake adapter is the same one identity.test.ts uses — exercises the
|
|
8
|
-
* full path: routing → middleware → schema validation → container resolve
|
|
9
|
-
* → adapter call → resource projection → response.
|
|
10
|
-
*/
|
|
11
|
-
import { describe, it, expect, beforeAll, afterAll } from "vitest";
|
|
12
|
-
import http from "node:http";
|
|
13
|
-
import { createApp, defineModule } from "@nwire/forge";
|
|
14
|
-
import { httpInterface } from "@nwire/http";
|
|
15
|
-
import { identityPlugin, mountAuth } from "../auth.js";
|
|
16
|
-
function fakeAdapter() {
|
|
17
|
-
const users = new Map();
|
|
18
|
-
return {
|
|
19
|
-
users,
|
|
20
|
-
async verifyToken(token) {
|
|
21
|
-
return users.get(token) ?? null;
|
|
22
|
-
},
|
|
23
|
-
async signIn(input) {
|
|
24
|
-
const user = { id: "u_1", email: input.email ?? "x@y.z" };
|
|
25
|
-
users.set("tok-1", user);
|
|
26
|
-
return { user, tokens: { accessToken: "tok-1", refreshToken: "ref-1" } };
|
|
27
|
-
},
|
|
28
|
-
async signOut(token) {
|
|
29
|
-
users.delete(token);
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const empty = defineModule("empty", {});
|
|
34
|
-
let server;
|
|
35
|
-
let baseUrl;
|
|
36
|
-
let adapter;
|
|
37
|
-
beforeAll(async () => {
|
|
38
|
-
adapter = fakeAdapter();
|
|
39
|
-
const app = createApp({
|
|
40
|
-
modules: [empty],
|
|
41
|
-
plugins: [identityPlugin({ adapter })],
|
|
42
|
-
});
|
|
43
|
-
await app.start();
|
|
44
|
-
const api = mountAuth(httpInterface({ prefix: "/api/v1" }).provide(app.runtime.getContainer()));
|
|
45
|
-
server = http.createServer(api.compile());
|
|
46
|
-
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
47
|
-
const addr = server.address();
|
|
48
|
-
baseUrl = `http://127.0.0.1:${addr.port}/api/v1`;
|
|
49
|
-
});
|
|
50
|
-
afterAll(async () => {
|
|
51
|
-
await new Promise((resolve, reject) => server.close((err) => (err ? reject(err) : resolve())));
|
|
52
|
-
});
|
|
53
|
-
async function req(method, path, body) {
|
|
54
|
-
const res = await fetch(`${baseUrl}${path}`, {
|
|
55
|
-
method,
|
|
56
|
-
headers: { "content-type": "application/json" },
|
|
57
|
-
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
58
|
-
});
|
|
59
|
-
const text = await res.text();
|
|
60
|
-
let parsed = text;
|
|
61
|
-
try {
|
|
62
|
-
parsed = text ? JSON.parse(text) : undefined;
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
/* leave as text */
|
|
66
|
-
}
|
|
67
|
-
return { status: res.status, body: parsed };
|
|
68
|
-
}
|
|
69
|
-
describe("mountAuth — canonical auth routes over real HTTP", () => {
|
|
70
|
-
it("POST /auth/sign-in returns the user + tokens", async () => {
|
|
71
|
-
const res = await req("POST", "/auth/sign-in", {
|
|
72
|
-
email: "alice@example.com",
|
|
73
|
-
password: "secret123",
|
|
74
|
-
});
|
|
75
|
-
expect(res.status).toBe(200);
|
|
76
|
-
expect(res.body.user.id).toBe("u_1");
|
|
77
|
-
expect(res.body.tokens.accessToken).toBe("tok-1");
|
|
78
|
-
});
|
|
79
|
-
it("POST /auth/sign-in with bad body returns 400", async () => {
|
|
80
|
-
const res = await req("POST", "/auth/sign-in", { email: "not-an-email", password: "x" });
|
|
81
|
-
expect(res.status).toBe(400);
|
|
82
|
-
expect(res.body.error.code).toBe("validation_failed");
|
|
83
|
-
});
|
|
84
|
-
it("POST /auth/sign-out + GET /auth/me — token invalidates", async () => {
|
|
85
|
-
// Make sure we have a valid token first
|
|
86
|
-
await req("POST", "/auth/sign-in", { email: "alice@example.com", password: "secret123" });
|
|
87
|
-
const me1 = await req("POST", "/auth/me", { token: "tok-1" });
|
|
88
|
-
// NOTE: meRoute is GET in the spec but takes a token in body; fetch
|
|
89
|
-
// with GET + body is non-standard. The route definition uses GET +
|
|
90
|
-
// body, which Koa accepts. Use POST for the test to keep it portable.
|
|
91
|
-
// (We test the route's URL not the verb here; verb portability is
|
|
92
|
-
// a separate concern handled in G5b-3 cleanup.)
|
|
93
|
-
void me1;
|
|
94
|
-
const so = await req("POST", "/auth/sign-out", { token: "tok-1" });
|
|
95
|
-
expect(so.status).toBe(202);
|
|
96
|
-
expect(adapter.users.has("tok-1")).toBe(false);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
//# sourceMappingURL=routes.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routes.test.js","sourceRoot":"","sources":["../../src/__tests__/routes.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,SAAS,EAA8B,MAAM,SAAS,CAAC;AAEhF,SAAS,WAAW;IAClB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAgB,CAAC;IACtC,OAAO;QACL,KAAK;QACL,KAAK,CAAC,WAAW,CAAC,KAAK;YACrB,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;QAClC,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,KAAK;YAChB,MAAM,IAAI,GAAS,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,OAAO,EAAE,CAAC;YAChE,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,CAAC;QAC3E,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,KAAK;YACjB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAExC,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EAAE,UAAU,CAAC;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,gBAAgB,CAU/E"}
|
package/dist/identity.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAwE5C;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAA8B;IAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAAC;IACnC,OAAO,YAAY,CAAC,UAAU,EAAE;QAC9B,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE;YACtB,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;QACD,QAAQ,EAAE,KAAK,IAAI,EAAE;YACnB,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ;gBAAE,MAAM,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACjE,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/resolvers.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical auth resolvers — every adapter inherits these. The resolver
|
|
3
|
-
* body looks up the IdpAdapter on the container and delegates; adapters
|
|
4
|
-
* never re-implement HTTP shape, only the business logic.
|
|
5
|
-
*
|
|
6
|
-
* Apps mount whichever subset they need:
|
|
7
|
-
*
|
|
8
|
-
* import { SignIn, SignOut, Register, Me } from "@nwire/auth";
|
|
9
|
-
* rest.mount([
|
|
10
|
-
* [SignIn, post("/auth/sign-in")],
|
|
11
|
-
* [SignOut, post("/auth/sign-out")],
|
|
12
|
-
* [Register, post("/auth/register")],
|
|
13
|
-
* [Me, get("/auth/me")],
|
|
14
|
-
* ]);
|
|
15
|
-
*/
|
|
16
|
-
import { z } from "zod";
|
|
17
|
-
export declare const SignIn: import("@nwire/forge").ResolverDefinition<undefined, undefined, z.ZodObject<{
|
|
18
|
-
email: z.ZodEmail;
|
|
19
|
-
password: z.ZodString;
|
|
20
|
-
}, z.core.$strip>, {
|
|
21
|
-
email: string;
|
|
22
|
-
password: string;
|
|
23
|
-
}>;
|
|
24
|
-
export declare const SignOut: import("@nwire/forge").ResolverDefinition<undefined, undefined, z.ZodObject<{
|
|
25
|
-
token: z.ZodString;
|
|
26
|
-
}, z.core.$strip>, {
|
|
27
|
-
token: string;
|
|
28
|
-
}>;
|
|
29
|
-
export declare const Refresh: import("@nwire/forge").ResolverDefinition<undefined, undefined, z.ZodObject<{
|
|
30
|
-
refreshToken: z.ZodString;
|
|
31
|
-
}, z.core.$strip>, {
|
|
32
|
-
refreshToken: string;
|
|
33
|
-
}>;
|
|
34
|
-
export declare const Register: import("@nwire/forge").ResolverDefinition<undefined, undefined, z.ZodObject<{
|
|
35
|
-
email: z.ZodEmail;
|
|
36
|
-
password: z.ZodString;
|
|
37
|
-
name: z.ZodOptional<z.ZodString>;
|
|
38
|
-
}, z.core.$strip>, {
|
|
39
|
-
email: string;
|
|
40
|
-
password: string;
|
|
41
|
-
name?: string | undefined;
|
|
42
|
-
}>;
|
|
43
|
-
export declare const RequestPasswordReset: import("@nwire/forge").ResolverDefinition<undefined, undefined, z.ZodObject<{
|
|
44
|
-
email: z.ZodEmail;
|
|
45
|
-
}, z.core.$strip>, {
|
|
46
|
-
email: string;
|
|
47
|
-
}>;
|
|
48
|
-
export declare const ResetPassword: import("@nwire/forge").ResolverDefinition<undefined, undefined, z.ZodObject<{
|
|
49
|
-
resetToken: z.ZodString;
|
|
50
|
-
newPassword: z.ZodString;
|
|
51
|
-
}, z.core.$strip>, {
|
|
52
|
-
resetToken: string;
|
|
53
|
-
newPassword: string;
|
|
54
|
-
}>;
|
|
55
|
-
export declare const VerifyEmail: import("@nwire/forge").ResolverDefinition<undefined, undefined, z.ZodObject<{
|
|
56
|
-
verificationToken: z.ZodString;
|
|
57
|
-
}, z.core.$strip>, {
|
|
58
|
-
verificationToken: string;
|
|
59
|
-
}>;
|
|
60
|
-
export declare const Me: import("@nwire/forge").ResolverDefinition<undefined, undefined, z.ZodObject<{
|
|
61
|
-
token: z.ZodString;
|
|
62
|
-
}, z.core.$strip>, {
|
|
63
|
-
token: string;
|
|
64
|
-
}>;
|
|
65
|
-
//# sourceMappingURL=resolvers.d.ts.map
|
package/dist/resolvers.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../src/resolvers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoCxB,eAAO,MAAM,MAAM;;;;;;EAejB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;EAYlB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;EAalB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;EA0BnB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;EAa/B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;EAgBxB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;EAatB,CAAC;AAEH,eAAO,MAAM,EAAE;;;;EAab,CAAC"}
|
package/dist/resolvers.js
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical auth resolvers — every adapter inherits these. The resolver
|
|
3
|
-
* body looks up the IdpAdapter on the container and delegates; adapters
|
|
4
|
-
* never re-implement HTTP shape, only the business logic.
|
|
5
|
-
*
|
|
6
|
-
* Apps mount whichever subset they need:
|
|
7
|
-
*
|
|
8
|
-
* import { SignIn, SignOut, Register, Me } from "@nwire/auth";
|
|
9
|
-
* rest.mount([
|
|
10
|
-
* [SignIn, post("/auth/sign-in")],
|
|
11
|
-
* [SignOut, post("/auth/sign-out")],
|
|
12
|
-
* [Register, post("/auth/register")],
|
|
13
|
-
* [Me, get("/auth/me")],
|
|
14
|
-
* ]);
|
|
15
|
-
*/
|
|
16
|
-
import { z } from "zod";
|
|
17
|
-
import { defineResource, defineResolver, response, NotFound } from "@nwire/forge";
|
|
18
|
-
const UserPublic = defineResource("User", {
|
|
19
|
-
schema: z.object({
|
|
20
|
-
id: z.string(),
|
|
21
|
-
email: z.string().optional(),
|
|
22
|
-
name: z.string().optional(),
|
|
23
|
-
roles: z.array(z.string()).readonly().optional(),
|
|
24
|
-
tenant: z.string().optional(),
|
|
25
|
-
}),
|
|
26
|
-
});
|
|
27
|
-
const TokensPublic = defineResource("AuthTokens", {
|
|
28
|
-
schema: z.object({
|
|
29
|
-
accessToken: z.string(),
|
|
30
|
-
refreshToken: z.string().optional(),
|
|
31
|
-
idToken: z.string().optional(),
|
|
32
|
-
expiresAt: z.number().optional(),
|
|
33
|
-
tokenType: z.enum(["Bearer", "Cookie"]).optional(),
|
|
34
|
-
}),
|
|
35
|
-
});
|
|
36
|
-
const SignInResult = defineResource("SignInResult", {
|
|
37
|
-
schema: z.object({
|
|
38
|
-
user: UserPublic.schema,
|
|
39
|
-
tokens: TokensPublic.schema,
|
|
40
|
-
}),
|
|
41
|
-
});
|
|
42
|
-
const ok202 = response(202);
|
|
43
|
-
const ok200User = response(200, UserPublic);
|
|
44
|
-
const ok200SignIn = response(200, SignInResult);
|
|
45
|
-
const ok200Tokens = response(200, TokensPublic);
|
|
46
|
-
export const SignIn = defineResolver({
|
|
47
|
-
operation: "auth.SignIn",
|
|
48
|
-
version: 1,
|
|
49
|
-
status: "active",
|
|
50
|
-
summary: "Authenticate with email + password",
|
|
51
|
-
body: z.object({
|
|
52
|
-
email: z.email(),
|
|
53
|
-
password: z.string().min(1),
|
|
54
|
-
}),
|
|
55
|
-
returns: [ok200SignIn],
|
|
56
|
-
errors: [],
|
|
57
|
-
}).use(async ({ input, resolve }) => {
|
|
58
|
-
const idp = resolve("idp");
|
|
59
|
-
const result = await idp.signIn({ email: input.email, password: input.password });
|
|
60
|
-
return ok200SignIn(result);
|
|
61
|
-
});
|
|
62
|
-
export const SignOut = defineResolver({
|
|
63
|
-
operation: "auth.SignOut",
|
|
64
|
-
version: 1,
|
|
65
|
-
status: "active",
|
|
66
|
-
summary: "Invalidate the current session/token",
|
|
67
|
-
body: z.object({ token: z.string() }),
|
|
68
|
-
returns: [ok202],
|
|
69
|
-
errors: [],
|
|
70
|
-
}).use(async ({ input, resolve }) => {
|
|
71
|
-
const idp = resolve("idp");
|
|
72
|
-
await idp.signOut(input.token);
|
|
73
|
-
return ok202();
|
|
74
|
-
});
|
|
75
|
-
export const Refresh = defineResolver({
|
|
76
|
-
operation: "auth.Refresh",
|
|
77
|
-
version: 1,
|
|
78
|
-
status: "active",
|
|
79
|
-
summary: "Exchange a refresh token for a new access token",
|
|
80
|
-
body: z.object({ refreshToken: z.string() }),
|
|
81
|
-
returns: [ok200Tokens],
|
|
82
|
-
errors: [],
|
|
83
|
-
}).use(async ({ input, resolve }) => {
|
|
84
|
-
const idp = resolve("idp");
|
|
85
|
-
if (!idp.refresh)
|
|
86
|
-
throw NotFound.with({ operation: "auth.Refresh", reason: "not supported by adapter" });
|
|
87
|
-
const tokens = await idp.refresh(input.refreshToken);
|
|
88
|
-
return ok200Tokens(tokens);
|
|
89
|
-
});
|
|
90
|
-
export const Register = defineResolver({
|
|
91
|
-
operation: "auth.Register",
|
|
92
|
-
version: 1,
|
|
93
|
-
status: "active",
|
|
94
|
-
summary: "Create a new account",
|
|
95
|
-
body: z.object({
|
|
96
|
-
email: z.email(),
|
|
97
|
-
password: z.string().min(8),
|
|
98
|
-
name: z.string().optional(),
|
|
99
|
-
}),
|
|
100
|
-
returns: [ok200SignIn],
|
|
101
|
-
errors: [],
|
|
102
|
-
}).use(async ({ input, resolve }) => {
|
|
103
|
-
const idp = resolve("idp");
|
|
104
|
-
if (!idp.register)
|
|
105
|
-
throw NotFound.with({ operation: "auth.Register", reason: "not supported by adapter" });
|
|
106
|
-
const result = await idp.register({
|
|
107
|
-
email: input.email,
|
|
108
|
-
password: input.password,
|
|
109
|
-
name: input.name,
|
|
110
|
-
});
|
|
111
|
-
// Some adapters don't mint tokens on register (e.g. email-verification first).
|
|
112
|
-
// Surface a minimal SignInResult so the shape stays consistent.
|
|
113
|
-
return ok200SignIn({
|
|
114
|
-
user: result.user,
|
|
115
|
-
tokens: result.tokens ?? { accessToken: "" },
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
export const RequestPasswordReset = defineResolver({
|
|
119
|
-
operation: "auth.RequestPasswordReset",
|
|
120
|
-
version: 1,
|
|
121
|
-
status: "active",
|
|
122
|
-
summary: "Send a password-reset email",
|
|
123
|
-
body: z.object({ email: z.email() }),
|
|
124
|
-
returns: [ok202],
|
|
125
|
-
errors: [],
|
|
126
|
-
}).use(async ({ input, resolve }) => {
|
|
127
|
-
const idp = resolve("idp");
|
|
128
|
-
if (!idp.requestPasswordReset)
|
|
129
|
-
throw NotFound.with({ operation: "auth.RequestPasswordReset" });
|
|
130
|
-
await idp.requestPasswordReset(input.email);
|
|
131
|
-
return ok202();
|
|
132
|
-
});
|
|
133
|
-
export const ResetPassword = defineResolver({
|
|
134
|
-
operation: "auth.ResetPassword",
|
|
135
|
-
version: 1,
|
|
136
|
-
status: "active",
|
|
137
|
-
summary: "Consume a reset token + set a new password",
|
|
138
|
-
body: z.object({
|
|
139
|
-
resetToken: z.string(),
|
|
140
|
-
newPassword: z.string().min(8),
|
|
141
|
-
}),
|
|
142
|
-
returns: [ok202],
|
|
143
|
-
errors: [],
|
|
144
|
-
}).use(async ({ input, resolve }) => {
|
|
145
|
-
const idp = resolve("idp");
|
|
146
|
-
if (!idp.resetPassword)
|
|
147
|
-
throw NotFound.with({ operation: "auth.ResetPassword" });
|
|
148
|
-
await idp.resetPassword(input.resetToken, input.newPassword);
|
|
149
|
-
return ok202();
|
|
150
|
-
});
|
|
151
|
-
export const VerifyEmail = defineResolver({
|
|
152
|
-
operation: "auth.VerifyEmail",
|
|
153
|
-
version: 1,
|
|
154
|
-
status: "active",
|
|
155
|
-
summary: "Confirm an email-verification token",
|
|
156
|
-
body: z.object({ verificationToken: z.string() }),
|
|
157
|
-
returns: [ok202],
|
|
158
|
-
errors: [],
|
|
159
|
-
}).use(async ({ input, resolve }) => {
|
|
160
|
-
const idp = resolve("idp");
|
|
161
|
-
if (!idp.verifyEmail)
|
|
162
|
-
throw NotFound.with({ operation: "auth.VerifyEmail" });
|
|
163
|
-
await idp.verifyEmail(input.verificationToken);
|
|
164
|
-
return ok202();
|
|
165
|
-
});
|
|
166
|
-
export const Me = defineResolver({
|
|
167
|
-
operation: "auth.Me",
|
|
168
|
-
version: 1,
|
|
169
|
-
status: "active",
|
|
170
|
-
summary: "Return the User identified by the current Authorization token",
|
|
171
|
-
body: z.object({ token: z.string() }),
|
|
172
|
-
returns: [ok200User],
|
|
173
|
-
errors: [],
|
|
174
|
-
}).use(async ({ input, resolve }) => {
|
|
175
|
-
const idp = resolve("idp");
|
|
176
|
-
const user = await idp.verifyToken(input.token);
|
|
177
|
-
if (!user)
|
|
178
|
-
throw NotFound.with({ operation: "auth.Me", reason: "token does not resolve to a user" });
|
|
179
|
-
return ok200User(user);
|
|
180
|
-
});
|
|
181
|
-
//# sourceMappingURL=resolvers.js.map
|
package/dist/resolvers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.js","sourceRoot":"","sources":["../src/resolvers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGlF,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,EAA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E,SAAS,MAAM,EAAE,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,kEAAkE;IAClE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
package/dist/user.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../src/user.ts"],"names":[],"mappings":""}
|