feat: add tbank tokens

This commit is contained in:
2026-08-13 19:31:43 +03:00
parent 4cbfc2621c
commit 31cbba8654
25 changed files with 3592 additions and 24 deletions
+16
View File
@@ -0,0 +1,16 @@
import { TbankCrypto } from './tbank.crypto';
describe('TbankCrypto', () => {
it('round-trips a token and rejects a malformed key', () => {
const crypto = TbankCrypto.fromBase64(
'MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=',
);
const encrypted = crypto.encrypt('secret-token');
expect(encrypted).not.toContain('secret-token');
expect(crypto.decrypt(encrypted)).toBe('secret-token');
expect(() => TbankCrypto.fromBase64('invalid')).toThrow(
'Invalid token encryption key',
);
});
});