Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function main () {
console.log(`Application: using Tanker version: ${Tanker.version}`);
// Randomize emails so that each test runs with new users
const aliceEmail = `alice-${uuid()}@example.com`;
const bobEmail = `bob-${uuid()}@example.com`;
// Init tanker
console.log('Application: init Tanker object');
const tankerConfig = await getTankerConfig();
const tanker = new Tanker(tankerConfig);
// Open Bob's session to make sure his account exists
const bob = await signUp(bobEmail);
console.log('Application: starting Tanker session for Bob');
await tanker.start(bob.identity);
await tanker.registerIdentity({ passphrase: 'Bob\'s secret passphrase'});
await tanker.stop();
console.log('Application: stopping Tanker session for Bob');
// Open Alice's session
const alice = await signUp(aliceEmail);
console.log('Application: starting Tanker session for Alice');
await tanker.start(alice.identity);
await tanker.registerIdentity({ passphrase: 'Alice\'s secret passphrase' });
console.log('Application: encrypting message for Bob');
async function main () {
console.log(`Application: using Tanker version: ${Tanker.version}`);
// Randomize emails so that each test runs with new users
const aliceEmail = `alice-${uuid()}@example.com`;
const bobEmail = `bob-${uuid()}@example.com`;
// Init tanker
console.log('Application: init Tanker object');
const tankerConfig = await getTankerConfig();
const tanker = new Tanker(tankerConfig);
// Open Bob's session to make sure his account exists
const bob = await signUp(bobEmail);
console.log('Application: starting Tanker session for Bob');
await tanker.start(bob.identity);
await tanker.registerIdentity({ passphrase: 'Bob\'s secret passphrase'});
await tanker.stop();
console.log('Application: stopping Tanker session for Bob');
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';
const generateTests = require('tests');
generateTests(getTankerVersion(), Tanker, generateUserToken);
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';
import generateTests from 'tests';
generateTests({
version: getTankerVersion(),
Tanker,
generateUserToken,
tests: ['encrypt', 'group', 'unlock']
});
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';
const generateTests = require('tests');
generateTests(getTankerVersion(), Tanker, generateUserToken);
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';
const generateTests = require('tests');
generateTests(getTankerVersion(), Tanker, generateUserToken);
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';
import adapter from '@tanker/datastore-pouchdb-memory';
import { generateV1Tests } from 'tests';
generateV1Tests({
version: getTankerVersion(),
Tanker,
generateUserToken,
tests: ['encrypt', 'group', 'unlock', 'revocationV1'],
adapter,
});
// @flow
import { getTankerVersion, Tanker } from '@tanker/client-node';
import { generateUserToken } from '@tanker/user-token';
const generateTests = require('tests');
generateTests(getTankerVersion(), Tanker, generateUserToken);
const makeTanker = (appId: b64string): Tanker => {
const tanker = new Tanker({
appId,
dataStore: { adapter: PouchDBMemory, prefix: makePrefix() },
sdkType: 'js-functional-tests-node',
url: tankerUrl,
});
return tanker;
};