test(supabase): avatar e2e on the sandbox only, per-session seed secret
pnpm e2e:avatar is now an alias of pnpm db:sandbox avatar-e2e and the DEV script scripts/avatar-e2e.sh is removed; the suite fails on any target but the sandbox gateway and database; an occupied port 57800 stops the run before anything starts. The sandbox replaces the seed accounts' DEV password by a per-session secret.
This commit is contained in:
1 parent
26e4b1b0ee
commit
cdd43ac431
16 files changed
+64
-100
No files matched your search
@@ -8,16 +8,15 @@
|
||||
* factors and sessions made here are removed afterwards (as postgres), so the
|
||||
* owner is back to no factor and the suite runs again on the same stack.
|
||||
*/
|
||||
import { confirmedAccount, errorCode, rest, rpc, signIn, sql } from './stack'
|
||||
import { SEED_PASSWORD, confirmedAccount, errorCode, rest, rpc, signIn, sql } from './stack'
|
||||
import { claimsOf, enrolTotp, stepUp, verifyTotp } from './mfa'
|
||||
|
||||
const OWNER = '10000000-0000-0000-0000-000000000001'
|
||||
const OWNER_EMAIL = 'owner@faunosteo.local'
|
||||
const OWNER_PASSWORD = 'LocalDev-only-password-1'
|
||||
const FACTOR_PREFIX = 'seed-owner-test'
|
||||
|
||||
const passwordSession = async (): Promise<string> => {
|
||||
const session = await signIn(OWNER_EMAIL, OWNER_PASSWORD)
|
||||
const session = await signIn(OWNER_EMAIL, SEED_PASSWORD)
|
||||
return session.body.access_token as string
|
||||
}
|
||||
const refusal = (result: { status: number; body: unknown }) =>
|
||||
|
||||
@@ -25,6 +25,8 @@ export const stack = {
|
||||
serviceKey: need('SANDBOX_SERVICE_KEY'),
|
||||
}
|
||||
const PG_PASSWORD = need('SANDBOX_PG_PASSWORD')
|
||||
/** The seeded accounts' password in this sandbox session (db-sandbox.sh replaces the seed's). */
|
||||
export const SEED_PASSWORD = need('SANDBOX_SEED_PASSWORD')
|
||||
/** The password of the accounts a run creates: random per run, kept in memory only. */
|
||||
export const PASSWORD = randomBytes(18).toString('base64url')
|
||||
|
||||
|
||||
Reference in new issue
Block a user