Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static async newApp(): Promise {
const appKeyPair = tcrypto.makeSignKeyPair();
const rootBlock = makeRootBlock(appKeyPair);
const message = {
root_block: utils.toBase64(serializeBlock(rootBlock)),
name: `functest-${uuid.v4()}`,
is_test: true,
private_signature_key: utils.toBase64(appKeyPair.privateKey),
};
const requester = await AuthenticatedRequester.open();
const createResponse = await requester.send('create trustchain', message);
const authToken = createResponse.auth_token;
const appId = rootBlock.trustchain_id;
await requester.send('update trustchain', {
id: utils.toBase64(appId),
oidc_client_id: oidcSettings.googleAuth.clientId,
oidc_provider: 'google',
});