@commonpub/layer 0.3.6 → 0.3.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commonpub/layer",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"files": [
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"@commonpub/auth": "0.5.0",
|
|
48
48
|
"@commonpub/config": "0.7.0",
|
|
49
49
|
"@commonpub/docs": "0.5.2",
|
|
50
|
-
"@commonpub/editor": "0.5.0",
|
|
51
|
-
"@commonpub/learning": "0.5.0",
|
|
52
|
-
"@commonpub/protocol": "0.9.4",
|
|
53
50
|
"@commonpub/server": "2.7.0",
|
|
51
|
+
"@commonpub/editor": "0.5.0",
|
|
54
52
|
"@commonpub/ui": "0.7.1",
|
|
55
|
-
"@commonpub/
|
|
53
|
+
"@commonpub/learning": "0.5.0",
|
|
54
|
+
"@commonpub/schema": "0.8.8",
|
|
55
|
+
"@commonpub/protocol": "0.9.4"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {}
|
|
58
58
|
}
|
|
@@ -11,7 +11,14 @@ import { extractDomain } from '../../../utils/inbox';
|
|
|
11
11
|
* Body: { contentId?: string, hubsOnly?: boolean } — if omitted, re-federates ALL
|
|
12
12
|
*/
|
|
13
13
|
export default defineEventHandler(async (event) => {
|
|
14
|
-
|
|
14
|
+
// Allow CLI trigger via AUTH_SECRET header (for server-side automation)
|
|
15
|
+
const cliSecret = getRequestHeader(event, 'x-admin-secret');
|
|
16
|
+
const runtimeConfig = useRuntimeConfig();
|
|
17
|
+
if (cliSecret && cliSecret === runtimeConfig.authSecret) {
|
|
18
|
+
// Authorized via shared secret
|
|
19
|
+
} else {
|
|
20
|
+
requireAdmin(event);
|
|
21
|
+
}
|
|
15
22
|
|
|
16
23
|
const config = useConfig();
|
|
17
24
|
if (!config.features.federation) {
|
|
@@ -23,7 +30,6 @@ export default defineEventHandler(async (event) => {
|
|
|
23
30
|
const hubsOnly = body?.hubsOnly === true;
|
|
24
31
|
|
|
25
32
|
const db = useDB();
|
|
26
|
-
const runtimeConfig = useRuntimeConfig();
|
|
27
33
|
const domain = extractDomain((runtimeConfig.public?.siteUrl as string) || `https://${config.instance.domain}`);
|
|
28
34
|
|
|
29
35
|
if (contentId) {
|