fix: group names match docs, dedupe resource groups, agent 404, shared-secrets + vault apps, promote + plugin logs (v1.27.0) (#168)
- group names match docs/GROUPS.md: {site}_{kind}_{name}_{level} (kind always present; services -> app kind); updated resolver + tests + access_request test
- site resource carries only god_admin + site-wide groups
- groups no longer appear 3x: idempotent ResourceGroup linking (self-heal was creating duplicates on every Directory load)
- /api/agent/* no longer 404s: REST router mounts unconditionally (was gated on the WS server)
- shared-secrets: slug regex allows underscores; GET list uses static pathFor (fixes 's.path is not a function')
- vault Apps tab: new GET /api/vault/apps + Minted apps list + purpose text; /docs/vault help link + docs cover Apps/Shared
- discovery promote: load instance and call update() (fixes 'Resource.update is not a function')
- discovery plugin cards: last-run time/status + Logs button
This commit is contained in:
@@ -410,6 +410,27 @@ mintAppRouter.post('/', async (req, res, next) => {
|
||||
}
|
||||
});
|
||||
|
||||
// List the minted external-app tokens (metadata only — the token itself is shown
|
||||
// once at mint and never stored; the accessor is a renewal/revoke handle and is
|
||||
// never exposed). Lets the Apps tab show what has been minted instead of a
|
||||
// credential vanishing into the void.
|
||||
mintAppRouter.get('/', async (req, res, next) => {
|
||||
try {
|
||||
await permission.byGroup(req.user, [ADMIN_GROUP]);
|
||||
const rows = await VaultAppToken.list();
|
||||
res.json({ apps: rows.map((r) => ({
|
||||
name: r.name,
|
||||
createdBy: r.created_by,
|
||||
createdOn: r.created_on,
|
||||
lastRenewedAt: r.lastRenewedAt || null,
|
||||
lastError: r.lastError || null,
|
||||
})) });
|
||||
} catch (e) {
|
||||
if (e.status === 401) return res.status(403).json({ error: 'admin only' });
|
||||
next(e);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
getOrCreateUserToken,
|
||||
getOrCreateAdminToken,
|
||||
|
||||
Reference in New Issue
Block a user