Enable default emergency account
Some checks are pending
ci / test (push) Waiting to run
ci / test-postgresql (push) Waiting to run

This commit is contained in:
oliver 2026-10-12 10:46:39 +08:00
parent 70bde46eff
commit 07cfbefb6c
9 changed files with 43 additions and 31 deletions

View file

@ -182,7 +182,7 @@ test('R13/R14: QR challenge store + live identity patch + docs (source)', () =>
const acl = readFileSync(join(root, 'lib/dsh-acl.js'), 'utf8')
assert.match(acl, /__udsAuthIdentityLive/)
const readme = readFileSync(join(root, 'README.zh.md'), 'utf8')
assert.doesNotMatch(readme, /Admin@123.*首次启动自动启用/)
assert.match(readme, /administrator.*Admin@123/)
assert.match(readme, /mintTaskCapability|UDS_TASK_CAPABILITY/)
})

View file

@ -234,11 +234,11 @@ test('SEC-06: identity-cache never restores a principal', () => {
assert.equal(peekBrowserIdentity(), null)
})
test('SEC-08: new RolesStore does not enable shared default password', async () => {
test('SEC-08: new RolesStore enables the default emergency password', async () => {
const store = new RolesStore({})
await store.init()
assert.equal(store.isFallbackEnabled(), false)
assert.equal(store.verifyFallback(DEFAULT_FALLBACK_PASSWORD, '127.0.0.1'), false)
assert.equal(store.isFallbackEnabled(), true)
assert.equal(store.verifyFallback(DEFAULT_FALLBACK_PASSWORD, '127.0.0.1'), true)
})
test('SEC-09: empty roles + non-initial admin cannot bootstrap via middleware helper', async () => {