mirror of
https://github.com/donl/plivo-node.git
synced 2026-05-30 06:12:14 -06:00
12 lines
722 B
JavaScript
12 lines
722 B
JavaScript
import assert from 'assert';
|
|
import sinon from 'sinon';
|
|
|
|
import {AccessToken} from '../lib/utils/jwt';
|
|
|
|
describe('Jwt', function () {
|
|
it('should be created', function () {
|
|
let acctkn = new AccessToken('MADADADADADADADADADA', 'qwerty', 'username', {validFrom: 12121212, lifetime: 300}, 'username-12345');
|
|
acctkn.addVoiceGrants(true, true);
|
|
assert.equal(acctkn.toJwt(), 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InBsaXZvO3Y9MSJ9.eyJqdGkiOiJ1c2VybmFtZS0xMjM0NSIsImlzcyI6Ik1BREFEQURBREFEQURBREFEQURBIiwic3ViIjoidXNlcm5hbWUiLCJuYmYiOjEyMTIxMjEyLCJleHAiOjEyMjA1ODEyLCJncmFudHMiOnsidm9pY2UiOnsiaW5jb21pbmdfYWxsb3ciOnRydWUsIm91dGdvaW5nX2FsbG93Ijp0cnVlfX19.T0li-AM7WAhioMwRdwYuIA-N7BRkhf8o9g366py7w1s');
|
|
});
|
|
});
|