create-authhero 0.47.0 โ 0.47.2
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 +1 -1
- package/dist/aws-sst/README.md +1 -1
- package/dist/cloudflare/README.md +1 -1
- package/dist/cloudflare-control-plane/README.md +1 -1
- package/dist/cloudflare-wfp-tenant/README.md +1 -1
- package/dist/create-authhero.js +41 -39
- package/dist/local/README.md +1 -1
- package/dist/local/src/index.ts +15 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -256,7 +256,7 @@ Use conventional commits for automatic versioning:
|
|
|
256
256
|
|
|
257
257
|
## Documentation
|
|
258
258
|
|
|
259
|
-
For more information, visit [https://authhero.net
|
|
259
|
+
For more information, visit [https://docs.authhero.net](https://docs.authhero.net)
|
|
260
260
|
|
|
261
261
|
## License
|
|
262
262
|
|
package/dist/aws-sst/README.md
CHANGED
|
@@ -158,6 +158,6 @@ npm run decrypt -- "enc:v1:..." # decrypt a stored value using ENCRYPTION_KEY
|
|
|
158
158
|
## Learn More
|
|
159
159
|
|
|
160
160
|
- [SST Documentation](https://sst.dev/docs)
|
|
161
|
-
- [AuthHero Documentation](https://authhero.net
|
|
161
|
+
- [AuthHero Documentation](https://docs.authhero.net)
|
|
162
162
|
- [AWS Lambda](https://docs.aws.amazon.com/lambda/)
|
|
163
163
|
- [DynamoDB](https://docs.aws.amazon.com/dynamodb/)
|
|
@@ -55,5 +55,5 @@ npm run seed # seed the control plane tenant + admin
|
|
|
55
55
|
npm run dev
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
See [Control Plane Defaults](https://authhero.net/
|
|
58
|
+
See [Control Plane Defaults](https://docs.authhero.net/customization/multi-tenancy/control-plane-defaults)
|
|
59
59
|
for the full architecture and request flows.
|
|
@@ -58,5 +58,5 @@ wrangler secret put CONTROL_PLANE_ENCRYPTION_KEY --name tenant-<id>-auth
|
|
|
58
58
|
|
|
59
59
|
After the Worker and its D1 exist, run the control plane's
|
|
60
60
|
`sync-defaults` for this tenant so its inherited rows are populated. See the
|
|
61
|
-
[Control Plane Defaults](https://authhero.net/
|
|
61
|
+
[Control Plane Defaults](https://docs.authhero.net/customization/multi-tenancy/control-plane-defaults)
|
|
62
62
|
docs for the full flow.
|
package/dist/create-authhero.js
CHANGED
|
@@ -33,21 +33,21 @@ var c = new e(), l = {
|
|
|
33
33
|
"@authhero/kysely-adapter": a,
|
|
34
34
|
...i && { "@authhero/admin": a },
|
|
35
35
|
"@authhero/widget": a,
|
|
36
|
-
"@hono/swagger-ui": "^0.
|
|
37
|
-
"@hono/zod-openapi": "^
|
|
36
|
+
"@hono/swagger-ui": "^0.6.0",
|
|
37
|
+
"@hono/zod-openapi": "^1.4.0",
|
|
38
38
|
"@hono/node-server": "latest",
|
|
39
39
|
authhero: a,
|
|
40
40
|
"better-sqlite3": "latest",
|
|
41
|
-
hono: "^4.
|
|
41
|
+
hono: "^4.12.0",
|
|
42
42
|
kysely: "latest",
|
|
43
43
|
...t && { "@authhero/multi-tenancy": a },
|
|
44
44
|
...n && { bcryptjs: "latest" }
|
|
45
45
|
},
|
|
46
46
|
devDependencies: {
|
|
47
47
|
"@types/better-sqlite3": "^7.6.0",
|
|
48
|
-
"@types/node": "^
|
|
48
|
+
"@types/node": "^22.0.0",
|
|
49
49
|
tsx: "^4.0.0",
|
|
50
|
-
typescript: "^5.
|
|
50
|
+
typescript: "^5.9.0"
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
},
|
|
@@ -83,19 +83,19 @@ var c = new e(), l = {
|
|
|
83
83
|
"@authhero/drizzle": a,
|
|
84
84
|
...i && { "@authhero/admin": a },
|
|
85
85
|
"@authhero/widget": a,
|
|
86
|
-
"@hono/swagger-ui": "^0.
|
|
87
|
-
"@hono/zod-openapi": "^
|
|
86
|
+
"@hono/swagger-ui": "^0.6.0",
|
|
87
|
+
"@hono/zod-openapi": "^1.4.0",
|
|
88
88
|
authhero: a,
|
|
89
89
|
"drizzle-orm": "^0.44.0",
|
|
90
|
-
hono: "^4.
|
|
90
|
+
hono: "^4.12.0",
|
|
91
91
|
...t && { "@authhero/multi-tenancy": a },
|
|
92
92
|
...n && { bcryptjs: "latest" }
|
|
93
93
|
},
|
|
94
94
|
devDependencies: {
|
|
95
95
|
"@cloudflare/workers-types": "^4.0.0",
|
|
96
96
|
"drizzle-kit": "^0.31.0",
|
|
97
|
-
typescript: "^5.
|
|
98
|
-
wrangler: "^
|
|
97
|
+
typescript: "^5.9.0",
|
|
98
|
+
wrangler: "^4.0.0"
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
},
|
|
@@ -124,13 +124,13 @@ var c = new e(), l = {
|
|
|
124
124
|
"@authhero/drizzle": i,
|
|
125
125
|
"@authhero/proxy": i,
|
|
126
126
|
"drizzle-orm": "^0.44.0",
|
|
127
|
-
hono: "^4.
|
|
127
|
+
hono: "^4.12.0"
|
|
128
128
|
},
|
|
129
129
|
devDependencies: {
|
|
130
130
|
"@cloudflare/workers-types": "^4.0.0",
|
|
131
131
|
"drizzle-kit": "^0.31.0",
|
|
132
|
-
typescript: "^5.
|
|
133
|
-
wrangler: "^
|
|
132
|
+
typescript: "^5.9.0",
|
|
133
|
+
wrangler: "^4.0.0"
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
136
|
}
|
|
@@ -162,17 +162,17 @@ var c = new e(), l = {
|
|
|
162
162
|
"@authhero/drizzle": i,
|
|
163
163
|
"@authhero/multi-tenancy": i,
|
|
164
164
|
"@authhero/widget": i,
|
|
165
|
-
"@hono/swagger-ui": "^0.
|
|
166
|
-
"@hono/zod-openapi": "^
|
|
165
|
+
"@hono/swagger-ui": "^0.6.0",
|
|
166
|
+
"@hono/zod-openapi": "^1.4.0",
|
|
167
167
|
authhero: i,
|
|
168
168
|
"drizzle-orm": "^0.44.0",
|
|
169
|
-
hono: "^4.
|
|
169
|
+
hono: "^4.12.0"
|
|
170
170
|
},
|
|
171
171
|
devDependencies: {
|
|
172
172
|
"@cloudflare/workers-types": "^4.0.0",
|
|
173
173
|
"drizzle-kit": "^0.31.0",
|
|
174
|
-
typescript: "^5.
|
|
175
|
-
wrangler: "^
|
|
174
|
+
typescript: "^5.9.0",
|
|
175
|
+
wrangler: "^4.0.0"
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
178
|
}
|
|
@@ -207,17 +207,17 @@ var c = new e(), l = {
|
|
|
207
207
|
"@authhero/drizzle": i,
|
|
208
208
|
"@authhero/multi-tenancy": i,
|
|
209
209
|
"@authhero/widget": i,
|
|
210
|
-
"@hono/swagger-ui": "^0.
|
|
211
|
-
"@hono/zod-openapi": "^
|
|
210
|
+
"@hono/swagger-ui": "^0.6.0",
|
|
211
|
+
"@hono/zod-openapi": "^1.4.0",
|
|
212
212
|
authhero: i,
|
|
213
213
|
"drizzle-orm": "^0.44.0",
|
|
214
|
-
hono: "^4.
|
|
214
|
+
hono: "^4.12.0"
|
|
215
215
|
},
|
|
216
216
|
devDependencies: {
|
|
217
217
|
"@cloudflare/workers-types": "^4.0.0",
|
|
218
218
|
"drizzle-kit": "^0.31.0",
|
|
219
|
-
typescript: "^5.
|
|
220
|
-
wrangler: "^
|
|
219
|
+
typescript: "^5.9.0",
|
|
220
|
+
wrangler: "^4.0.0"
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
}
|
|
@@ -237,13 +237,13 @@ var c = new e(), l = {
|
|
|
237
237
|
},
|
|
238
238
|
dependencies: {
|
|
239
239
|
"@authhero/proxy": r ? "workspace:*" : "latest",
|
|
240
|
-
hono: "^4.
|
|
240
|
+
hono: "^4.12.0"
|
|
241
241
|
},
|
|
242
242
|
devDependencies: {
|
|
243
243
|
"@cloudflare/workers-types": "^4.0.0",
|
|
244
|
-
"@types/node": "^
|
|
245
|
-
typescript: "^5.
|
|
246
|
-
wrangler: "^
|
|
244
|
+
"@types/node": "^22.0.0",
|
|
245
|
+
typescript: "^5.9.0",
|
|
246
|
+
wrangler: "^4.0.0"
|
|
247
247
|
}
|
|
248
248
|
})
|
|
249
249
|
},
|
|
@@ -272,19 +272,19 @@ var c = new e(), l = {
|
|
|
272
272
|
"@authhero/widget": a,
|
|
273
273
|
"@aws-sdk/client-dynamodb": "^3.0.0",
|
|
274
274
|
"@aws-sdk/lib-dynamodb": "^3.0.0",
|
|
275
|
-
"@hono/swagger-ui": "^0.
|
|
276
|
-
"@hono/zod-openapi": "^
|
|
275
|
+
"@hono/swagger-ui": "^0.6.0",
|
|
276
|
+
"@hono/zod-openapi": "^1.4.0",
|
|
277
277
|
authhero: a,
|
|
278
|
-
hono: "^4.
|
|
278
|
+
hono: "^4.12.0",
|
|
279
279
|
...t && { "@authhero/multi-tenancy": a },
|
|
280
280
|
...n && { bcryptjs: "latest" }
|
|
281
281
|
},
|
|
282
282
|
devDependencies: {
|
|
283
283
|
"@types/aws-lambda": "^8.10.0",
|
|
284
|
-
"@types/node": "^
|
|
284
|
+
"@types/node": "^22.0.0",
|
|
285
285
|
sst: "^3.0.0",
|
|
286
286
|
tsx: "^4.0.0",
|
|
287
|
-
typescript: "^5.
|
|
287
|
+
typescript: "^5.9.0"
|
|
288
288
|
}
|
|
289
289
|
};
|
|
290
290
|
},
|
|
@@ -303,12 +303,14 @@ function d(e, t = !1, n = "authhero-local", r) {
|
|
|
303
303
|
"https://local.authhero.net/auth-callback",
|
|
304
304
|
"http://localhost:5173/auth-callback",
|
|
305
305
|
"http://localhost:3000/auth-callback",
|
|
306
|
-
|
|
306
|
+
"https://localhost:3000/auth-callback",
|
|
307
|
+
...r ? ["http://localhost:3000/admin/auth-callback", "https://localhost:3000/admin/auth-callback"] : []
|
|
307
308
|
], s = t ? [`https://localhost.emobix.co.uk:8443/test/a/${n}/callback`, `https://localhost:8443/test/a/${n}/callback`] : [], c = [...o, ...s], l = [
|
|
308
309
|
"https://manage.authhero.net",
|
|
309
310
|
"https://local.authhero.net",
|
|
310
311
|
"http://localhost:5173",
|
|
311
|
-
"http://localhost:3000"
|
|
312
|
+
"http://localhost:3000",
|
|
313
|
+
"https://localhost:3000"
|
|
312
314
|
], u = t ? ["https://localhost:8443/", "https://localhost.emobix.co.uk:8443/"] : [], d = [...l, ...u], f = t ? `
|
|
313
315
|
// Create OpenID Conformance Suite test clients and user
|
|
314
316
|
console.log("Creating conformance test clients and user...");
|
|
@@ -556,7 +558,7 @@ function f(e, t) {
|
|
|
556
558
|
// Add admin UI handler if the package is installed
|
|
557
559
|
if (fs.existsSync(adminIndexPath)) {
|
|
558
560
|
const issuer =
|
|
559
|
-
process.env.ISSUER || \`
|
|
561
|
+
process.env.ISSUER || \`https://localhost:\${process.env.PORT || 3000}/\`;
|
|
560
562
|
const rawHtml = fs.readFileSync(adminIndexPath, "utf-8")
|
|
561
563
|
.replace(/src="\\.\\//g, 'src="/admin/')
|
|
562
564
|
.replace(/href="\\.\\//g, 'href="/admin/');
|
|
@@ -941,8 +943,8 @@ function E() {
|
|
|
941
943
|
function D() {
|
|
942
944
|
console.log("\n" + "โ".repeat(50)), console.log("๐ฐ๏ธ AuthHero proxy running at http://localhost:8787"), console.log("โ๏ธ Edit src/proxy.config.ts to add hosts and routes"), console.log("๐ See README.md for deployment instructions"), console.log("โ".repeat(50) + "\n");
|
|
943
945
|
}
|
|
944
|
-
function O() {
|
|
945
|
-
console.log("\n" + "โ".repeat(50)), console.log("
|
|
946
|
+
function O(e) {
|
|
947
|
+
console.log("\n" + "โ".repeat(50)), console.log("๐ AuthHero server running at https://localhost:3000"), console.log("โ ๏ธ Uses a self-signed certificate โ you may need to trust it"), console.log("๐ API documentation available at https://localhost:3000/docs"), console.log("๐ Open https://localhost:3000/setup to complete initial setup"), console.log(e ? "๐ ๏ธ Admin UI available at https://localhost:3000/admin" : "๐ Portal available at https://local.authhero.net"), console.log("โ".repeat(50) + "\n");
|
|
946
948
|
}
|
|
947
949
|
c.version("1.0.0").description("Create a new AuthHero project").argument("[project-name]", "name of the project").option("-t, --template <type>", "template type: local, cloudflare, aws-sst, or proxy").option("--package-manager <pm>", "package manager to use: npm, yarn, pnpm, or bun").option("--multi-tenant", "enable multi-tenant mode").option("--admin-ui", "include admin UI at /admin").option("--skip-install", "skip installing dependencies").option("--skip-migrate", "skip running database migrations").option("--skip-start", "skip starting the development server").option("--github-ci", "include GitHub CI workflows with semantic versioning").option("--conformance", "add OpenID conformance suite test clients").option("--conformance-alias <alias>", "alias for conformance suite (default: authhero-local)").option("--workspace", "use workspace:* dependencies for local monorepo development").option("-y, --yes", "skip all prompts and use defaults/provided options").action(async (e, i) => {
|
|
948
950
|
let o = i.yes === !0;
|
|
@@ -1128,11 +1130,11 @@ ENCRYPTION_KEY=${s()}
|
|
|
1128
1130
|
name: "shouldStart",
|
|
1129
1131
|
message: "Would you like to start the development server?",
|
|
1130
1132
|
default: !0
|
|
1131
|
-
}])).shouldStart, n && (m === "cloudflare" ? C() : m === "cloudflare-wfp-dispatcher" ? w() : m === "cloudflare-wfp-tenant" ? T() : m === "cloudflare-control-plane" ? E() : m === "aws-sst" ? v() : m === "proxy" ? D() : O(), console.log("๐ Starting development server...\n"), await x(`${e} run dev`, p)), o && !n && (console.log("\nโ
Setup complete!"), console.log("\nTo start the development server:"), console.log(` cd ${c}`), console.log(" npm run dev"), m === "cloudflare" ? C() : m === "cloudflare-wfp-dispatcher" ? w() : m === "cloudflare-wfp-tenant" ? T() : m === "cloudflare-control-plane" ? E() : m === "aws-sst" ? v() : m === "proxy" ? D() : O());
|
|
1133
|
+
}])).shouldStart, n && (m === "cloudflare" ? C() : m === "cloudflare-wfp-dispatcher" ? w() : m === "cloudflare-wfp-tenant" ? T() : m === "cloudflare-control-plane" ? E() : m === "aws-sst" ? v() : m === "proxy" ? D() : O(g), console.log("๐ Starting development server...\n"), await x(`${e} run dev`, p)), o && !n && (console.log("\nโ
Setup complete!"), console.log("\nTo start the development server:"), console.log(` cd ${c}`), console.log(" npm run dev"), m === "cloudflare" ? C() : m === "cloudflare-wfp-dispatcher" ? w() : m === "cloudflare-wfp-tenant" ? T() : m === "cloudflare-control-plane" ? E() : m === "aws-sst" ? v() : m === "proxy" ? D() : O(g));
|
|
1132
1134
|
} catch (e) {
|
|
1133
1135
|
console.error("\nโ An error occurred:", e), process.exit(1);
|
|
1134
1136
|
}
|
|
1135
1137
|
}
|
|
1136
|
-
H || (console.log("Next steps:"), console.log(` cd ${c}`), m === "local" ? (console.log(" npm install"), console.log(" npm run migrate"), console.log(" npm run dev"), console.log("\nOpen
|
|
1138
|
+
H || (console.log("Next steps:"), console.log(` cd ${c}`), m === "local" ? (console.log(" npm install"), console.log(" npm run migrate"), console.log(" npm run dev"), console.log("\nOpen https://localhost:3000/setup to complete initial setup")) : m === "cloudflare" ? (console.log(" npm install"), console.log(" npm run migrate # or npm run db:migrate:remote for production"), console.log(" npm run dev # or npm run dev:remote for production"), console.log("\nOpen https://localhost:3000/setup to complete initial setup")) : m === "cloudflare-wfp-dispatcher" ? (console.log(" npm install"), console.log(" npm run setup # creates wrangler.local.toml โ paste your database_id"), console.log(" npx wrangler dispatch-namespace create authhero-tenants"), console.log(" npm run dev # or npm run dev:remote for production"), console.log("\nDeploy tenant workers separately (`cloudflare` template):"), console.log(" wrangler deploy --dispatch-namespace=authhero-tenants --name=tenant-<id>-auth")) : m === "cloudflare-control-plane" ? (console.log(" npm install"), console.log(" npm run setup # creates wrangler.local.toml + .dev.vars"), console.log(" # set CONTROL_PLANE_ENCRYPTION_KEY in .dev.vars (share it with every tenant worker)"), console.log(" npm run migrate"), console.log(" npm run seed"), console.log(" npm run dev # or npm run dev:remote for production"), console.log("\nWire buildTenantAdapters() in src/index.ts, then project defaults:"), console.log(" POST /internal/tenants/:id/sync-defaults")) : m === "cloudflare-wfp-tenant" ? (console.log(" npm install"), console.log(" npm run setup # creates wrangler.local.toml + .dev.vars"), console.log(" # set CONTROL_PLANE_ENCRYPTION_KEY in .dev.vars (must match the control plane)"), console.log(" npm run migrate"), console.log(" npm run dev # or npm run dev:remote for production"), console.log("\nDeploy into the dispatch namespace:"), console.log(" wrangler deploy --dispatch-namespace=authhero-tenants --name=tenant-<id>-auth")) : m === "aws-sst" ? (console.log(" npm install"), console.log(" npm run dev # Deploys to AWS in development mode"), console.log("\nOpen your server URL /setup to complete initial setup")) : m === "proxy" && (console.log(" npm install"), console.log(" npm run dev"), console.log("\nEdit src/proxy.config.ts to add hosts and routes")), console.log(`\nServer will be available at: ${m === "proxy" ? "http" : "https"}://localhost:${m === "proxy" ? 8787 : m === "cloudflare-wfp-dispatcher" ? 3001 : m === "cloudflare-wfp-tenant" ? 3002 : 3e3}`), k && (console.log("\n๐งช OpenID Conformance Suite Testing:"), console.log(" 1. Clone and start the conformance suite (if not already running):"), console.log(" git clone https://gitlab.com/openid/conformance-suite.git"), console.log(" cd conformance-suite && mvn clean package"), console.log(" docker-compose up -d"), console.log(" 2. Open https://localhost.emobix.co.uk:8443"), console.log(" 3. Create a test plan and use conformance-config.json for settings"), console.log(` 4. Use alias: ${A}`)), console.log("\nFor more information, visit: https://docs.authhero.net\n"));
|
|
1137
1139
|
}), c.parse(process.argv);
|
|
1138
1140
|
//#endregion
|
package/dist/local/README.md
CHANGED
|
@@ -69,4 +69,4 @@ npm run gen:key # print a fresh base64 key
|
|
|
69
69
|
npm run decrypt -- "enc:v1:..." # decrypt a stored value using ENCRYPTION_KEY from .env
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
For more information, visit [https://authhero.net
|
|
72
|
+
For more information, visit [https://docs.authhero.net](https://docs.authhero.net).
|
package/dist/local/src/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ import fs from "fs";
|
|
|
9
9
|
import path from "path";
|
|
10
10
|
import { execFileSync } from "child_process";
|
|
11
11
|
import https from "https";
|
|
12
|
+
import { fileURLToPath } from "url";
|
|
12
13
|
|
|
13
14
|
// Generate self-signed certificates for local HTTPS if they don't exist
|
|
14
15
|
const certDir = path.join(process.cwd(), ".certs");
|
|
@@ -130,9 +131,22 @@ const issuer = process.env.ISSUER || `https://localhost:${port}/`;
|
|
|
130
131
|
// Get or generate certificates
|
|
131
132
|
const { key, cert } = ensureCertificates();
|
|
132
133
|
|
|
134
|
+
// Point at the locally installed admin UI when the @authhero/admin package is
|
|
135
|
+
// present (same check as app.ts); fall back to the hosted portal otherwise.
|
|
136
|
+
const hasLocalAdminUi = fs.existsSync(
|
|
137
|
+
path.resolve(
|
|
138
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
139
|
+
"../node_modules/@authhero/admin/dist/index.html",
|
|
140
|
+
),
|
|
141
|
+
);
|
|
142
|
+
|
|
133
143
|
console.log(`๐ AuthHero server running at https://localhost:${port}`);
|
|
134
144
|
console.log(`๐ API documentation available at https://localhost:${port}/docs`);
|
|
135
|
-
|
|
145
|
+
if (hasLocalAdminUi) {
|
|
146
|
+
console.log(`๐ ๏ธ Admin UI available at https://localhost:${port}/admin`);
|
|
147
|
+
} else {
|
|
148
|
+
console.log(`๐ Portal available at https://local.authhero.net`);
|
|
149
|
+
}
|
|
136
150
|
|
|
137
151
|
serve({
|
|
138
152
|
fetch: (request) => {
|