smart-home-engine 1.1.20 → 1.3.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/dist/web/assets/{index-b3gdLMp3.css → index-BTdLG-cS.css} +1 -1
- package/dist/web/assets/index-SmPJ7Vpm.js +230 -0
- package/dist/web/assets/{tsMode-HtyxY0LK.js → tsMode-XvjcqT_Z.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/src/lib/dynsec.js +13 -0
- package/src/web/broker-api.js +48 -0
- package/dist/web/assets/index-BIDlQXlY.js +0 -230
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-
|
|
1
|
+
import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-SmPJ7Vpm.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
package/dist/web/index.html
CHANGED
|
@@ -172,10 +172,10 @@
|
|
|
172
172
|
}
|
|
173
173
|
})();
|
|
174
174
|
</script>
|
|
175
|
-
<script type="module" crossorigin src="/assets/index-
|
|
175
|
+
<script type="module" crossorigin src="/assets/index-SmPJ7Vpm.js"></script>
|
|
176
176
|
<link rel="modulepreload" crossorigin href="/assets/monaco-langs-BW2J83t5.js">
|
|
177
177
|
<link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
|
|
178
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
178
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BTdLG-cS.css">
|
|
179
179
|
</head>
|
|
180
180
|
<body>
|
|
181
181
|
<div id="app"></div>
|
package/package.json
CHANGED
package/src/lib/dynsec.js
CHANGED
|
@@ -343,6 +343,16 @@ function setDefaultACLAccess(acls) {
|
|
|
343
343
|
return _request('setDefaultACLAccess', { acls });
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
// ── Anonymous group ────────────────────────────────────────────────────────────
|
|
347
|
+
|
|
348
|
+
function getAnonymousGroup() {
|
|
349
|
+
return _request('getAnonymousGroup').then((r) => r.data?.group ?? r.group ?? null);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function setAnonymousGroup(groupname) {
|
|
353
|
+
return _request('setAnonymousGroup', { groupname });
|
|
354
|
+
}
|
|
355
|
+
|
|
346
356
|
module.exports = {
|
|
347
357
|
init,
|
|
348
358
|
getStatus,
|
|
@@ -376,4 +386,7 @@ module.exports = {
|
|
|
376
386
|
// Default ACLs
|
|
377
387
|
getDefaultACLAccess,
|
|
378
388
|
setDefaultACLAccess,
|
|
389
|
+
// Anonymous group
|
|
390
|
+
getAnonymousGroup,
|
|
391
|
+
setAnonymousGroup,
|
|
379
392
|
};
|
package/src/web/broker-api.js
CHANGED
|
@@ -478,6 +478,54 @@ router.delete('/groups/:group/roles/:role', async (req, res) => {
|
|
|
478
478
|
}
|
|
479
479
|
});
|
|
480
480
|
|
|
481
|
+
// ── dynsec: Default ACL access ────────────────────────────────────────────────
|
|
482
|
+
|
|
483
|
+
/** GET /she/broker/acl-defaults */
|
|
484
|
+
router.get('/acl-defaults', async (req, res) => {
|
|
485
|
+
try {
|
|
486
|
+
const acls = await dynsec.getDefaultACLAccess();
|
|
487
|
+
res.json({ acls });
|
|
488
|
+
} catch (err) {
|
|
489
|
+
handleError(res, err);
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
/** PUT /she/broker/acl-defaults */
|
|
494
|
+
router.put('/acl-defaults', async (req, res) => {
|
|
495
|
+
try {
|
|
496
|
+
const { acls } = req.body;
|
|
497
|
+
if (!Array.isArray(acls)) return res.status(400).json({ error: 'acls array required' });
|
|
498
|
+
await dynsec.setDefaultACLAccess(acls);
|
|
499
|
+
res.json({ ok: true });
|
|
500
|
+
} catch (err) {
|
|
501
|
+
handleError(res, err);
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
// ── dynsec: Anonymous group ───────────────────────────────────────────────────
|
|
506
|
+
|
|
507
|
+
/** GET /she/broker/anonymous-group */
|
|
508
|
+
router.get('/anonymous-group', async (req, res) => {
|
|
509
|
+
try {
|
|
510
|
+
const group = await dynsec.getAnonymousGroup();
|
|
511
|
+
res.json({ group });
|
|
512
|
+
} catch (err) {
|
|
513
|
+
handleError(res, err);
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
|
|
517
|
+
/** PUT /she/broker/anonymous-group */
|
|
518
|
+
router.put('/anonymous-group', async (req, res) => {
|
|
519
|
+
try {
|
|
520
|
+
const { groupname } = req.body;
|
|
521
|
+
if (typeof groupname !== 'string' && groupname !== null) return res.status(400).json({ error: 'groupname string or null required' });
|
|
522
|
+
await dynsec.setAnonymousGroup(groupname);
|
|
523
|
+
res.json({ ok: true });
|
|
524
|
+
} catch (err) {
|
|
525
|
+
handleError(res, err);
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
|
|
481
529
|
// ── CA routes ─────────────────────────────────────────────────────────────────
|
|
482
530
|
|
|
483
531
|
/** GET /she/broker/ca — CA cert info */
|