@betterportal/config-manager 10.6.35 → 10.7.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/lib/.bsb/clients/service-betterportal-config-manager.d.ts +1 -1
- package/lib/.bsb/clients/service-betterportal-config-manager.js +1 -1
- package/lib/bp-contracts/org.betterportal.config-manager.json +9 -57
- package/lib/plugins/service-betterportal-config-manager/.bp-generated/registry.d.ts +0 -32
- package/lib/plugins/service-betterportal-config-manager/.bp-generated/registry.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/accessControl.d.ts +5 -0
- package/lib/plugins/service-betterportal-config-manager/accessControl.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/accessControl.js +203 -0
- package/lib/plugins/service-betterportal-config-manager/accessControl.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapAccess.d.ts +8 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapAccess.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapAccess.js +28 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapAccess.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapEndpoint.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bootstrapEndpoint.js +14 -3
- package/lib/plugins/service-betterportal-config-manager/bootstrapEndpoint.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bootstrapWizardHtml.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bootstrapWizardHtml.js +9 -7
- package/lib/plugins/service-betterportal-config-manager/bootstrapWizardHtml.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview-environments/_renderer.bootstrap5/GET.d.ts +2 -2
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview-environments/_renderer.bootstrap5/GET.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview-environments/_renderer.bootstrap5/GET.js +8 -2
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview-environments/_renderer.bootstrap5/GET.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview-environments/_renderer.bootstrap5/config.GET.d.ts +2 -2
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview-environments/_renderer.bootstrap5/config.GET.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview-environments/_renderer.bootstrap5/config.GET.js +5 -2
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview-environments/_renderer.bootstrap5/config.GET.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/_renderer.bootstrap5/GET.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/_renderer.bootstrap5/GET.js +11 -2
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/_renderer.bootstrap5/GET.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/_renderer.bootstrap5/GET.d.ts +2 -2
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/_renderer.bootstrap5/GET.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/_renderer.bootstrap5/GET.js +8 -3
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/_renderer.bootstrap5/GET.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/index.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/index.js +2 -0
- package/lib/plugins/service-betterportal-config-manager/index.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/previewEnvironmentManagement.d.ts +0 -5
- package/lib/plugins/service-betterportal-config-manager/previewEnvironmentManagement.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/previewEnvironmentManagement.js +8 -16
- package/lib/plugins/service-betterportal-config-manager/previewEnvironmentManagement.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/previewEnvironments.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/previewEnvironments.js +52 -24
- package/lib/plugins/service-betterportal-config-manager/previewEnvironments.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/routeMounts.d.ts +2 -0
- package/lib/plugins/service-betterportal-config-manager/routeMounts.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/routeMounts.js +9 -0
- package/lib/plugins/service-betterportal-config-manager/routeMounts.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/tenantManagement.d.ts +0 -5
- package/lib/plugins/service-betterportal-config-manager/tenantManagement.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/tenantManagement.js +6 -13
- package/lib/plugins/service-betterportal-config-manager/tenantManagement.js.map +1 -1
- package/lib/schemas/service-betterportal-config-manager.json +1 -1
- package/lib/schemas/service-betterportal-config-manager.plugin.json +1 -1
- package/package.json +8 -6
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { createStaticJwksVerifier, eventHeaders, jsonResponse, resolveEmbeddedRequestContext } from "@betterportal/framework";
|
|
2
|
+
import { verifyBootstrapAdminToken } from "./bootstrapAccess.js";
|
|
3
|
+
const ADMIN = "/.well-known/bp/admin";
|
|
4
|
+
const MANAGE = "/.well-known/bp/manage";
|
|
5
|
+
const CONFIG_MANAGER_ID = "org.betterportal.config-manager";
|
|
6
|
+
function bearer(event) {
|
|
7
|
+
return /^Bearer\s+(\S+)$/i.exec(event.req.headers.get("authorization") ?? "")?.[1];
|
|
8
|
+
}
|
|
9
|
+
function inTree(path, root) {
|
|
10
|
+
return path === root || path.startsWith(`${root}/`);
|
|
11
|
+
}
|
|
12
|
+
function ownsServiceAuthorization(path, method) {
|
|
13
|
+
return (method === "PUT" && path === `${ADMIN}/services/self-mutation`)
|
|
14
|
+
|| (method === "PUT" && /^\/\.well-known\/bp\/admin\/apps\/[^/]+\/auth\/roles\/sync$/.test(path));
|
|
15
|
+
}
|
|
16
|
+
function bootstrapRoute(path, method, appId) {
|
|
17
|
+
return method === "POST" && (path === `${ADMIN}/services/begin-install`
|
|
18
|
+
|| path === `${ADMIN}/apps/${encodeURIComponent(appId)}/auth/roles`);
|
|
19
|
+
}
|
|
20
|
+
async function allowedBootstrapRequest(config, app, path, event) {
|
|
21
|
+
const body = await event.req.clone().json().catch(() => null);
|
|
22
|
+
if (!body || typeof body !== "object" || Array.isArray(body))
|
|
23
|
+
return false;
|
|
24
|
+
if (path !== `${ADMIN}/services/begin-install`)
|
|
25
|
+
return body.id === "admin";
|
|
26
|
+
if (body.tenantId !== app.tenantId || body.appId !== app.id || body.reconfigure === true || body.instanceId !== undefined)
|
|
27
|
+
return false;
|
|
28
|
+
const sharedServiceId = body.sharedServiceId;
|
|
29
|
+
if (sharedServiceId !== "org.betterportal.auth.default" && sharedServiceId !== "org.betterportal.theme.bootstrap1")
|
|
30
|
+
return false;
|
|
31
|
+
const service = config.sharedServiceCatalog.find(candidate => candidate.id === sharedServiceId);
|
|
32
|
+
const activation = config.sharedServiceActivations.find(candidate => candidate.tenantId === app.tenantId
|
|
33
|
+
&& candidate.sharedServiceId === sharedServiceId && candidate.enabled);
|
|
34
|
+
return !!service && !!activation && service.enabled && !service.apiKeyHash
|
|
35
|
+
&& typeof body.serviceUrl === "string"
|
|
36
|
+
&& body.serviceUrl.replace(/\/+$/, "") === service.baseUrl.replace(/\/+$/, "");
|
|
37
|
+
}
|
|
38
|
+
function currentApp(config, event) {
|
|
39
|
+
const url = new URL(event.req.url, "http://betterportal.invalid");
|
|
40
|
+
const appId = url.searchParams.get("appId") ?? event.req.headers.get("x-bp-app-id");
|
|
41
|
+
const app = appId
|
|
42
|
+
? config.apps.find(candidate => candidate.id === appId)
|
|
43
|
+
: resolveEmbeddedRequestContext(config, eventHeaders(event))?.app;
|
|
44
|
+
return app && config.tenants.some(tenant => tenant.id === app.tenantId && tenant.active) ? app : undefined;
|
|
45
|
+
}
|
|
46
|
+
function permissionForManage(path, method) {
|
|
47
|
+
if (path === `${MANAGE}/current`)
|
|
48
|
+
return undefined;
|
|
49
|
+
const suffix = path.slice(MANAGE.length + 1);
|
|
50
|
+
const resource = suffix.split("/", 1)[0];
|
|
51
|
+
const viewId = resource === "services" || resource === "webhooks" ? "services.index"
|
|
52
|
+
: resource === "routes" ? "routes.index"
|
|
53
|
+
: resource === "fragments" ? "fragments.index"
|
|
54
|
+
: resource === "theme" ? "config.index"
|
|
55
|
+
: undefined;
|
|
56
|
+
if (!viewId)
|
|
57
|
+
return undefined;
|
|
58
|
+
if (!["GET", "POST", "PUT", "PATCH", "DELETE"].includes(method))
|
|
59
|
+
return undefined;
|
|
60
|
+
const action = method === "GET" ? "read" : method === "DELETE" ? "delete"
|
|
61
|
+
: method === "PUT" || method === "PATCH" || (method === "POST" && (resource === "theme" || suffix === "services/activate"))
|
|
62
|
+
? "update" : "create";
|
|
63
|
+
return { viewId, action };
|
|
64
|
+
}
|
|
65
|
+
async function permissionForAdmin(path, method, event, config) {
|
|
66
|
+
const suffix = path.slice(ADMIN.length + 1);
|
|
67
|
+
const action = method === "GET" ? "read" : method === "POST" ? "create"
|
|
68
|
+
: method === "PUT" || method === "PATCH" ? "update" : method === "DELETE" ? "delete" : undefined;
|
|
69
|
+
if (!action)
|
|
70
|
+
return undefined;
|
|
71
|
+
const menuReads = ["menu-editor", "menu-editor/item", "menu-editor/views", "menu-editor/default-target"];
|
|
72
|
+
if (method === "GET" && menuReads.includes(suffix))
|
|
73
|
+
return { viewId: "menu.index", action: "read" };
|
|
74
|
+
const menuAction = /^menu-editor\/(save-visibility|save-title|save-link|save-external|add|remove|toggle|toggle-expanded|move-up|move-down|move-in|move-after|move-out)$/.exec(suffix)?.[1];
|
|
75
|
+
if (method === "POST" && menuAction)
|
|
76
|
+
return { viewId: "menu.index", action: menuAction === "add" ? "create" : menuAction === "remove" ? "delete" : "update" };
|
|
77
|
+
if (method === "GET" && suffix === "fragments-editor")
|
|
78
|
+
return { viewId: "fragments.index", action: "read" };
|
|
79
|
+
const fragmentAction = /^fragments-editor\/(set-mode|set-override|add|remove|move-up|move-down)$/.exec(suffix)?.[1];
|
|
80
|
+
if (method === "POST" && fragmentAction)
|
|
81
|
+
return { viewId: "fragments.index", action: fragmentAction === "add" ? "create" : fragmentAction === "remove" ? "delete" : "update" };
|
|
82
|
+
const appResource = /^apps\/[^/]+\/(routes(?:\/[^/]+)?|menu|auth\/roles(?:\/[^/]+)?|m2m\/connections(?:\/[^/]+)?|theme-config\/bootstrap1)$/.exec(suffix)?.[1];
|
|
83
|
+
if (appResource)
|
|
84
|
+
return { viewId: appResource.startsWith("routes") ? "routes.index"
|
|
85
|
+
: appResource === "menu" ? "menu.index"
|
|
86
|
+
: appResource.startsWith("auth/") ? "auth.index"
|
|
87
|
+
: appResource.startsWith("m2m/") ? "services.index" : "config.index",
|
|
88
|
+
action: appResource === "theme-config/bootstrap1" ? "update" : action };
|
|
89
|
+
if (suffix === "platform-services" || /^shared-services(?:\/[^/]+(?:\/activations(?:\/purge)?)?)?$/.test(suffix)
|
|
90
|
+
|| /^tenants\/[^/]+\/(?:services(?:\/[^/]+(?:\/(?:purge|migrate-to-shared(?:\/preview)?))?)?|activate\/[^/]+)$/.test(suffix)) {
|
|
91
|
+
return { viewId: "services.index", action: suffix.endsWith("/purge") ? "delete" : suffix.endsWith("/migrate-to-shared") ? "update" : action };
|
|
92
|
+
}
|
|
93
|
+
if (suffix === "services/begin-install" && method === "POST") {
|
|
94
|
+
const body = await event.req.clone().json().catch(() => null);
|
|
95
|
+
const existingInstance = typeof body?.instanceId === "string" && (config.platformServices.some(service => service.id === body.instanceId)
|
|
96
|
+
|| config.tenants.some(tenant => tenant.services.some(service => service.id === body.instanceId)));
|
|
97
|
+
const registeredShared = typeof body?.sharedServiceId === "string" && config.sharedServiceCatalog.some(service => service.id === body.sharedServiceId && !!service.apiKeyHash);
|
|
98
|
+
return { viewId: "services.index", action: body?.reconfigure === true || existingInstance || registeredShared ? "update" : "create" };
|
|
99
|
+
}
|
|
100
|
+
if (suffix === "services/begin-hostname-change" && method === "POST")
|
|
101
|
+
return { viewId: "services.index", action: "update" };
|
|
102
|
+
if ((suffix === "wizard/step1" || suffix === "configure") && method === "GET"
|
|
103
|
+
|| suffix === "wizard/verify" && method === "POST")
|
|
104
|
+
return { viewId: "services.index", action: "read" };
|
|
105
|
+
if (suffix === "wizard/register" && method === "POST")
|
|
106
|
+
return { viewId: "services.index", action: "create" };
|
|
107
|
+
if (suffix === "wizard/cleanup-provisional-service" && method === "POST")
|
|
108
|
+
return { viewId: "services.index", action: "delete" };
|
|
109
|
+
if (suffix === "config-ticket" && method === "POST") {
|
|
110
|
+
const body = await event.req.clone().json().catch(() => null);
|
|
111
|
+
return { viewId: "services.index", action: Array.isArray(body?.actions) && body.actions.includes("config.write") ? "update" : "read" };
|
|
112
|
+
}
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
function hasPermission(config, app, roleIds, viewId, action) {
|
|
116
|
+
const ids = new Set([CONFIG_MANAGER_ID]);
|
|
117
|
+
const tenant = config.tenants.find(candidate => candidate.id === app.tenantId);
|
|
118
|
+
for (const service of tenant?.services ?? []) {
|
|
119
|
+
if (service.serviceId === CONFIG_MANAGER_ID)
|
|
120
|
+
ids.add(service.id);
|
|
121
|
+
}
|
|
122
|
+
for (const activation of config.sharedServiceActivations) {
|
|
123
|
+
if (activation.tenantId !== app.tenantId || !activation.enabled)
|
|
124
|
+
continue;
|
|
125
|
+
const shared = config.sharedServiceCatalog.find(service => service.id === activation.sharedServiceId);
|
|
126
|
+
if (shared?.serviceId === CONFIG_MANAGER_ID)
|
|
127
|
+
ids.add(activation.id);
|
|
128
|
+
}
|
|
129
|
+
return (app.auth?.roles ?? []).some(role => roleIds.includes(role.id)
|
|
130
|
+
&& role.permissions.some(grant => ids.has(grant.serviceId) && grant.viewId === viewId && grant.permissions.includes(action)));
|
|
131
|
+
}
|
|
132
|
+
/** Raw H3 routes do not pass through the framework's registered-route authorization. */
|
|
133
|
+
export function registerRawManagementAccessControl(app, store, cpState) {
|
|
134
|
+
app.use("/.well-known/bp/**", async (event) => {
|
|
135
|
+
const path = event.url.pathname;
|
|
136
|
+
const method = event.req.method;
|
|
137
|
+
const admin = inTree(path, ADMIN);
|
|
138
|
+
const manage = inTree(path, MANAGE);
|
|
139
|
+
if (!admin && !manage)
|
|
140
|
+
return;
|
|
141
|
+
if (method === "OPTIONS")
|
|
142
|
+
return;
|
|
143
|
+
if (admin && ownsServiceAuthorization(path, method))
|
|
144
|
+
return;
|
|
145
|
+
event.res.headers.set("Cache-Control", "no-store");
|
|
146
|
+
const token = bearer(event);
|
|
147
|
+
if (!token)
|
|
148
|
+
return jsonResponse({ error: "Management authorization required" }, 401);
|
|
149
|
+
const config = await store.loadConfig();
|
|
150
|
+
const target = admin
|
|
151
|
+
? config.apps.find(candidate => candidate.id === config.configManagement.managementAppId
|
|
152
|
+
&& candidate.tenantId === config.configManagement.adminTenantId)
|
|
153
|
+
: currentApp(config, event);
|
|
154
|
+
if (!target)
|
|
155
|
+
return jsonResponse({ error: "Management app unavailable" }, 503);
|
|
156
|
+
if (admin && bootstrapRoute(path, method, target.id)) {
|
|
157
|
+
try {
|
|
158
|
+
const scope = await verifyBootstrapAdminToken(cpState, token);
|
|
159
|
+
if (scope.tenantId === target.tenantId && scope.appId === target.id) {
|
|
160
|
+
return await allowedBootstrapRequest(config, target, path, event)
|
|
161
|
+
? undefined : jsonResponse({ error: "Bootstrap operation is outside its setup scope" }, 403);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch { /* A normal management user token may still authorize this request. */ }
|
|
165
|
+
}
|
|
166
|
+
const auth = target.auth;
|
|
167
|
+
if (!auth?.publicKeys?.keys.length)
|
|
168
|
+
return jsonResponse({ error: "Management authentication unavailable" }, 503);
|
|
169
|
+
let claims;
|
|
170
|
+
try {
|
|
171
|
+
claims = await createStaticJwksVerifier({
|
|
172
|
+
jwks: auth.publicKeys,
|
|
173
|
+
expectedIssuer: auth.expectedIssuer,
|
|
174
|
+
expectedAudience: auth.expectedAudience,
|
|
175
|
+
expectedTokenType: "access"
|
|
176
|
+
}).verify(token, { tenantId: target.tenantId, appId: target.id });
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
return jsonResponse({ error: "Invalid management token" }, 401);
|
|
180
|
+
}
|
|
181
|
+
if (claims.tenantId !== target.tenantId || claims.appId !== target.id || claims.tokenType !== "access") {
|
|
182
|
+
return jsonResponse({ error: "Management token scope mismatch" }, 401);
|
|
183
|
+
}
|
|
184
|
+
const root = target.id === config.configManagement.managementAppId
|
|
185
|
+
&& target.tenantId === config.configManagement.adminTenantId && claims.roles.includes("*");
|
|
186
|
+
if (admin) {
|
|
187
|
+
if (root)
|
|
188
|
+
return;
|
|
189
|
+
const policy = await permissionForAdmin(path, method, event, config);
|
|
190
|
+
return policy && hasPermission(config, target, claims.roles, policy.viewId, policy.action)
|
|
191
|
+
? undefined : jsonResponse({ error: "Platform management permission required" }, 403);
|
|
192
|
+
}
|
|
193
|
+
if (root)
|
|
194
|
+
return;
|
|
195
|
+
if (path === `${MANAGE}/current`)
|
|
196
|
+
return;
|
|
197
|
+
const policy = permissionForManage(path, method);
|
|
198
|
+
if (!policy || !hasPermission(config, target, claims.roles, policy.viewId, policy.action)) {
|
|
199
|
+
return jsonResponse({ error: "Management permission required" }, 403);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=accessControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessControl.js","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/accessControl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,YAAY,EACZ,YAAY,EACZ,6BAA6B,EAM9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,KAAK,GAAG,uBAAuB,CAAC;AACtC,MAAM,MAAM,GAAG,wBAAwB,CAAC;AACxC,MAAM,iBAAiB,GAAG,iCAAi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AAM,GAAG,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1F,OAAO,YAAY,CAAC,EAAE,KAAK,EAAE,gCAAgC,EAAE,EAAE,GAAG,CAAC,CAAC;QACxE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CpBootstrapState } from "./cpBootstrap.js";
|
|
2
|
+
/** A short-lived capability for the two admin calls needed before first login. */
|
|
3
|
+
export declare function issueBootstrapAdminToken(state: CpBootstrapState, tenantId: string, appId: string): Promise<string>;
|
|
4
|
+
export declare function verifyBootstrapAdminToken(state: CpBootstrapState, token: string): Promise<{
|
|
5
|
+
tenantId: string;
|
|
6
|
+
appId: string;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=bootstrapAccess.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrapAccess.d.ts","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/bootstrapAccess.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKzD,kFAAkF;AAClF,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQxH;AAED,wBAAsB,yBAAyB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAYpI"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createPrivateKey, createPublicKey } from "node:crypto";
|
|
2
|
+
import { SignJWT, jwtVerify } from "jose";
|
|
3
|
+
const AUDIENCE = "betterportal-bootstrap-admin";
|
|
4
|
+
const TYPE = "bp-bootstrap-admin+jwt";
|
|
5
|
+
/** A short-lived capability for the two admin calls needed before first login. */
|
|
6
|
+
export async function issueBootstrapAdminToken(state, tenantId, appId) {
|
|
7
|
+
return new SignJWT({ purpose: "bootstrap-admin", tenantId, appId })
|
|
8
|
+
.setProtectedHeader({ alg: "RS256", typ: TYPE, kid: state.keyPair.kid })
|
|
9
|
+
.setIssuer(state.issuer)
|
|
10
|
+
.setAudience(AUDIENCE)
|
|
11
|
+
.setIssuedAt()
|
|
12
|
+
.setExpirationTime("15m")
|
|
13
|
+
.sign(createPrivateKey(state.keyPair.privateKeyPem));
|
|
14
|
+
}
|
|
15
|
+
export async function verifyBootstrapAdminToken(state, token) {
|
|
16
|
+
const { payload, protectedHeader } = await jwtVerify(token, createPublicKey(state.keyPair.publicKeyPem), {
|
|
17
|
+
issuer: state.issuer,
|
|
18
|
+
audience: AUDIENCE,
|
|
19
|
+
algorithms: ["RS256"],
|
|
20
|
+
typ: TYPE
|
|
21
|
+
});
|
|
22
|
+
if (protectedHeader.kid !== state.keyPair.kid || payload.purpose !== "bootstrap-admin"
|
|
23
|
+
|| typeof payload.tenantId !== "string" || typeof payload.appId !== "string") {
|
|
24
|
+
throw new Error("Invalid bootstrap authorization scope");
|
|
25
|
+
}
|
|
26
|
+
return { tenantId: payload.tenantId, appId: payload.appId };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=bootstrapAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrapAccess.js","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/bootstrapAccess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,OA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,CAAC;IAC3D,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrapEndpoint.d.ts","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/bootstrapEndpoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACjG,OAAO,EAAmC,KAAK,sBAAsB,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACjI,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrapEndpoint.d.ts","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/bootstrapEndpoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACjG,OAAO,EAAmC,KAAK,sBAAsB,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACjI,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;GAIG;AACH;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,GAAG,sBAAsB,EAAE,CAwBrH;AAsCD;;;;;;;;;GASG;AACH,wBAAsB,yBAAyB,CAAC,KAAK,EAAE;IACrD,GAAG,EAAE,iBAAiB,CAAC;IACvB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkShB"}
|
|
@@ -2,6 +2,7 @@ import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
|
|
|
2
2
|
import { jsonResponse } from "@betterportal/framework/lib/runtime/h3.js";
|
|
3
3
|
import { uuidv7 } from "@betterportal/framework";
|
|
4
4
|
import { renderBootstrapWizardHtml } from "./bootstrapWizardHtml.js";
|
|
5
|
+
import { issueBootstrapAdminToken } from "./bootstrapAccess.js";
|
|
5
6
|
import { apiRoutePath } from "./routeMounts.js";
|
|
6
7
|
/**
|
|
7
8
|
* Default admin app route mounts - points each menu entry at a config-manager view.
|
|
@@ -129,6 +130,16 @@ export async function registerBootstrapEndpoint(input) {
|
|
|
129
130
|
}
|
|
130
131
|
const freshConfig = await input.storage.loadConfig();
|
|
131
132
|
const owner = uuidv7();
|
|
133
|
+
const committedResponse = async (result) => {
|
|
134
|
+
const tenantId = result.adminTenantId;
|
|
135
|
+
const appId = result.adminAppId;
|
|
136
|
+
if (typeof tenantId !== "string" || typeof appId !== "string" || !tenantId || !appId) {
|
|
137
|
+
return jsonResponse({ error: "Bootstrap result is incomplete" }, 409);
|
|
138
|
+
}
|
|
139
|
+
const response = jsonResponse({ ...result, bootstrapAdminToken: await issueBootstrapAdminToken(input.cpState, tenantId, appId) }, 200);
|
|
140
|
+
response.headers.set("Cache-Control", "no-store");
|
|
141
|
+
return response;
|
|
142
|
+
};
|
|
132
143
|
const completeBootstrap = async (result, snapshot) => {
|
|
133
144
|
try {
|
|
134
145
|
await input.postgres.completePendingAction({ kind: "bootstrap", key: "bootstrap", owner, result }, snapshot);
|
|
@@ -146,7 +157,7 @@ export async function registerBootstrapEndpoint(input) {
|
|
|
146
157
|
owner
|
|
147
158
|
});
|
|
148
159
|
if (claim.state === "completed")
|
|
149
|
-
return
|
|
160
|
+
return committedResponse((claim.action.result ?? { ok: true }));
|
|
150
161
|
if (claim.state === "busy")
|
|
151
162
|
return jsonResponse({ error: "Bootstrap is already being committed" }, 409);
|
|
152
163
|
if (claim.state !== "claimed")
|
|
@@ -154,7 +165,7 @@ export async function registerBootstrapEndpoint(input) {
|
|
|
154
165
|
if (freshConfig.tenants.length > 0) {
|
|
155
166
|
const result = existingBootstrapResult(freshConfig, input.cpState.issuer);
|
|
156
167
|
await completeBootstrap(result);
|
|
157
|
-
return
|
|
168
|
+
return committedResponse(result);
|
|
158
169
|
}
|
|
159
170
|
}
|
|
160
171
|
else {
|
|
@@ -326,7 +337,7 @@ export async function registerBootstrapEndpoint(input) {
|
|
|
326
337
|
input.logger.log.info("Bootstrap committed: tenant={tid} app={aid}; admin URL={adminUrl}", {
|
|
327
338
|
tid: adminTenantId, aid: adminAppId, adminUrl: body.adminApp.hostname
|
|
328
339
|
});
|
|
329
|
-
return
|
|
340
|
+
return committedResponse(result);
|
|
330
341
|
});
|
|
331
342
|
}
|
|
332
343
|
function hashBootstrapKey(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrapEndpoint.js","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/bootstrapEndpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,YAAY,EAA0B,MAAM,2CAA2C,CAAC;AACjG,OAAO,EAAE,MAAM,EAAkF,MAAM,yBAAyB,CAAC;AAGjI,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD;;;;GAIG;AACH;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAoB,EAAE,qBAA6B;IACzF,OAAO;QACL,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,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ClE,mBAAmB,EAAE,+BAA+B;QACpD,oBAAoB,EAAE,mCAAmC;KAC1D,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"bootstrapEndpoint.js","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/bootstrapEndpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,YAAY,EAA0B,MAAM,2CAA2C,CAAC;AACjG,OAAO,EAAE,MAAM,EAAkF,MAAM,yBAAyB,CAAC;AAGjI,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD;;;;GAIG;AACH;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAoB,EAAE,qBAA6B;IACzF,OAAO;QACL,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,qBAAqB,CAAC,EAAE;QACjL,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,oBAAoB,CAAC,EAAE;QAChM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,iCAAiC,EAAE,UA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AA+B,CAAC;QAC7D,iBAAiB,EAAE,UAAU,CAAC,mCAAmC,CAAC;QAClE,mBAAmB,EAAE,+BAA+B;QACpD,oBAAoB,EAAE,mCAAmC;KAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrapWizardHtml.d.ts","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/bootstrapWizardHtml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"bootstrapWizardHtml.d.ts","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/bootstrapWizardHtml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAgU7E"}
|
|
@@ -142,8 +142,8 @@ function step(id, label) {
|
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
async function postJson(url, body) {
|
|
146
|
-
const res = await fetch(url, { method: "POST", headers: { "content-type": "application/json", "accept": "application/json" }, body: JSON.stringify(body) });
|
|
145
|
+
async function postJson(url, body, authorization) {
|
|
146
|
+
const res = await fetch(url, { method: "POST", headers: { "content-type": "application/json", "accept": "application/json", ...(authorization ? { authorization: "Bearer " + authorization } : {}) }, body: JSON.stringify(body) });
|
|
147
147
|
if (!res.ok) {
|
|
148
148
|
let text = "";
|
|
149
149
|
try { text = await res.text(); } catch (_) {}
|
|
@@ -158,7 +158,7 @@ async function getJson(url) {
|
|
|
158
158
|
return readJson(res, "GET " + url);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
async function installService(label, serviceUrl, scope, options) {
|
|
161
|
+
async function installService(label, serviceUrl, scope, options, authorization) {
|
|
162
162
|
const s = step("install-" + label, "Install " + label + " service");
|
|
163
163
|
try {
|
|
164
164
|
const beginRes = await postJson(CP_ISSUER + "/.well-known/bp/admin/services/begin-install", {
|
|
@@ -166,7 +166,7 @@ async function installService(label, serviceUrl, scope, options) {
|
|
|
166
166
|
...(scope || {}),
|
|
167
167
|
...(options && options.instanceId ? { instanceId: options.instanceId } : {}),
|
|
168
168
|
...(options && options.sharedServiceId ? { sharedServiceId: options.sharedServiceId } : {})
|
|
169
|
-
});
|
|
169
|
+
}, authorization);
|
|
170
170
|
const installRes = await postJson(serviceUrl.replace(/\\/+$/, "") + "/.well-known/bp/install", {
|
|
171
171
|
setupToken: beginRes.setupToken,
|
|
172
172
|
cpUrl: CP_ISSUER
|
|
@@ -218,7 +218,7 @@ async function buildAdminRole(adminAppId, payload, commit) {
|
|
|
218
218
|
title: "Administrator",
|
|
219
219
|
description: "Full access to all services and views. Auto-created during bootstrap.",
|
|
220
220
|
permissions: grants
|
|
221
|
-
});
|
|
221
|
+
}, commit.bootstrapAdminToken);
|
|
222
222
|
s.done();
|
|
223
223
|
return res;
|
|
224
224
|
} catch (e) {
|
|
@@ -293,14 +293,16 @@ document.getElementById("wizard").addEventListener("submit", async (evt) => {
|
|
|
293
293
|
"auth",
|
|
294
294
|
payload.authService.hostname,
|
|
295
295
|
{ tenantId: commit.adminTenantId, appId: commit.adminAppId },
|
|
296
|
-
{ sharedServiceId: commit.authSharedServiceId }
|
|
296
|
+
{ sharedServiceId: commit.authSharedServiceId },
|
|
297
|
+
commit.bootstrapAdminToken
|
|
297
298
|
);
|
|
298
299
|
if (payload.themeService && payload.themeService.hostname) {
|
|
299
300
|
await installService(
|
|
300
301
|
"theme",
|
|
301
302
|
payload.themeService.hostname,
|
|
302
303
|
{ tenantId: commit.adminTenantId, appId: commit.adminAppId },
|
|
303
|
-
{ sharedServiceId: commit.themeSharedServiceId }
|
|
304
|
+
{ sharedServiceId: commit.themeSharedServiceId },
|
|
305
|
+
commit.bootstrapAdminToken
|
|
304
306
|
);
|
|
305
307
|
}
|
|
306
308
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrapWizardHtml.js","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/bootstrapWizardHtml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAA2B;IACnE,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACpD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAuGW,YAAY
|
|
1
|
+
{"version":3,"file":"bootstrapWizardHtml.js","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/bootstrapWizardHtml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAA2B;IACnE,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACpD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAuGW,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsNxB,CAAC;AACT,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { HtmlRenderable } from "@betterportal/framework";
|
|
1
|
+
import type { HtmlRenderable, ViewRenderContext } from "@betterportal/framework";
|
|
2
2
|
import type { ResponseData } from "../../../previewEnvironmentManagement.js";
|
|
3
3
|
export declare function configEditorScript(): HtmlRenderable;
|
|
4
4
|
export declare function configEditor(group: ResponseData["groups"][number], path: string, ticketUrl: string): HtmlRenderable;
|
|
5
|
-
export declare function render(data: ResponseData): HtmlRenderable;
|
|
5
|
+
export declare function render(data: ResponseData, ctx: ViewRenderContext): HtmlRenderable;
|
|
6
6
|
//# sourceMappingURL=GET.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GET.d.ts","sourceRoot":"","sources":["../../../../../../src/plugins/service-betterportal-config-manager/bp-routes/preview-environments/_renderer.bootstrap5/GET.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"GET.d.ts","sourceRoot":"","sources":["../../../../../../src/plugins/service-betterportal-config-manager/bp-routes/preview-environments/_renderer.bootstrap5/GET.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAc,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAmC7E,wBAAgB,kBAAkB,IAAI,cAAc,CAmRnD;AAiED,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,cAAc,CAsFnH;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,iBAAiB,GAAG,cAAc,CA4LjF"}
|
|
@@ -350,7 +350,13 @@ export function configEditor(group, path, ticketUrl) {
|
|
|
350
350
|
return fields.length === 0 ? null : _jsxs("div", { class: "mb-3", children: [_jsxs("div", { class: "text-uppercase text-secondary small fw-semibold mb-2", children: [scope, " config"] }), _jsx("div", { class: "row g-3", children: fields.map((field) => _jsxs("div", { class: "col-12 col-lg-6", children: [_jsxs("label", { class: "form-label", children: [field.title, field.required ? " *" : ""] }), fieldControl(service, field), _jsxs("div", { class: "form-text", children: [field.description, field.secret ? " Unlock with a generated key or decrypt the stored values first." : ""] }), field.secret && !field.required ? _jsxs("div", { class: "form-check mt-1", children: [_jsx("input", { class: "form-check-input", type: "checkbox", disabled: true, "data-bp-clear-secret": "", "data-service-id": service.serviceId, "data-scope": field.scope, "data-key": field.key, id: `bp-clear-${group.id}-${service.serviceId}-${field.scope}-${field.key}` }), _jsx("label", { class: "form-check-label small", for: `bp-clear-${group.id}-${service.serviceId}-${field.scope}-${field.key}`, children: "Clear stored value" })] }) : null] })) })] });
|
|
351
351
|
})] }))), _jsx("div", { class: "alert alert-secondary py-2", "data-bp-preview-config-status": "", role: "status", children: "Key is never submitted." }), _jsxs("div", { class: "d-flex flex-wrap gap-2", children: [_jsx("button", { class: "btn btn-primary", type: "submit", children: "Encrypt and save config" }), _jsx("button", { class: "btn btn-outline-secondary", type: "button", "data-bp-sync-prod": "", children: "Sync from prod" })] }), _jsxs("dialog", { class: "border-0 rounded shadow p-0", style: "width:min(92vw,72rem);max-height:90vh", "data-bp-sync-dialog": "", children: [_jsxs("div", { class: "p-3 border-bottom d-flex justify-content-between align-items-center", children: [_jsx("h3", { class: "h5 mb-0", children: "Production config diff" }), _jsx("button", { class: "btn-close", type: "button", "aria-label": "Close", "data-bp-sync-close": "" })] }), _jsx("div", { class: "p-3 overflow-auto", style: "max-height:70vh", "data-bp-sync-body": "" }), _jsxs("div", { class: "p-3 border-top d-flex justify-content-end gap-2", children: [_jsx("button", { class: "btn btn-outline-secondary", type: "button", "data-bp-sync-close": "", children: "Cancel" }), _jsx("button", { class: "btn btn-primary", type: "button", "data-bp-sync-apply": "", children: "Apply selected and save" })] })] })] }))] })] }));
|
|
352
352
|
}
|
|
353
|
-
export function render(data) {
|
|
354
|
-
return (_jsxs("div", { class: "container-fluid px-0", children: [_jsxs("div", { class: "d-flex flex-wrap justify-content-between align-items-start gap-3 mb-4", children: [_jsxs("div", { children: [_jsx("h2", { class: "mb-1", children: data.title }), _jsx("p", { class: "text-secondary mb-0", children: "Clone an existing tenant/app configuration while CI owns where each service runs." })] }), _jsx("button", { class: "btn btn-primary", "data-bs-toggle": "offcanvas", "data-bs-target": "#bp-create-preview-group", children: "Create group" })] }), data.notice ? _jsx("div", { class: "alert alert-success", role: "status", children: data.notice }) : null, data.error ? _jsx("div", { class: "alert alert-danger", role: "alert", children: data.error }) : null, credentials(data), _jsxs("div", { class: "alert alert-info d-flex gap-2 align-items-start", children: [_jsx("span", { "aria-hidden": "true", children: "i" }), _jsxs("div", { children: [_jsx("strong", { children: "Pull setup only." }), " Services receive credentials from CI, publish their manifest on first sync, and rebuild preview routes/menu automatically."] })] }), data.groups.length === 0 ? (_jsx("div", { class: "card border-0 shadow-sm", children: _jsx("div", { class: "card-body py-5 text-center text-secondary", children: "No preview groups configured." }) })) : data.groups.map((group) => (_jsx("section", { class: "card border-0 shadow-sm mb-4", "aria-labelledby": `bp-group-${group.id}`, children: _jsxs("div", { class: "card-body", children: [_jsxs("div", { class: "d-flex flex-wrap justify-content-between align-items-start gap-3 mb-3", children: [_jsxs("div", { children: [_jsx("h3", { class: "h5 mb-1", id: `bp-group-${group.id}`, children: group.name }), _jsx("div", { class: "small text-secondary", children: group.sourceLabel }), _jsx("code", { class: "small", children: group.id })] }), _jsxs("div", { class: "d-flex flex-wrap gap-2", children: [_jsx("button", { class: "btn btn-sm btn-outline-primary", "data-bs-toggle": "collapse", "data-bs-target": `#bp-new-${group.id}`, children: "New preview" }), _jsx("button", { class: "btn btn-sm btn-outline-secondary", "data-bs-toggle": "collapse", "data-bs-target": `#bp-settings-${group.id}`, "hx-get": `${data.previewPath}?_c=config&groupId=${encodeURIComponent(group.id)}`, "hx-trigger": `click[!document.getElementById('bp-config-${group.id}').querySelector('form')]`, "hx-target": `#bp-config-${group.id}`, "hx-swap": "innerHTML", children: "Settings" }), _jsx("button", { class: "btn btn-sm btn-outline-danger", "hx-delete": `${data.previewPath}?entity=group&id=${encodeURIComponent(group.id)}`, "hx-confirm": `Delete ${group.name} and all of its previews?`, "hx-target": "#bp-main", "hx-swap": "innerHTML", children: "Delete" })] })] }), _jsxs("div", { class: "row g-3 mb-3", children: [_jsxs("div", { class: "col-12 col-xl-7", children: [_jsx("div", { class: "small text-secondary mb-1", children: "CI endpoint" }), _jsxs("code", { class: "d-block text-break", children: ["POST ", data.deploymentApiBase, "/", group.id, "/deployments/<key>"] })] }), _jsxs("div", { class: "col-12 col-xl-5", children: [_jsx("div", { class: "small text-secondary mb-1", children: "BP plugins" }), _jsx("div", { class: "d-flex flex-wrap gap-1", children: group.services.length ? group.services.map((service) => _jsx("span", { class: "badge text-bg-secondary", children: service.serviceId })) : _jsx("span", { class: "small text-secondary", children: "Added by the first preview create request." }) })] })] }), _jsx("div", { class: "collapse mb-4", id: `bp-new-${group.id}`, children: _jsxs("div", { class: "border rounded p-3 bg-body-tertiary", children: [_jsx("h4", { class: "h6", children: "Create preview manually" }), _jsxs("form", { "hx-post": data.previewPath, "hx-target": "#bp-main", "hx-swap": "innerHTML", children: [_jsx("input", { type: "hidden", name: "action", value: "create-deployment" }), _jsx("input", { type: "hidden", name: "groupId", value: group.id }), _jsxs("div", { class: "row g-3", children: [_jsxs("div", { class: "col-12 col-md-4", children: [_jsx("label", { class: "form-label", children: "Key" }), _jsx("input", { class: "form-control font-monospace", name: "key", maxlength: "255", pattern: "[A-Za-z0-9][A-Za-z0-9._:-]*", required: true })] }), _jsxs("div", { class: "col-12 col-md-4", children: [_jsx("label", { class: "form-label", children: "Name" }), _jsx("input", { class: "form-control", name: "name" })] }), _jsxs("div", { class: "col-12 col-md-4", children: [_jsx("label", { class: "form-label", children: "Expiry" }), expiryInput(undefined, true)] }), _jsxs("div", { class: "col-12", children: [_jsx("label", { class: "form-label", children: "App hostname or origin" }), _jsx("input", { class: "form-control font-monospace", name: "hostname", placeholder: "pr-123.preview.example.com", required: true })] }), _jsxs("div", { class: "col-12", children: [_jsx("label", { class: "form-label", for: `bp-preview-services-${group.id}`, children: "Services" }), _jsx("textarea", { id: `bp-preview-services-${group.id}`, class: "form-control font-monospace", name: "services", rows: Math.max(4, group.services.length + 2), required: true, children: JSON.stringify(Object.fromEntries(group.services.map((service) => [service.serviceId, ""])), null, 2) }), _jsx("div", { class: "form-text", children: "JSON object mapping service IDs to public HTTPS URLs." })] })] }), _jsx("button", { class: "btn btn-primary mt-3", type: "submit", children: "Create preview" })] })] }) }), _jsx("div", { class: "collapse mb-4", id: `bp-settings-${group.id}`, children: _jsxs("div", { class: "border rounded p-3", children: [_jsxs("form", { "hx-put": data.previewPath, "hx-target": "#bp-main", "hx-swap": "innerHTML", children: [_jsx("input", { type: "hidden", name: "action", value: "update-group" }), _jsx("input", { type: "hidden", name: "groupId", value: group.id }), _jsxs("div", { class: "row g-3 mb-3", children: [_jsxs("div", { class: "col-12 col-md-8", children: [_jsx("label", { class: "form-label", children: "Group name" }), _jsx("input", { class: "form-control", name: "name", value: group.name, required: true })] }), _jsxs("div", { class: "col-12 col-md-4", children: [_jsx("label", { class: "form-label", children: "Maximum/default expiry" }), expiryInput(group.expiresInDays)] })] }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: `bp-elevated-roles-${group.id}`, children: "Preview admin role IDs" }), _jsx("textarea", { id: `bp-elevated-roles-${group.id}`, class: "form-control", name: "elevatedRoleIds", rows: "3", maxlength: "12900", "aria-describedby": `bp-elevated-roles-help-${group.id}`, children: (group.elevatedRoleIds ?? []).join("\n") }), _jsx("div", { class: "form-text", id: `bp-elevated-roles-help-${group.id}`, children: "Defaults for newly created previews; existing previews keep their own role settings. One exact role ID per line (or comma-separated), e.g. admin, staff, client. Users with any listed role get full access within this group's previews only. Empty keeps normal permissions. Changes apply to existing previews on config sync." })] }), oidcFields(`bp-group-${group.id}`, group.oidc), _jsx("button", { class: "btn btn-primary", type: "submit", children: "Save settings" })] }), _jsx("hr", {}), _jsxs("form", { "hx-post": data.previewPath, "hx-target": "#bp-main", "hx-swap": "innerHTML", children: [_jsx("input", { type: "hidden", name: "action", value: "rotate-key" }), _jsx("input", { type: "hidden", name: "groupId", value: group.id }), _jsx("button", { class: "btn btn-outline-warning", type: "submit", "hx-confirm": "Rotate this group API key? Existing CI credentials will stop working.", children: "Rotate API key" })] }), _jsx("div", { id: `bp-config-${group.id}`, children: _jsx("div", { class: "text-secondary small mt-3", role: "status", children: "Open settings to load service configuration." }) })] }) }), group.deployments.length === 0 ? _jsx("div", { class: "text-secondary small", children: "No active previews." }) : (_jsx("div", { class: "table-responsive", children: _jsxs("table", { class: "table table-sm align-middle mb-0", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Preview" }), _jsx("th", { children: "App" }), _jsx("th", { children: "Services" }), _jsx("th", { children: "Expiry" }), _jsx("th", {})] }) }), _jsx("tbody", { children: group.deployments.map((deployment) => (_jsxs("tr", { children: [_jsxs("td", { children: [_jsx("div", { class: "fw-semibold", children: deployment.name }), _jsx("code", { class: "small", children: deployment.key }), _jsx("div", { children: _jsx("span", { class: `badge ${deployment.ready ? "text-bg-success" : "text-bg-warning"}`, children: deployment.ready ? "Configured" : "Needs attention" }) })] }), _jsx("td", { children: _jsx("a", { href: deployment.hostname.startsWith("http") ? deployment.hostname : `https://${deployment.hostname}`, target: "_blank", rel: "noreferrer", children: deployment.hostname }) }), _jsx("td", { children: deployment.services.map((service) => _jsxs("div", { class: "small", children: [_jsx("span", { class: `badge ${service.ready ? "text-bg-success" : "text-bg-warning"}`, children: service.status.state }), " ", _jsx("span", { class: "font-monospace", children: service.serviceId })] })) }), _jsxs("td", { children: [_jsxs("form", { class: "d-flex gap-2", "hx-put": data.previewPath, "hx-target": "#bp-main", "hx-swap": "innerHTML", children: [_jsx("input", { type: "hidden", name: "action", value: "update-expiry" }), _jsx("input", { type: "hidden", name: "deploymentId", value: deployment.id }), expiryInput(deployment.expiresInDays, false, `Expiry for ${deployment.name}`), _jsx("button", { class: "btn btn-sm btn-outline-secondary", type: "submit", children: "Save" })] }), _jsx("div", { class: "small text-secondary mt-1", children: deployment.expiresAt ? new Date(deployment.expiresAt).toLocaleString() : "Never expires" })] }), _jsxs("td", { children: [_jsx("button", { type: "button", class: "btn btn-sm btn-outline-secondary me-2", "data-bs-toggle": "offcanvas", "data-bs-target": "#bp-preview-debug", "hx-get": `${data.previewPath}?_c=debug&deploymentId=${encodeURIComponent(deployment.id)}`, "hx-target": "#bp-preview-debug-body", "hx-swap": "innerHTML", children: "Debug" }), _jsx("button", { class: "btn btn-sm btn-outline-danger", "hx-delete": `${data.previewPath}?entity=deployment&id=${encodeURIComponent(deployment.id)}`, "hx-confirm": `Delete preview ${deployment.name}?`, "hx-target": "#bp-main", "hx-swap": "innerHTML", children: "Delete" })] })] }))) })] }) }))] }) }))), _jsxs("aside", { class: "offcanvas offcanvas-end", tabindex: -1, id: "bp-preview-debug", "aria-labelledby": "bp-preview-debug-title", style: "width:min(95vw,52rem)", children: [_jsxs("div", { class: "offcanvas-header", children: [_jsx("h3", { class: "offcanvas-title h5", id: "bp-preview-debug-title", children: "Preview diagnostics" }), _jsx("button", { type: "button", class: "btn-close", "data-bs-dismiss": "offcanvas", "aria-label": "Close" })] }), _jsx("div", { class: "offcanvas-body", id: "bp-preview-debug-body", "aria-live": "polite", children: "Select a deployment to load diagnostics." })] }), _jsxs("aside", { class: "offcanvas offcanvas-end", tabindex: -1, id: "bp-create-preview-group", "aria-labelledby": "bp-create-preview-group-title", children: [_jsxs("div", { class: "offcanvas-header", children: [_jsx("h3", { class: "offcanvas-title h5", id: "bp-create-preview-group-title", children: "Create preview group" }), _jsx("button", { type: "button", class: "btn-close", "data-bs-dismiss": "offcanvas", "aria-label": "Close" })] }), _jsx("div", { class: "offcanvas-body", children: _jsxs("form", { "hx-post": data.previewPath, "hx-target": "#bp-main", "hx-swap": "innerHTML", children: [_jsx("input", { type: "hidden", name: "action", value: "create-group" }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: "bp-preview-group-name", children: "Name" }), _jsx("input", { id: "bp-preview-group-name", class: "form-control", name: "name", maxlength: "120", required: true })] }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: "bp-preview-source-tenant", children: "Source tenant" }), _jsxs("select", { id: "bp-preview-source-tenant", class: "form-select", name: "sourceTenantId", required: true, children: [_jsx("option", { value: "", children: "Select tenant" }), data.sourceTenants.map((tenant) => _jsx("option", { value: tenant.id, children: tenant.title }))] })] }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: "bp-preview-source-app", children: "Source app" }), _jsxs("select", { id: "bp-preview-source-app", class: "form-select", name: "sourceAppId", required: true, children: [_jsx("option", { value: "", children: "Select app" }), data.sourceApps.map((app) => _jsx("option", { value: app.id, "data-tenant-id": app.tenantId, children: app.title }))] })] }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", children: "Maximum/default expiry" }), expiryInput(30)] }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: "bp-new-plugin-ids", children: "BP plugin IDs" }), _jsx("textarea", { id: "bp-new-plugin-ids", class: "form-control font-monospace", name: "pluginIds", rows: 3, placeholder: "org.example.service" })] }), oidcFields("bp-new-group"), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: "bp-new-elevated-roles", children: "Preview admin role IDs" }), _jsx("textarea", { id: "bp-new-elevated-roles", class: "form-control", name: "elevatedRoleIds", rows: "3", maxlength: "12900", placeholder: "admin, staff, client", "aria-describedby": "bp-new-elevated-roles-help" }), _jsx("div", { class: "form-text", id: "bp-new-elevated-roles-help", children: "One exact role ID per line or comma-separated. Grants full access only inside this group's previews; it does not assign roles to users or grant platform-admin access. Empty keeps normal permissions." })] }), _jsx("button", { class: "btn btn-primary w-100", type: "submit", children: "Create group" })] }) })] }), _jsx("script", { children: pageScript() })] }));
|
|
353
|
+
export function render(data, ctx) {
|
|
354
|
+
const destination = (method, query = {}, component) => {
|
|
355
|
+
const target = ctx.routeUrl({ path: "/preview-environments", method, query, component })?.absoluteViewPath;
|
|
356
|
+
if (!target)
|
|
357
|
+
throw new Error("Preview action route is unavailable");
|
|
358
|
+
return target;
|
|
359
|
+
};
|
|
360
|
+
return (_jsxs("div", { class: "container-fluid px-0", children: [_jsxs("div", { class: "d-flex flex-wrap justify-content-between align-items-start gap-3 mb-4", children: [_jsxs("div", { children: [_jsx("h2", { class: "mb-1", children: data.title }), _jsx("p", { class: "text-secondary mb-0", children: "Clone an existing tenant/app configuration while CI owns where each service runs." })] }), _jsx("button", { class: "btn btn-primary", "data-bs-toggle": "offcanvas", "data-bs-target": "#bp-create-preview-group", children: "Create group" })] }), data.notice ? _jsx("div", { class: "alert alert-success", role: "status", children: data.notice }) : null, data.error ? _jsx("div", { class: "alert alert-danger", role: "alert", children: data.error }) : null, credentials(data), _jsxs("div", { class: "alert alert-info d-flex gap-2 align-items-start", children: [_jsx("span", { "aria-hidden": "true", children: "i" }), _jsxs("div", { children: [_jsx("strong", { children: "Pull setup only." }), " Services receive credentials from CI, publish their manifest on first sync, and rebuild preview routes/menu automatically."] })] }), data.groups.length === 0 ? (_jsx("div", { class: "card border-0 shadow-sm", children: _jsx("div", { class: "card-body py-5 text-center text-secondary", children: "No preview groups configured." }) })) : data.groups.map((group) => (_jsx("section", { class: "card border-0 shadow-sm mb-4", "aria-labelledby": `bp-group-${group.id}`, children: _jsxs("div", { class: "card-body", children: [_jsxs("div", { class: "d-flex flex-wrap justify-content-between align-items-start gap-3 mb-3", children: [_jsxs("div", { children: [_jsx("h3", { class: "h5 mb-1", id: `bp-group-${group.id}`, children: group.name }), _jsx("div", { class: "small text-secondary", children: group.sourceLabel }), _jsx("code", { class: "small", children: group.id })] }), _jsxs("div", { class: "d-flex flex-wrap gap-2", children: [_jsx("button", { class: "btn btn-sm btn-outline-primary", "data-bs-toggle": "collapse", "data-bs-target": `#bp-new-${group.id}`, children: "New preview" }), _jsx("button", { class: "btn btn-sm btn-outline-secondary", "data-bs-toggle": "collapse", "data-bs-target": `#bp-settings-${group.id}`, "hx-get": destination("GET", { groupId: group.id }, "config"), "hx-trigger": `click[!document.getElementById('bp-config-${group.id}').querySelector('form')]`, "hx-target": `#bp-config-${group.id}`, "hx-swap": "innerHTML", children: "Settings" }), _jsx("button", { class: "btn btn-sm btn-outline-danger", "hx-delete": destination("DELETE", { entity: "group", id: group.id }), "hx-confirm": `Delete ${group.name} and all of its previews?`, "hx-target": "#bp-main", "hx-swap": "innerHTML", children: "Delete" })] })] }), _jsxs("div", { class: "row g-3 mb-3", children: [_jsxs("div", { class: "col-12 col-xl-7", children: [_jsx("div", { class: "small text-secondary mb-1", children: "CI endpoint" }), _jsxs("code", { class: "d-block text-break", children: ["POST ", data.deploymentApiBase, "/", group.id, "/deployments/<key>"] })] }), _jsxs("div", { class: "col-12 col-xl-5", children: [_jsx("div", { class: "small text-secondary mb-1", children: "BP plugins" }), _jsx("div", { class: "d-flex flex-wrap gap-1", children: group.services.length ? group.services.map((service) => _jsx("span", { class: "badge text-bg-secondary", children: service.serviceId })) : _jsx("span", { class: "small text-secondary", children: "Added by the first preview create request." }) })] })] }), _jsx("div", { class: "collapse mb-4", id: `bp-new-${group.id}`, children: _jsxs("div", { class: "border rounded p-3 bg-body-tertiary", children: [_jsx("h4", { class: "h6", children: "Create preview manually" }), _jsxs("form", { "hx-post": destination("POST"), "hx-target": "#bp-main", "hx-swap": "innerHTML", children: [_jsx("input", { type: "hidden", name: "action", value: "create-deployment" }), _jsx("input", { type: "hidden", name: "groupId", value: group.id }), _jsxs("div", { class: "row g-3", children: [_jsxs("div", { class: "col-12 col-md-4", children: [_jsx("label", { class: "form-label", children: "Key" }), _jsx("input", { class: "form-control font-monospace", name: "key", maxlength: "255", pattern: "[A-Za-z0-9][A-Za-z0-9._:-]*", required: true })] }), _jsxs("div", { class: "col-12 col-md-4", children: [_jsx("label", { class: "form-label", children: "Name" }), _jsx("input", { class: "form-control", name: "name" })] }), _jsxs("div", { class: "col-12 col-md-4", children: [_jsx("label", { class: "form-label", children: "Expiry" }), expiryInput(undefined, true)] }), _jsxs("div", { class: "col-12", children: [_jsx("label", { class: "form-label", children: "App hostname or origin" }), _jsx("input", { class: "form-control font-monospace", name: "hostname", placeholder: "pr-123.preview.example.com", required: true })] }), _jsxs("div", { class: "col-12", children: [_jsx("label", { class: "form-label", for: `bp-preview-services-${group.id}`, children: "Services" }), _jsx("textarea", { id: `bp-preview-services-${group.id}`, class: "form-control font-monospace", name: "services", rows: Math.max(4, group.services.length + 2), required: true, children: JSON.stringify(Object.fromEntries(group.services.map((service) => [service.serviceId, ""])), null, 2) }), _jsx("div", { class: "form-text", children: "JSON object mapping service IDs to public HTTPS URLs." })] })] }), _jsx("button", { class: "btn btn-primary mt-3", type: "submit", children: "Create preview" })] })] }) }), _jsx("div", { class: "collapse mb-4", id: `bp-settings-${group.id}`, children: _jsxs("div", { class: "border rounded p-3", children: [_jsxs("form", { "hx-put": destination("PUT"), "hx-target": "#bp-main", "hx-swap": "innerHTML", children: [_jsx("input", { type: "hidden", name: "action", value: "update-group" }), _jsx("input", { type: "hidden", name: "groupId", value: group.id }), _jsxs("div", { class: "row g-3 mb-3", children: [_jsxs("div", { class: "col-12 col-md-8", children: [_jsx("label", { class: "form-label", children: "Group name" }), _jsx("input", { class: "form-control", name: "name", value: group.name, required: true })] }), _jsxs("div", { class: "col-12 col-md-4", children: [_jsx("label", { class: "form-label", children: "Maximum/default expiry" }), expiryInput(group.expiresInDays)] })] }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: `bp-elevated-roles-${group.id}`, children: "Preview admin role IDs" }), _jsx("textarea", { id: `bp-elevated-roles-${group.id}`, class: "form-control", name: "elevatedRoleIds", rows: "3", maxlength: "12900", "aria-describedby": `bp-elevated-roles-help-${group.id}`, children: (group.elevatedRoleIds ?? []).join("\n") }), _jsx("div", { class: "form-text", id: `bp-elevated-roles-help-${group.id}`, children: "Defaults for newly created previews; existing previews keep their own role settings. One exact role ID per line (or comma-separated), e.g. admin, staff, client. Users with any listed role get full access within this group's previews only. Empty keeps normal permissions. Changes apply to existing previews on config sync." })] }), oidcFields(`bp-group-${group.id}`, group.oidc), _jsx("button", { class: "btn btn-primary", type: "submit", children: "Save settings" })] }), _jsx("hr", {}), _jsxs("form", { "hx-post": destination("POST"), "hx-target": "#bp-main", "hx-swap": "innerHTML", children: [_jsx("input", { type: "hidden", name: "action", value: "rotate-key" }), _jsx("input", { type: "hidden", name: "groupId", value: group.id }), _jsx("button", { class: "btn btn-outline-warning", type: "submit", "hx-confirm": "Rotate this group API key? Existing CI credentials will stop working.", children: "Rotate API key" })] }), _jsx("div", { id: `bp-config-${group.id}`, children: _jsx("div", { class: "text-secondary small mt-3", role: "status", children: "Open settings to load service configuration." }) })] }) }), group.deployments.length === 0 ? _jsx("div", { class: "text-secondary small", children: "No active previews." }) : (_jsx("div", { class: "table-responsive", children: _jsxs("table", { class: "table table-sm align-middle mb-0", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Preview" }), _jsx("th", { children: "App" }), _jsx("th", { children: "Services" }), _jsx("th", { children: "Expiry" }), _jsx("th", {})] }) }), _jsx("tbody", { children: group.deployments.map((deployment) => (_jsxs("tr", { children: [_jsxs("td", { children: [_jsx("div", { class: "fw-semibold", children: deployment.name }), _jsx("code", { class: "small", children: deployment.key }), _jsx("div", { children: _jsx("span", { class: `badge ${deployment.ready ? "text-bg-success" : "text-bg-warning"}`, children: deployment.ready ? "Configured" : "Needs attention" }) })] }), _jsx("td", { children: _jsx("a", { href: deployment.hostname.startsWith("http") ? deployment.hostname : `https://${deployment.hostname}`, target: "_blank", rel: "noreferrer", children: deployment.hostname }) }), _jsx("td", { children: deployment.services.map((service) => _jsxs("div", { class: "small", children: [_jsx("span", { class: `badge ${service.ready ? "text-bg-success" : "text-bg-warning"}`, children: service.status.state }), " ", _jsx("span", { class: "font-monospace", children: service.serviceId })] })) }), _jsxs("td", { children: [_jsxs("form", { class: "d-flex gap-2", "hx-put": destination("PUT"), "hx-target": "#bp-main", "hx-swap": "innerHTML", children: [_jsx("input", { type: "hidden", name: "action", value: "update-expiry" }), _jsx("input", { type: "hidden", name: "deploymentId", value: deployment.id }), expiryInput(deployment.expiresInDays, false, `Expiry for ${deployment.name}`), _jsx("button", { class: "btn btn-sm btn-outline-secondary", type: "submit", children: "Save" })] }), _jsx("div", { class: "small text-secondary mt-1", children: deployment.expiresAt ? new Date(deployment.expiresAt).toLocaleString() : "Never expires" })] }), _jsxs("td", { children: [_jsx("button", { type: "button", class: "btn btn-sm btn-outline-secondary me-2", "data-bs-toggle": "offcanvas", "data-bs-target": "#bp-preview-debug", "hx-get": destination("GET", { deploymentId: deployment.id }, "debug"), "hx-target": "#bp-preview-debug-body", "hx-swap": "innerHTML", children: "Debug" }), _jsx("button", { class: "btn btn-sm btn-outline-danger", "hx-delete": destination("DELETE", { entity: "deployment", id: deployment.id }), "hx-confirm": `Delete preview ${deployment.name}?`, "hx-target": "#bp-main", "hx-swap": "innerHTML", children: "Delete" })] })] }))) })] }) }))] }) }))), _jsxs("aside", { class: "offcanvas offcanvas-end", tabindex: -1, id: "bp-preview-debug", "aria-labelledby": "bp-preview-debug-title", style: "width:min(95vw,52rem)", children: [_jsxs("div", { class: "offcanvas-header", children: [_jsx("h3", { class: "offcanvas-title h5", id: "bp-preview-debug-title", children: "Preview diagnostics" }), _jsx("button", { type: "button", class: "btn-close", "data-bs-dismiss": "offcanvas", "aria-label": "Close" })] }), _jsx("div", { class: "offcanvas-body", id: "bp-preview-debug-body", "aria-live": "polite", children: "Select a deployment to load diagnostics." })] }), _jsxs("aside", { class: "offcanvas offcanvas-end", tabindex: -1, id: "bp-create-preview-group", "aria-labelledby": "bp-create-preview-group-title", children: [_jsxs("div", { class: "offcanvas-header", children: [_jsx("h3", { class: "offcanvas-title h5", id: "bp-create-preview-group-title", children: "Create preview group" }), _jsx("button", { type: "button", class: "btn-close", "data-bs-dismiss": "offcanvas", "aria-label": "Close" })] }), _jsx("div", { class: "offcanvas-body", children: _jsxs("form", { "hx-post": destination("POST"), "hx-target": "#bp-main", "hx-swap": "innerHTML", children: [_jsx("input", { type: "hidden", name: "action", value: "create-group" }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: "bp-preview-group-name", children: "Name" }), _jsx("input", { id: "bp-preview-group-name", class: "form-control", name: "name", maxlength: "120", required: true })] }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: "bp-preview-source-tenant", children: "Source tenant" }), _jsxs("select", { id: "bp-preview-source-tenant", class: "form-select", name: "sourceTenantId", required: true, children: [_jsx("option", { value: "", children: "Select tenant" }), data.sourceTenants.map((tenant) => _jsx("option", { value: tenant.id, children: tenant.title }))] })] }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: "bp-preview-source-app", children: "Source app" }), _jsxs("select", { id: "bp-preview-source-app", class: "form-select", name: "sourceAppId", required: true, children: [_jsx("option", { value: "", children: "Select app" }), data.sourceApps.map((app) => _jsx("option", { value: app.id, "data-tenant-id": app.tenantId, children: app.title }))] })] }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", children: "Maximum/default expiry" }), expiryInput(30)] }), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: "bp-new-plugin-ids", children: "BP plugin IDs" }), _jsx("textarea", { id: "bp-new-plugin-ids", class: "form-control font-monospace", name: "pluginIds", rows: 3, placeholder: "org.example.service" })] }), oidcFields("bp-new-group"), _jsxs("div", { class: "mb-3", children: [_jsx("label", { class: "form-label", for: "bp-new-elevated-roles", children: "Preview admin role IDs" }), _jsx("textarea", { id: "bp-new-elevated-roles", class: "form-control", name: "elevatedRoleIds", rows: "3", maxlength: "12900", placeholder: "admin, staff, client", "aria-describedby": "bp-new-elevated-roles-help" }), _jsx("div", { class: "form-text", id: "bp-new-elevated-roles-help", children: "One exact role ID per line or comma-separated. Grants full access only inside this group's previews; it does not assign roles to users or grant platform-admin access. Empty keeps normal permissions." })] }), _jsx("button", { class: "btn btn-primary w-100", type: "submit", children: "Create group" })] }) })] }), _jsx("script", { children: pageScript() })] }));
|
|
355
361
|
}
|
|
356
362
|
//# sourceMappingURL=GET.js.map
|