Skip to content

Commit

Permalink
Merge branch 'francisco/remove_session_token_tests' into 'master'
Browse files Browse the repository at this point in the history
feat: temporary remove session token tests

See merge request TankerHQ/sdk-react-native!80
  • Loading branch information
francisco-tanker committed Apr 7, 2022
2 parents 85488c0 + e446910 commit 492378a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 35 deletions.
7 changes: 0 additions & 7 deletions adminserver/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ def get_tanker_url() -> str:
return assert_env("TANKER_APPD_URL")


@app.route("/toggle_session_certificates", methods=["POST"])
def toggle_session_certificates() -> str:
enable = request.form["enable"].lower() == "true"
admin.update_app(tanker_app["id"], session_certificates=enable)
return ""


@app.route("/toggle_preverified_verification", methods=["POST"])
def toggle_preverified_verification() -> str:
enable = request.form["enable"].lower() == "true"
Expand Down
11 changes: 0 additions & 11 deletions example/src/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ export async function getTankerUrl(): Promise<string> {
return await (await fetch(`${SERVER_URL}/get_tanker_url`)).text();
}

export async function toggleSessionCertificates(
enable: boolean
): Promise<void> {
const form = new FormData();
form.append('enable', enable);
await fetch(`${SERVER_URL}/toggle_session_certificates`, {
method: 'POST',
body: form,
});
}

export async function togglePreverifiedVerification(
enable: boolean
): Promise<void> {
Expand Down
17 changes: 0 additions & 17 deletions example/src/test_tanker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
getPublicIdentity,
getVerificationCode,
getSMSVerificationCode,
toggleSessionCertificates,
togglePreverifiedVerification,
} from './admin';
import {
Expand All @@ -19,7 +18,6 @@ import {
IdentityAlreadyAttached,
} from '@tanker/errors';
import { createTanker, clearTankerDataDirs } from './tests';
import base64 from 'react-native-base64';

export const tankerTests = () => {
describe('Tanker tests', () => {
Expand Down Expand Up @@ -264,21 +262,6 @@ export const tankerTests = () => {
await secondDevice.stop();
});

it('can request a session token with VerificationOptions', async () => {
await toggleSessionCertificates(true);
await tanker.start(identity);
const token = await tanker.registerIdentity(
{ passphrase: 'foo' },
{ withSessionToken: true }
);
await toggleSessionCertificates(false);
expect(tanker.status).eq(Tanker.statuses.READY);
expect(token).is.not.empty;
// @ts-ignore is.not.empty checks that the token is not undefined
const tokenData = base64.decode(token);
expect(tokenData).length.greaterThanOrEqual(32);
});

it('can use a verificationKey', async () => {
await tanker.start(identity);
const verifKey = await tanker.generateVerificationKey();
Expand Down

0 comments on commit 492378a

Please sign in to comment.