@adonis-agora/media-dashboard 6.1.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +38 -5
- package/dist/index.d.ts +12 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/provider/media_dashboard_provider.d.ts +15 -7
- package/dist/provider/media_dashboard_provider.d.ts.map +1 -1
- package/dist/provider/media_dashboard_provider.js +27 -492
- package/dist/provider/media_dashboard_provider.js.map +1 -1
- package/dist/spa/assets/{index-BtCClrPE.js → index-Dvw2uJpF.js} +12 -12
- package/dist/spa/assets/index-Dvw2uJpF.js.map +1 -0
- package/dist/spa/index.html +1 -1
- package/package.json +4 -5
- package/dist/define_config.d.ts +0 -49
- package/dist/define_config.d.ts.map +0 -1
- package/dist/define_config.js +0 -5
- package/dist/define_config.js.map +0 -1
- package/dist/provider/serve.d.ts +0 -23
- package/dist/provider/serve.d.ts.map +0 -1
- package/dist/provider/serve.js +0 -41
- package/dist/provider/serve.js.map +0 -1
- package/dist/server/auth.d.ts +0 -76
- package/dist/server/auth.d.ts.map +0 -1
- package/dist/server/auth.js +0 -134
- package/dist/server/auth.js.map +0 -1
- package/dist/server/cookie.d.ts +0 -20
- package/dist/server/cookie.d.ts.map +0 -1
- package/dist/server/cookie.js +0 -44
- package/dist/server/cookie.js.map +0 -1
- package/dist/server/object_insights.d.ts +0 -42
- package/dist/server/object_insights.d.ts.map +0 -1
- package/dist/server/object_insights.js +0 -42
- package/dist/server/object_insights.js.map +0 -1
- package/dist/server/service.d.ts +0 -212
- package/dist/server/service.d.ts.map +0 -1
- package/dist/server/service.js +0 -470
- package/dist/server/service.js.map +0 -1
- package/dist/spa/assets/index-BtCClrPE.js.map +0 -1
|
@@ -1,39 +1,19 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import { basename, resolve as resolvePath } from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { MediaManager } from '@adonis-agora/media';
|
|
5
|
-
import router from '@adonisjs/core/services/router';
|
|
6
|
-
import { resolveConsoleAuth, signSessionCookie, verifySessionCookie } from '../server/auth.js';
|
|
7
|
-
import { SESSION_COOKIE_NAME, parseCookieHeader, serializeSetCookie } from '../server/cookie.js';
|
|
8
|
-
import { DashboardError, DashboardService } from '../server/service.js';
|
|
9
|
-
import { contentTypeFor, normalizePath, renderIndexHtml } from './serve.js';
|
|
10
1
|
/**
|
|
11
|
-
*
|
|
2
|
+
* Standalone entry point for the media-management console — kept for hosts that prefer registering
|
|
3
|
+
* `@adonis-agora/media-dashboard` explicitly (or already do). As of this package's `7.0.0`, the
|
|
4
|
+
* console ships EMBEDDED in `@adonis-agora/media` itself (`node ace configure @adonis-agora/media`
|
|
5
|
+
* wires it up for free, no separate install), and this provider is now a thin delegate to that
|
|
6
|
+
* embedded one — it carries no logic of its own, so a fix to the console applies to both entry points
|
|
7
|
+
* with nothing to keep in sync by hand.
|
|
12
8
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
spaDir ??= fileURLToPath(new URL('../spa/', import.meta.url));
|
|
21
|
-
return spaDir;
|
|
22
|
-
}
|
|
23
|
-
/** Cookie `Path` for the built-in session — deliberately `/`, not scoped to `apiBase`: the SPA's
|
|
24
|
-
* `basePath` and its `apiBase` are independently configurable and can live at unrelated paths, and a
|
|
25
|
-
* cookie scoped to just one would be withheld on a full-page navigation to the other. The cookie is
|
|
26
|
-
* HttpOnly + HMAC-signed + short-lived, so the broader scope is a reasonable trade. Matches the
|
|
27
|
-
* NestJS sibling console's own `cookiePath: '/'` for the identical reason. */
|
|
28
|
-
const SESSION_COOKIE_PATH = '/';
|
|
29
|
-
/**
|
|
30
|
-
* Mounts the media-management console: a React SPA plus a JSON API, both under a configurable path and
|
|
31
|
-
* an optional host auth guard. The API delegates to the already-bound {@link MediaManager} singleton
|
|
32
|
-
* (bound by `@adonis-agora/media`'s provider) via a pure {@link DashboardService} — disk
|
|
33
|
-
* `list`/`stat`/`copy`/`move`/`deleteMany` and the resumable session store. Nothing about storage is
|
|
34
|
-
* reimplemented here.
|
|
9
|
+
* Delegating via a runtime `import()` of the bare specifier — rather than a static
|
|
10
|
+
* `import ... from '@adonis-agora/media/dashboard_provider'` — is deliberate, not a style choice:
|
|
11
|
+
* `@adonis-agora/media` is a required PEER of this package (real consumers always have it installed),
|
|
12
|
+
* but a static import would make this package statically depend on it, which inside THIS monorepo
|
|
13
|
+
* would close a cycle (`@adonis-agora/media` already depends on `@adonis-agora/media-dashboard` at
|
|
14
|
+
* build time, to copy this package's built SPA into its own `dist`). A dynamic import needs no
|
|
15
|
+
* workspace-graph edge, so both packages build in either order.
|
|
35
16
|
*
|
|
36
|
-
* Add to `adonisrc.ts` after the media provider, and (optionally) a `config/media_dashboard.ts`:
|
|
37
17
|
* ```ts
|
|
38
18
|
* providers: [
|
|
39
19
|
* () => import('@adonis-agora/media/media_provider'),
|
|
@@ -43,470 +23,25 @@ const SESSION_COOKIE_PATH = '/';
|
|
|
43
23
|
*/
|
|
44
24
|
export default class MediaDashboardProvider {
|
|
45
25
|
app;
|
|
26
|
+
#inner;
|
|
46
27
|
constructor(app) {
|
|
47
28
|
this.app = app;
|
|
48
29
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const uploadsBase = normalizePath(config.uploadsPrefix ?? '/media/uploads');
|
|
59
|
-
const tusBase = normalizePath(config.tusPrefix ?? '/media/uploads/tus');
|
|
60
|
-
const actions = config.actions ?? false;
|
|
61
|
-
const diskNames = this.#resolveDiskNames(config);
|
|
62
|
-
const middleware = config.middleware
|
|
63
|
-
? Array.isArray(config.middleware)
|
|
64
|
-
? config.middleware
|
|
65
|
-
: [config.middleware]
|
|
66
|
-
: [];
|
|
67
|
-
// Built-in session-cookie login (Mode A/B), independent of `middleware` — see auth.ts. `null`
|
|
68
|
-
// when unconfigured, in which case every gate below is a no-op and the API stays open.
|
|
69
|
-
const auth = resolveConsoleAuth(config.auth);
|
|
70
|
-
const objectInsights = config.objectInsights ?? [];
|
|
71
|
-
const service = async () => new DashboardService(await this.app.container.make(MediaManager), { diskNames, actions }, objectInsights);
|
|
72
|
-
this.#mountAuthRoutes(apiBase, auth);
|
|
73
|
-
this.#mountApi(apiBase, service, middleware, auth);
|
|
74
|
-
this.#mountSpa(basePath, { apiBase, uploadsBase, tusBase, actions }, middleware);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Mints/clears the console session cookie: `GET /me`, `POST /login`, `POST /session`,
|
|
78
|
-
* `POST /logout`. Deliberately NOT gated by `middleware` NOR the session guard below — these
|
|
79
|
-
* routes CREATE the session the guard checks for (mirroring the NestJS sibling console's
|
|
80
|
-
* `MediaConsoleAuthController`, which is likewise excluded from both its own session guard and any
|
|
81
|
-
* host-supplied `guards`). A host `session` hook reads its OWN auth directly off the raw request,
|
|
82
|
-
* so it needs no help from `middleware` here. When `auth` is unset, `/me` reports
|
|
83
|
-
* `authRequired: false` and login/session/logout 404 (nothing to mint or clear).
|
|
84
|
-
*/
|
|
85
|
-
#mountAuthRoutes(apiBase, auth) {
|
|
86
|
-
const group = router.group(() => {
|
|
87
|
-
router
|
|
88
|
-
.get('/me', async (ctx) => {
|
|
89
|
-
if (!auth) {
|
|
90
|
-
const body = { authRequired: false };
|
|
91
|
-
return ctx.response.status(200).json(body);
|
|
92
|
-
}
|
|
93
|
-
const session = sessionFromRequest(ctx, auth);
|
|
94
|
-
// The UNauthenticated SPA learns which login mode(s) to offer from this 401 body.
|
|
95
|
-
if (!session)
|
|
96
|
-
return ctx.response.status(401).json({ auth: { modes: auth.modes } });
|
|
97
|
-
const body = { user: userInfoFromSession(session) };
|
|
98
|
-
return ctx.response.status(200).json(body);
|
|
99
|
-
})
|
|
100
|
-
.as('media.dashboard.me');
|
|
101
|
-
router
|
|
102
|
-
.post('/login', async (ctx) => {
|
|
103
|
-
if (!auth || !auth.login)
|
|
104
|
-
return ctx.response.status(404).send('');
|
|
105
|
-
const raw = ctx.request.body();
|
|
106
|
-
if (typeof raw.username !== 'string' || typeof raw.password !== 'string') {
|
|
107
|
-
return ctx.response
|
|
108
|
-
.status(400)
|
|
109
|
-
.json({ error: 'body must include string username and password' });
|
|
110
|
-
}
|
|
111
|
-
const user = await runAuthHook(() => auth.login?.(raw.username, raw.password));
|
|
112
|
-
// Uniform 401 for unknown user / bad password — no user-enumeration.
|
|
113
|
-
if (!user)
|
|
114
|
-
return ctx.response.status(401).json({ error: 'invalid credentials' });
|
|
115
|
-
issueSessionCookie(ctx, user, auth);
|
|
116
|
-
const body = { user: userInfoFromUser(user) };
|
|
117
|
-
return ctx.response.status(200).json(body);
|
|
118
|
-
})
|
|
119
|
-
.as('media.dashboard.login');
|
|
120
|
-
router
|
|
121
|
-
.post('/session', async (ctx) => {
|
|
122
|
-
if (!auth || !auth.session)
|
|
123
|
-
return ctx.response.status(404).send('');
|
|
124
|
-
const user = await runAuthHook(() => auth.session?.(ctx.request.request));
|
|
125
|
-
if (!user)
|
|
126
|
-
return ctx.response.status(401).json({ error: 'unauthorized' });
|
|
127
|
-
issueSessionCookie(ctx, user, auth);
|
|
128
|
-
const body = { user: userInfoFromUser(user) };
|
|
129
|
-
return ctx.response.status(200).json(body);
|
|
130
|
-
})
|
|
131
|
-
.as('media.dashboard.session');
|
|
132
|
-
router
|
|
133
|
-
.post('/logout', async (ctx) => {
|
|
134
|
-
// Best-effort: even without auth configured, clearing is harmless.
|
|
135
|
-
clearSessionCookie(ctx);
|
|
136
|
-
return ctx.response.status(204).send('');
|
|
137
|
-
})
|
|
138
|
-
.as('media.dashboard.logout');
|
|
139
|
-
});
|
|
140
|
-
group.prefix(apiBase);
|
|
141
|
-
}
|
|
142
|
-
#mountApi(apiBase, service, middleware, auth) {
|
|
143
|
-
const json = (handler, okStatus = 200) => {
|
|
144
|
-
return async (ctx) => {
|
|
145
|
-
try {
|
|
146
|
-
const result = await handler(await service(), ctx);
|
|
147
|
-
if (result === undefined)
|
|
148
|
-
return ctx.response.status(204).send('');
|
|
149
|
-
return ctx.response.status(okStatus).json(result);
|
|
150
|
-
}
|
|
151
|
-
catch (error) {
|
|
152
|
-
const status = error instanceof DashboardError ? error.status : 500;
|
|
153
|
-
const message = error instanceof Error ? error.message : 'dashboard error';
|
|
154
|
-
return ctx.response.status(status).json({ error: message });
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
const group = router.group(() => {
|
|
159
|
-
router
|
|
160
|
-
.get('/topology', json(async (svc) => svc.topology()))
|
|
161
|
-
.as('media.dashboard.topology');
|
|
162
|
-
router
|
|
163
|
-
.get('/disks', json(async (svc) => svc.disks()))
|
|
164
|
-
.as('media.dashboard.disks');
|
|
165
|
-
router
|
|
166
|
-
.get('/objects', json(async (svc, ctx) => {
|
|
167
|
-
const disk = str(ctx, 'disk');
|
|
168
|
-
if (!disk)
|
|
169
|
-
throw new DashboardError('disk is required', 400);
|
|
170
|
-
const prefix = str(ctx, 'prefix');
|
|
171
|
-
const cursor = str(ctx, 'cursor');
|
|
172
|
-
const limit = ctx.request.input('limit');
|
|
173
|
-
return svc.objects(disk, {
|
|
174
|
-
...(prefix !== undefined ? { prefix } : {}),
|
|
175
|
-
...(cursor !== undefined ? { cursor } : {}),
|
|
176
|
-
...(limit !== undefined ? { limit: Number(limit) } : {}),
|
|
177
|
-
});
|
|
178
|
-
}))
|
|
179
|
-
.as('media.dashboard.objects');
|
|
180
|
-
router
|
|
181
|
-
.get('/object', json(async (svc, ctx) => {
|
|
182
|
-
const disk = str(ctx, 'disk');
|
|
183
|
-
const key = str(ctx, 'key');
|
|
184
|
-
if (!disk)
|
|
185
|
-
throw new DashboardError('disk is required', 400);
|
|
186
|
-
return svc.object(disk, key ?? '');
|
|
187
|
-
}))
|
|
188
|
-
.as('media.dashboard.object');
|
|
189
|
-
router
|
|
190
|
-
.post('/object', async (ctx) => {
|
|
191
|
-
// Raw bytes as `application/octet-stream` so the host's JSON/urlencoded body parsers never
|
|
192
|
-
// consume the stream; `ctx.request.request` is still the untouched Node request stream for
|
|
193
|
-
// any content type the app's bodyparser wasn't configured to parse. The real MIME rides as
|
|
194
|
-
// the `type` query param and becomes the stored object's Content-Type.
|
|
195
|
-
try {
|
|
196
|
-
const disk = str(ctx, 'disk');
|
|
197
|
-
const key = str(ctx, 'key');
|
|
198
|
-
const type = str(ctx, 'type');
|
|
199
|
-
if (!disk)
|
|
200
|
-
throw new DashboardError('disk is required', 400);
|
|
201
|
-
if (!key)
|
|
202
|
-
throw new DashboardError('key is required', 400);
|
|
203
|
-
await (await service()).putObject(disk, key, ctx.request.request, type);
|
|
204
|
-
return ctx.response.status(204).send('');
|
|
205
|
-
}
|
|
206
|
-
catch (error) {
|
|
207
|
-
const status = error instanceof DashboardError ? error.status : 500;
|
|
208
|
-
const message = error instanceof Error ? error.message : 'dashboard error';
|
|
209
|
-
return ctx.response.status(status).json({ error: message });
|
|
210
|
-
}
|
|
211
|
-
})
|
|
212
|
-
.as('media.dashboard.object.upload');
|
|
213
|
-
router
|
|
214
|
-
.get('/object/raw', async (ctx) => {
|
|
215
|
-
try {
|
|
216
|
-
const disk = str(ctx, 'disk');
|
|
217
|
-
const key = str(ctx, 'key');
|
|
218
|
-
if (!disk)
|
|
219
|
-
throw new DashboardError('disk is required', 400);
|
|
220
|
-
const { stream, contentType, size } = await (await service()).objectStream(disk, key ?? '');
|
|
221
|
-
ctx.response.header('content-type', contentType);
|
|
222
|
-
ctx.response.header('content-disposition', 'inline');
|
|
223
|
-
if (Number.isFinite(size))
|
|
224
|
-
ctx.response.header('content-length', String(size));
|
|
225
|
-
return ctx.response.stream(stream);
|
|
226
|
-
}
|
|
227
|
-
catch (error) {
|
|
228
|
-
const status = error instanceof DashboardError ? error.status : 500;
|
|
229
|
-
const message = error instanceof Error ? error.message : 'dashboard error';
|
|
230
|
-
return ctx.response.status(status).json({ error: message });
|
|
231
|
-
}
|
|
232
|
-
})
|
|
233
|
-
.as('media.dashboard.object.raw');
|
|
234
|
-
router
|
|
235
|
-
.get('/object/insights', json(async (svc, ctx) => {
|
|
236
|
-
const disk = str(ctx, 'disk');
|
|
237
|
-
const key = str(ctx, 'key');
|
|
238
|
-
if (!disk)
|
|
239
|
-
throw new DashboardError('disk is required', 400);
|
|
240
|
-
return svc.objectInsights(disk, key ?? '');
|
|
241
|
-
}))
|
|
242
|
-
.as('media.dashboard.object.insights');
|
|
243
|
-
router
|
|
244
|
-
.get('/uploads', json(async (svc, ctx) => {
|
|
245
|
-
const disk = str(ctx, 'disk');
|
|
246
|
-
const prefix = str(ctx, 'prefix');
|
|
247
|
-
return svc.uploads({
|
|
248
|
-
...(disk !== undefined ? { disk } : {}),
|
|
249
|
-
...(prefix !== undefined ? { prefix } : {}),
|
|
250
|
-
});
|
|
251
|
-
}))
|
|
252
|
-
.as('media.dashboard.uploads');
|
|
253
|
-
router
|
|
254
|
-
.get('/uploads/:id', json(async (svc, ctx) => svc.uploadDetail(String(ctx.params.id))))
|
|
255
|
-
.as('media.dashboard.uploads.show');
|
|
256
|
-
router
|
|
257
|
-
.post('/uploads/:id/abort', json(async (svc, ctx) => {
|
|
258
|
-
await svc.abortUpload(String(ctx.params.id));
|
|
259
|
-
}))
|
|
260
|
-
.as('media.dashboard.uploads.abort');
|
|
261
|
-
router
|
|
262
|
-
.get('/collections', json(async (svc, ctx) => {
|
|
263
|
-
const collection = str(ctx, 'collection');
|
|
264
|
-
const ownerType = str(ctx, 'ownerType');
|
|
265
|
-
const ownerId = str(ctx, 'ownerId');
|
|
266
|
-
const prefix = str(ctx, 'prefix');
|
|
267
|
-
const cursor = str(ctx, 'cursor');
|
|
268
|
-
const limit = ctx.request.input('limit');
|
|
269
|
-
return svc.collections({
|
|
270
|
-
...(collection !== undefined ? { collection } : {}),
|
|
271
|
-
...(ownerType !== undefined ? { ownerType } : {}),
|
|
272
|
-
...(ownerId !== undefined ? { ownerId } : {}),
|
|
273
|
-
...(prefix !== undefined ? { prefix } : {}),
|
|
274
|
-
...(cursor !== undefined ? { cursor } : {}),
|
|
275
|
-
...(limit !== undefined ? { limit: Number(limit) } : {}),
|
|
276
|
-
});
|
|
277
|
-
}))
|
|
278
|
-
.as('media.dashboard.collections');
|
|
279
|
-
router
|
|
280
|
-
.get('/collections/summary', json(async (svc) => svc.collectionsSummary()))
|
|
281
|
-
.as('media.dashboard.collections.summary');
|
|
282
|
-
router
|
|
283
|
-
.get('/media-record', json(async (svc, ctx) => {
|
|
284
|
-
const id = str(ctx, 'id');
|
|
285
|
-
if (!id)
|
|
286
|
-
throw new DashboardError('id is required', 400);
|
|
287
|
-
return svc.mediaRecord(id);
|
|
288
|
-
}))
|
|
289
|
-
.as('media.dashboard.media_record');
|
|
290
|
-
router
|
|
291
|
-
.post('/media-record/delete', json(async (svc, ctx) => {
|
|
292
|
-
const body = ctx.request.body();
|
|
293
|
-
if (!body.id)
|
|
294
|
-
throw new DashboardError('id is required', 400);
|
|
295
|
-
await svc.deleteMediaRecord(body.id);
|
|
296
|
-
}))
|
|
297
|
-
.as('media.dashboard.media_record.delete');
|
|
298
|
-
router
|
|
299
|
-
.post('/copy', json(async (svc, ctx) => {
|
|
300
|
-
await svc.copy(copyMoveBody(ctx));
|
|
301
|
-
}))
|
|
302
|
-
.as('media.dashboard.copy');
|
|
303
|
-
router
|
|
304
|
-
.post('/move', json(async (svc, ctx) => {
|
|
305
|
-
await svc.move(copyMoveBody(ctx));
|
|
306
|
-
}))
|
|
307
|
-
.as('media.dashboard.move');
|
|
308
|
-
router
|
|
309
|
-
.post('/delete', json(async (svc, ctx) => {
|
|
310
|
-
const body = ctx.request.body();
|
|
311
|
-
if (!body.disk)
|
|
312
|
-
throw new DashboardError('disk is required', 400);
|
|
313
|
-
await svc.remove({
|
|
314
|
-
disk: body.disk,
|
|
315
|
-
keys: Array.isArray(body.keys) ? body.keys : [],
|
|
316
|
-
});
|
|
317
|
-
}))
|
|
318
|
-
.as('media.dashboard.delete');
|
|
319
|
-
router
|
|
320
|
-
.post('/folder', json(async (svc, ctx) => {
|
|
321
|
-
await svc.createFolder(folderBody(ctx));
|
|
322
|
-
}))
|
|
323
|
-
.as('media.dashboard.folder.create');
|
|
324
|
-
router
|
|
325
|
-
.post('/folder/delete', json(async (svc, ctx) => {
|
|
326
|
-
await svc.deleteFolder(folderBody(ctx));
|
|
327
|
-
}))
|
|
328
|
-
.as('media.dashboard.folder.delete');
|
|
329
|
-
router
|
|
330
|
-
.post('/folder/copy', json(async (svc, ctx) => {
|
|
331
|
-
await svc.copyFolder(copyMoveBody(ctx));
|
|
332
|
-
}))
|
|
333
|
-
.as('media.dashboard.folder.copy');
|
|
334
|
-
router
|
|
335
|
-
.post('/folder/move', json(async (svc, ctx) => {
|
|
336
|
-
await svc.moveFolder(copyMoveBody(ctx));
|
|
337
|
-
}))
|
|
338
|
-
.as('media.dashboard.folder.move');
|
|
339
|
-
});
|
|
340
|
-
group.prefix(apiBase);
|
|
341
|
-
// Host `middleware` first (e.g. an admin check), then the built-in session guard (when `auth` is
|
|
342
|
-
// configured) — a request must pass both. The mutating routes above are further gated at the
|
|
343
|
-
// service layer by `actions` (unconditionally mounted; `DashboardService` 403s when disabled), so
|
|
344
|
-
// read-only hosts can leave them mounted without enabling `actions`.
|
|
345
|
-
applyMiddleware(group, auth ? [...middleware, sessionGuardMiddleware(auth)] : middleware);
|
|
346
|
-
}
|
|
347
|
-
#mountSpa(basePath, bootstrap, middleware) {
|
|
348
|
-
const serveIndex = async (ctx) => {
|
|
349
|
-
let html;
|
|
350
|
-
try {
|
|
351
|
-
html = await readFile(resolvePath(spaDirectory(), 'index.html'), 'utf8');
|
|
352
|
-
}
|
|
353
|
-
catch {
|
|
354
|
-
return ctx.response
|
|
355
|
-
.status(404)
|
|
356
|
-
.send('media dashboard SPA is not built (run the package build to emit dist/spa)');
|
|
357
|
-
}
|
|
358
|
-
return ctx.response
|
|
359
|
-
.header('content-type', 'text/html; charset=utf-8')
|
|
360
|
-
.header('cache-control', 'no-store, must-revalidate')
|
|
361
|
-
.send(renderIndexHtml(html, basePath, bootstrap));
|
|
362
|
-
};
|
|
363
|
-
const group = router.group(() => {
|
|
364
|
-
router.get('/', serveIndex).as('media.dashboard.index');
|
|
365
|
-
router
|
|
366
|
-
.get('/assets/:file', async (ctx) => {
|
|
367
|
-
const file = basename(String(ctx.params.file));
|
|
368
|
-
const path = resolvePath(spaDirectory(), 'assets', file);
|
|
369
|
-
if (!path.startsWith(resolvePath(spaDirectory(), 'assets')))
|
|
370
|
-
return ctx.response.status(404).send('');
|
|
371
|
-
let bytes;
|
|
372
|
-
try {
|
|
373
|
-
bytes = await readFile(path);
|
|
374
|
-
}
|
|
375
|
-
catch {
|
|
376
|
-
return ctx.response.status(404).send('');
|
|
377
|
-
}
|
|
378
|
-
return ctx.response
|
|
379
|
-
.header('content-type', contentTypeFor(file))
|
|
380
|
-
.header('cache-control', 'public, max-age=31536000, immutable')
|
|
381
|
-
.send(bytes);
|
|
382
|
-
})
|
|
383
|
-
.as('media.dashboard.assets');
|
|
384
|
-
});
|
|
385
|
-
group.prefix(basePath);
|
|
386
|
-
applyMiddleware(group, middleware);
|
|
387
|
-
}
|
|
388
|
-
/** Derive browsable disk names from the media config when the console config does not list them. */
|
|
389
|
-
#resolveDiskNames(config) {
|
|
390
|
-
if (config.disks && config.disks.length > 0)
|
|
391
|
-
return config.disks;
|
|
392
|
-
const media = this.app.config.get('media', {});
|
|
393
|
-
const drive = this.app.config.get('drive', {});
|
|
394
|
-
const defaultName = media.disk ?? drive.default ?? 'default';
|
|
395
|
-
const configured = media.disks ? Object.keys(media.disks) : [];
|
|
396
|
-
return Array.from(new Set([defaultName, ...configured]));
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
function str(ctx, key) {
|
|
400
|
-
const value = ctx.request.input(key);
|
|
401
|
-
return typeof value === 'string' && value !== '' ? value : undefined;
|
|
402
|
-
}
|
|
403
|
-
function copyMoveBody(ctx) {
|
|
404
|
-
const body = ctx.request.body();
|
|
405
|
-
if (!body.disk)
|
|
406
|
-
throw new DashboardError('disk is required', 400);
|
|
407
|
-
return {
|
|
408
|
-
disk: body.disk,
|
|
409
|
-
from: body.from ?? '',
|
|
410
|
-
to: body.to ?? '',
|
|
411
|
-
...(body.toDisk !== undefined ? { toDisk: body.toDisk } : {}),
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
/** Body for the folder create/delete actions — a disk and the folder prefix. */
|
|
415
|
-
function folderBody(ctx) {
|
|
416
|
-
const body = ctx.request.body();
|
|
417
|
-
if (!body.disk)
|
|
418
|
-
throw new DashboardError('disk is required', 400);
|
|
419
|
-
return { disk: body.disk, prefix: body.prefix ?? '' };
|
|
420
|
-
}
|
|
421
|
-
/** Apply host middleware to a route group without depending on Adonis's exact middleware typings. */
|
|
422
|
-
function applyMiddleware(group, middleware) {
|
|
423
|
-
if (middleware.length === 0)
|
|
424
|
-
return;
|
|
425
|
-
group.use(middleware);
|
|
426
|
-
}
|
|
427
|
-
/* Session-cookie helpers ---------------------------------------------------------------------- */
|
|
428
|
-
/** Run a host hook (login/session) defensively: a throw is a denial (null), never a 500. */
|
|
429
|
-
async function runAuthHook(run) {
|
|
430
|
-
try {
|
|
431
|
-
return (await run()) ?? null;
|
|
432
|
-
}
|
|
433
|
-
catch {
|
|
434
|
-
return null;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
function sessionFromRequest(ctx, auth) {
|
|
438
|
-
const cookieValue = parseCookieHeader(ctx.request.header('cookie'))[SESSION_COOKIE_NAME];
|
|
439
|
-
if (cookieValue === undefined)
|
|
440
|
-
return null;
|
|
441
|
-
return verifySessionCookie(cookieValue, { secret: auth.secret });
|
|
442
|
-
}
|
|
443
|
-
function userInfoFromSession(session) {
|
|
444
|
-
return {
|
|
445
|
-
id: session.sub,
|
|
446
|
-
...(session.name !== undefined ? { name: session.name } : {}),
|
|
447
|
-
roles: session.roles,
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
function userInfoFromUser(user) {
|
|
451
|
-
return {
|
|
452
|
-
id: user.id,
|
|
453
|
-
...(user.name !== undefined ? { name: user.name } : {}),
|
|
454
|
-
roles: user.roles ?? [],
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
function issueSessionCookie(ctx, user, auth, now) {
|
|
458
|
-
const value = signSessionCookie(user, {
|
|
459
|
-
secret: auth.secret,
|
|
460
|
-
ttlMs: auth.ttlMs,
|
|
461
|
-
...(now !== undefined ? { now } : {}),
|
|
462
|
-
});
|
|
463
|
-
ctx.response.append('set-cookie', serializeSetCookie(SESSION_COOKIE_NAME, value, {
|
|
464
|
-
path: SESSION_COOKIE_PATH,
|
|
465
|
-
maxAgeSeconds: Math.floor(auth.ttlMs / 1000),
|
|
466
|
-
secure: ctx.request.secure(),
|
|
467
|
-
}));
|
|
468
|
-
}
|
|
469
|
-
function clearSessionCookie(ctx) {
|
|
470
|
-
ctx.response.append('set-cookie', serializeSetCookie(SESSION_COOKIE_NAME, '', {
|
|
471
|
-
path: SESSION_COOKIE_PATH,
|
|
472
|
-
maxAgeSeconds: 0,
|
|
473
|
-
secure: ctx.request.secure(),
|
|
474
|
-
clear: true,
|
|
475
|
-
}));
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Gates a route group on a valid session cookie. Sliding renewal + revalidation mirrors the NestJS
|
|
479
|
-
* sibling console's `MediaConsoleGuard`: past half the TTL, the host's `revalidate` hook (if any)
|
|
480
|
-
* re-checks the user before a fresh cookie is issued, so a deactivated operator loses access instead
|
|
481
|
-
* of riding a self-renewing cookie.
|
|
482
|
-
*/
|
|
483
|
-
function sessionGuardMiddleware(auth) {
|
|
484
|
-
return async (ctx, next) => {
|
|
485
|
-
const session = sessionFromRequest(ctx, auth);
|
|
486
|
-
// Absent/invalid/expired cookie => 401 with the login modes, same shape as `/me`'s refusal.
|
|
487
|
-
if (!session)
|
|
488
|
-
return ctx.response.status(401).json({ auth: { modes: auth.modes } });
|
|
489
|
-
const now = Date.now();
|
|
490
|
-
if (now - session.iat > auth.ttlMs / 2) {
|
|
491
|
-
const user = userInfoFromSession(session);
|
|
492
|
-
if (auth.revalidate) {
|
|
493
|
-
const allowed = await runAuthHookBoolean(() => auth.revalidate?.(user));
|
|
494
|
-
if (!allowed) {
|
|
495
|
-
clearSessionCookie(ctx);
|
|
496
|
-
return ctx.response.status(401).json({ auth: { modes: auth.modes } });
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
issueSessionCookie(ctx, user, auth, now);
|
|
30
|
+
async #resolveInner() {
|
|
31
|
+
if (!this.#inner) {
|
|
32
|
+
// @ts-expect-error — `@adonis-agora/media` is a required PEER (real consumers always have it
|
|
33
|
+
// installed) but deliberately NOT a workspace/type dependency of this package inside this
|
|
34
|
+
// monorepo (see the class doc comment: linking it here would close a build-time cycle). The
|
|
35
|
+
// specifier stays a literal (rather than going through a variable) so `vi.mock` can intercept
|
|
36
|
+
// it in tests — see media_dashboard_provider.spec.ts.
|
|
37
|
+
const mod = (await import('@adonis-agora/media/dashboard_provider'));
|
|
38
|
+
this.#inner = new mod.default(this.app);
|
|
500
39
|
}
|
|
501
|
-
return
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
async function runAuthHookBoolean(run) {
|
|
505
|
-
try {
|
|
506
|
-
return (await run()) ?? false;
|
|
40
|
+
return this.#inner;
|
|
507
41
|
}
|
|
508
|
-
|
|
509
|
-
|
|
42
|
+
async boot() {
|
|
43
|
+
const inner = await this.#resolveInner();
|
|
44
|
+
await inner.boot?.();
|
|
510
45
|
}
|
|
511
46
|
}
|
|
512
47
|
//# sourceMappingURL=media_dashboard_provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media_dashboard_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sD;YACtD,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,wCAAwC,CAAC,CAElE,CAAC;YACF,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QACzC,MAAM,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;IACvB,CAAC;CACF"}
|