UNPKG

cognito-srp

Version:

Secure Remote Password protocol implementation compatible with Amazon Cognito.

17 lines (16 loc) 925 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const lib_1 = require("../lib"); const constants_1 = require("./constants"); describe('Session', () => { it('should be constructable from session key and scrambling parameter', () => { const session = new lib_1.Session(constants_1.poolname, constants_1.clientUser.username, Buffer.from(constants_1.sessionKey, 'hex'), Buffer.from(constants_1.scramblingParameter, 'hex')); expect(session.getHkdf()).toMatchSnapshot(); expect(session.calculateSignature('secret', 'timestamp')).toMatchSnapshot(); }); it('should be constructable from hkdf', () => { const session = new lib_1.Session(constants_1.poolname, constants_1.clientUser.username, constants_1.hkdf); expect(session.getHkdf()).toMatchSnapshot(); expect(session.calculateSignature('secret', 'timestamp')).toMatchSnapshot(); }); });