refactor: use sync bcrypt to avoid issues with worker perms
refactor: fix up includes
This commit is contained in:
parent
e397bc884b
commit
1a02dcfcc3
27 changed files with 104 additions and 178 deletions
|
@ -1,7 +1,7 @@
|
|||
import { api, API_CLIENT } from '../../../utils/api.ts';
|
||||
import * as asserts from 'jsr:@std/assert';
|
||||
import * as asserts from '@std/assert';
|
||||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, get_new_user, set_user_permissions } from '../../helpers.ts';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../utils/totp.ts';
|
||||
import { clear_room_events_cache } from '../../../models/event.ts';
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { api, API_CLIENT } from '../../../utils/api.ts';
|
||||
import * as asserts from 'jsr:@std/assert';
|
||||
import * as asserts from '@std/assert';
|
||||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, get_new_user, set_user_permissions } from '../../helpers.ts';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../utils/totp.ts';
|
||||
import { clear_room_events_cache } from '../../../models/event.ts';
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as asserts from 'jsr:@std/assert';
|
||||
import * as asserts from '@std/assert';
|
||||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, get_new_user, set_user_permissions } from '../../../helpers.ts';
|
||||
import { api, API_CLIENT } from '../../../../utils/api.ts';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../../utils/totp.ts';
|
||||
import { clear_room_events_cache } from '../../../../models/event.ts';
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as asserts from 'jsr:@std/assert';
|
||||
import * as asserts from '@std/assert';
|
||||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, get_new_user, set_user_permissions } from '../../../helpers.ts';
|
||||
import { api, API_CLIENT } from '../../../../utils/api.ts';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../../utils/totp.ts';
|
||||
import { clear_room_events_cache } from '../../../../models/event.ts';
|
||||
|
||||
Deno.test({
|
||||
|
@ -12,6 +12,11 @@ Deno.test({
|
|||
write: true,
|
||||
net: true
|
||||
},
|
||||
|
||||
// TODO: see severus, but why do we need this?
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
|
||||
fn: async () => {
|
||||
let test_server_info: EPHEMERAL_SERVER | null = null;
|
||||
try {
|
||||
|
@ -110,11 +115,13 @@ Deno.test({
|
|||
asserts.assert(Array.isArray(long_polled_events));
|
||||
asserts.assertEquals(long_polled_events.length, 1);
|
||||
asserts.assertEquals(long_polled_events[0].data?.i, 12345);
|
||||
console.log('done');
|
||||
});
|
||||
} finally {
|
||||
console.log('finally');
|
||||
clear_room_events_cache();
|
||||
if (test_server_info) {
|
||||
await test_server_info?.server?.stop();
|
||||
await test_server_info.server.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as asserts from 'jsr:@std/assert';
|
||||
import * as asserts from '@std/assert';
|
||||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, get_new_user, set_user_permissions } from '../../../helpers.ts';
|
||||
import { api, API_CLIENT } from '../../../../utils/api.ts';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../../utils/totp.ts';
|
||||
import { clear_room_events_cache } from '../../../../models/event.ts';
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as asserts from 'jsr:@std/assert';
|
||||
import * as asserts from '@std/assert';
|
||||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, get_new_user, set_user_permissions } from '../../../helpers.ts';
|
||||
import { api, API_CLIENT } from '../../../../utils/api.ts';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../../utils/totp.ts';
|
||||
import { clear_room_events_cache } from '../../../../models/event.ts';
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { api, API_CLIENT } from '../../../utils/api.ts';
|
||||
import * as asserts from 'jsr:@std/assert';
|
||||
import * as asserts from '@std/assert';
|
||||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, get_new_user, set_user_permissions } from '../../helpers.ts';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../utils/totp.ts';
|
||||
import { clear_room_events_cache } from '../../../models/event.ts';
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { api, API_CLIENT } from '../../../utils/api.ts';
|
||||
import * as asserts from 'jsr:@std/assert';
|
||||
import * as asserts from '@std/assert';
|
||||
import { USER } from '../../../models/user.ts';
|
||||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, random_username } from '../../helpers.ts';
|
||||
import { Cookie, getSetCookies } from '@std/http/cookie';
|
||||
import { encodeBase64 } from '@std/encoding';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../utils/totp.ts';
|
||||
|
||||
Deno.test({
|
||||
name: 'API - USERS - Create',
|
||||
|
|
|
@ -4,7 +4,7 @@ import { USER } from '../../../models/user.ts';
|
|||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, random_username } from '../../helpers.ts';
|
||||
import { Cookie, getSetCookies } from '@std/http/cookie';
|
||||
import { encodeBase64 } from '@std/encoding';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../utils/totp.ts';
|
||||
|
||||
Deno.test({
|
||||
name: 'API - USERS - Delete',
|
||||
|
|
|
@ -4,7 +4,7 @@ import { USER } from '../../../models/user.ts';
|
|||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, random_username } from '../../helpers.ts';
|
||||
import { Cookie, getSetCookies } from '@std/http/cookie';
|
||||
import { encodeBase64 } from '@std/encoding';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../utils/totp.ts';
|
||||
|
||||
Deno.test({
|
||||
name: 'API - USERS - Login (password)',
|
||||
|
|
|
@ -4,7 +4,7 @@ import { USER } from '../../../models/user.ts';
|
|||
import { EPHEMERAL_SERVER, get_ephemeral_listen_server, random_username } from '../../helpers.ts';
|
||||
import { Cookie, getSetCookies } from '@std/http/cookie';
|
||||
import { encodeBase64 } from '@std/encoding';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../../../utils/totp.ts';
|
||||
|
||||
Deno.test({
|
||||
name: 'API - USERS - Update',
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { SERVER, SERVER_OPTIONS } from 'jsr:@andyburke/serverus/server';
|
||||
import { convert_to_words } from 'jsr:@andyburke/lurid/word_bytes';
|
||||
import { SERVER, SERVER_OPTIONS } from '@andyburke/serverus/server';
|
||||
import { convert_to_words } from '@andyburke/lurid/word_bytes';
|
||||
import { API_CLIENT } from '../utils/api.ts';
|
||||
import { Cookie, getSetCookies } from '@std/http/cookie';
|
||||
import { generateTotp } from '@stdext/crypto/totp';
|
||||
import { generateTotp } from '../utils/totp.ts';
|
||||
|
||||
const TLDs: string[] = [
|
||||
'com',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue