mirror of https://github.com/garrytan/gstack.git
Merge c34195aeb0 into 3bef43bc5a
This commit is contained in:
commit
203433c2d2
|
|
@ -65,7 +65,7 @@ const DESTRUCTIVE_PATTERNS: RegExp[] = [
|
||||||
// Credentials / auth — allow filler words ("the", "my") between verb and noun
|
// Credentials / auth — allow filler words ("the", "my") between verb and noun
|
||||||
/\brevoke\s+[\w\s]*\b(api key|token|credential|access key|password)\b/i,
|
/\brevoke\s+[\w\s]*\b(api key|token|credential|access key|password)\b/i,
|
||||||
/\breset\s+[\w\s]*\b(api key|token|password|credential)\b/i,
|
/\breset\s+[\w\s]*\b(api key|token|password|credential)\b/i,
|
||||||
/\brotate\s+[\w\s]*\b(api key|token|secret|credential|access key)\b/i,
|
/\brotate\s+[\w\s]*\b(api key|token|secret|credential|access key|password)\b/i,
|
||||||
|
|
||||||
// Scope / architecture forks (reversible with effort — still deserve confirmation)
|
// Scope / architecture forks (reversible with effort — still deserve confirmation)
|
||||||
/\barchitectur(e|al)\s+(change|fork|shift|decision)\b/i,
|
/\barchitectur(e|al)\s+(change|fork|shift|decision)\b/i,
|
||||||
|
|
|
||||||
|
|
@ -426,6 +426,19 @@ describe('one-way-doors classifier', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('rotate <credential> password is one-way (parity with revoke/reset)', () => {
|
||||||
|
const cases = [
|
||||||
|
'Rotate the database password?',
|
||||||
|
'rotate password for the service account',
|
||||||
|
];
|
||||||
|
for (const summary of cases) {
|
||||||
|
const result = classifyQuestion({ summary });
|
||||||
|
expect(result.oneWay).toBe(true);
|
||||||
|
expect(result.reason).toBe('keyword');
|
||||||
|
expect(result.matched).toBeDefined();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test('skill-category fallback fires for cso:approval and land-and-deploy:approval', () => {
|
test('skill-category fallback fires for cso:approval and land-and-deploy:approval', () => {
|
||||||
expect(isOneWayDoor({ skill: 'cso', category: 'approval' })).toBe(true);
|
expect(isOneWayDoor({ skill: 'cso', category: 'approval' })).toBe(true);
|
||||||
expect(isOneWayDoor({ skill: 'land-and-deploy', category: 'approval' })).toBe(true);
|
expect(isOneWayDoor({ skill: 'land-and-deploy', category: 'approval' })).toBe(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue