2fc7029bd9
Modernize the Tier-1 stack to the three-tier app and add browser coverage for the §22.4a metadata UI, closing the E2E gap deferred across SLICE-3/4/5: - seed-gitea.sh: create a REGISTRY_REPO with projects.yaml + a faceted named collection (.collection.yaml fields: priority enum + tags) seeded with three metadata-bearing entries; register content+registry webhooks; self-guarding (skip if a prior token still works) so a dependency-triggered re-run can't remint and invalidate the backend's token. - .env.tier1: REGISTRY_REPO/DEFAULT_PROJECT_ID; disable OTC cooldown + lift the per-IP auth limiter for the single-IP test runner. - docker-compose: pin backend image; backend-seed inserts a granted owner the OTC path can sign in as (write paths need contributor+). - Makefile: two-phase tier1-up (seed to completion, then create backend so it reads the populated token env); robust down; e2e-fresh = down+up+e2e (the canonical run, since the edit/bulk specs mutate the seeded corpus). - metadata.spec.js: SLICE-3 faceted filter (anon), SLICE-4 edit panel (owner), SLICE-5 bulk bar (owner). 4 passed against a fresh stack. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
18 lines
938 B
JavaScript
18 lines
938 B
JavaScript
import { waitForLatestOtc, clearMailpit } from './mailpit.js'
|
|
|
|
// Sign in through the §6.2 OTC path, leaving the rfc_session cookie on the
|
|
// page's browser context (page.request shares the page context's cookie jar,
|
|
// so a subsequent page.goto is authenticated). The Tier-1 seed pre-provisions
|
|
// `e2e-owner@example.test` as a granted deployment owner, so signing in as that
|
|
// address yields write access to the metadata edit/bulk paths (SLICE-4/5).
|
|
export async function signIn(page, email) {
|
|
await clearMailpit()
|
|
const req = await page.request.post('/auth/otc/request', { data: { email } })
|
|
if (!req.ok()) throw new Error(`otc request failed: ${req.status()}`)
|
|
const code = await waitForLatestOtc(email)
|
|
const verify = await page.request.post('/auth/otc/verify', { data: { email, code } })
|
|
if (!verify.ok()) throw new Error(`otc verify failed: ${verify.status()}`)
|
|
}
|
|
|
|
export const OWNER_EMAIL = 'e2e-owner@example.test'
|