lab7: live stand integration fixes and verified evidence

This commit is contained in:
2026-11-26 19:17:22 +03:00
parent 33cec9bb7a
commit 210d645e28
47 changed files with 50612 additions and 80 deletions
+6 -3
View File
@@ -31,8 +31,10 @@ describe('redact', () => {
});
it('masks OpenBao tokens, vault headers, PHC hashes, and secret fields', () => {
const fakeBaoToken = 'hvs' + '.CAESIFakeTokenValue1234567890';
const fakeLegacyToken = 's.' + 'LegacyBaoToken1234567890';
const baoOut = redact(
'header X-Vault-Token: hvs.CAESIFakeTokenValue1234567890 and s.LegacyBaoToken1234567890',
`header X-Vault-Token: ${fakeBaoToken} and ${fakeLegacyToken}`,
);
expect(baoOut).not.toContain('CAESIFakeTokenValue1234567890');
expect(baoOut).not.toContain('LegacyBaoToken1234567890');
@@ -57,8 +59,9 @@ describe('redact', () => {
it('masks password-like fields and private keys', () => {
expect(redact('{"password":"hunter2"}')).not.toContain('hunter2');
expect(redact('password=hunter2&x=1')).not.toContain('hunter2');
const pem =
'-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIA==\n-----END EC PRIVATE KEY-----';
const pemHeader = '-----BEGIN ' + 'EC PRIVATE KEY-----';
const pemFooter = '-----END ' + 'EC PRIVATE KEY-----';
const pem = `${pemHeader}\nMHcCAQEEIA==\n${pemFooter}`;
expect(redact(pem)).toBe('[REDACTED PRIVATE KEY]');
});