7 Commits

Author SHA1 Message Date
ed0100a7d7 feat(apps): Phase 6.1-6.3 — agent-console live API, dashboard notifications+webhooks, admin analytics
- agent-console: /agents + /jobs now call the real /v1/agents + /v1/jobs API (server reads + register/create/advance actions), graceful demo fallback; +server-only dep.
- dashboard: webhook endpoint management + recent deliveries; in-app Notification Center (header bell) over delivery runs.
- admin: analytics/reporting page (summary cards + CSS bar charts, no new dep) + CSV export route.
- roadmap 6.1-6.3 checked. 1308 tests / 213 suites, typecheck + builds green.
2026-06-21 12:36:36 +03:00
b73437be14 feat(auth): active sessions — list + revoke (Phase 1.3)
- AuthService.listSessions (marks current) + revokeSessionById (account-scoped, not_found if not owned).
- store: listSessionsByAccount + deleteSessionById (InMemory + Pg).
- API: GET /v1/auth/sessions, DELETE /v1/auth/sessions/:id (bearer).
- dashboard: Security card — SessionList client + /api/sessions(+/[id]) routes (cookie->bearer, same-origin guard).
- Phase 1 complete. 1308 tests / 213 suites, typecheck + builds green.
2026-06-21 11:59:20 +03:00
9ed86fa715 feat(apps): roadmap batch — agent-console, creator-dashboard, marketplace, admin, dashboard
- agent-console: Agents (ERC-8004 identity/reputation) + Jobs (ERC-8183 lifecycle timeline) pages via Local ports; 'Agent economy' nav group.
- creator-dashboard: per-source detail + per-payout royalty-split breakdown pages (stable slug/settlementId routing).
- marketplace: listing/service detail page + tag/search filtering.
- admin: settlements console.
- dashboard: Profile card (EditProfile) wired to PATCH /v1/auth/account.
- 1308 tests / 213 suites, typecheck + all app builds green.
2026-06-21 02:04:43 +03:00
7f3f850104 feat(auth): wallet unlink + development roadmap (continuous loop)
- AuthService.unlinkWallet — clears the linked wallet, refusing to strand a
  wallet-only account (no password) from its only sign-in method.
- DELETE /v1/auth/wallet (bearer); dashboard Unlink button + /api/wallet/link DELETE.
- InMemoryAuthStore.saveAccount removes the stale wallet index on unlink (Pg: column→NULL).
- docs/DEVELOPMENT_ROADMAP.md: phased feature plan driving the continuous loop.
- 1308 tests / 213 suites, typecheck + builds green.
2026-06-21 01:51:48 +03:00
fa6d2ec342 fix(security): harden web3/SIWE auth per security review (CRITICAL+HIGH)
CRITICAL-1: validate SIWE domain/chainId server-side (EIP-4361 cross-site replay guard); AuthService gains siweDomain/siweChainIds, wired from AUTH_SIWE_DOMAIN/AUTH_SIWE_CHAIN_IDS in apps/api context.
CRITICAL-2: UNIQUE index on auth_accounts.wallet_address (migration 0007) as the final gate against the link/login race; loginWithWallet + linkWallet catch the violation -> conflict. Verified on live Postgres (dup rejected, NULLs allowed).
CRITICAL-3: /api/session (dashboard + portal) now verify the token with the API before persisting the cookie (no session fixation); + same-origin check on cookie-setting + /api/wallet/link routes (MEDIUM-3 CSRF).
HIGH-1: require expirationTime; enforce notBefore + issuedAt skew (shared verifyWalletMessage); clients now set expirationTime.
HIGH-2 (rate-limiting, task a): /v1/auth no longer exempt — stricter AUTH_RATE_LIMIT_PER_MINUTE (default 20) in a separate bucket; opportunistic expired-nonce prune (store + Pg).
HIGH-3: reserve the wallet email domain — block email/magic-link registration on it (no synthetic-email squatting).
HIGH-4: gate X-Forwarded-For trust behind TRUST_PROXY.
LOW-1: require a 65-byte (130-hex) ECDSA signature at the API boundary.
+ web3 tests for domain mismatch, missing-expiration, reserved-email. 1308 tests / 213 suites, typecheck + full build green; migrations 0006/0007 verified on Postgres.
2026-06-21 01:30:27 +03:00
740ffe91aa feat(auth): web3 sign-in for portal + wallet-linking for existing accounts
- portal: 'Connect Wallet' SIWE sign-in on login/signup (customer accounts), lib/auth wallet helpers, viem dep. (checkout has no sign-in surface — skipped.)
- auth core: AuthService.linkWallet(sessionToken, {message, signature}) — verify session + SIWE sig + single-use nonce, attach wallet to the existing account, conflict if the wallet is already linked elsewhere. +2 tests (link, conflict).
- api: POST /v1/auth/wallet/link (bearer-authenticated).
- dashboard: 'Link wallet' button in Settings → /api/wallet/link route forwards the session cookie as bearer; Account.walletAddress surfaced.
- 1304 tests / 213 suites, typecheck + full build green.
2026-06-21 00:31:48 +03:00
5cb0f48db7 feat: full-product round 2 — auth end-to-end + commerce engines
- apps/api: public /v1/auth routes (register/login/magic-link/session/logout) via
  @settlekit/auth, AuthService in context, signed sk_session cookie; existing
  api-key guard untouched (14 api tests intact).
- apps/dashboard + apps/portal: real login/signup UIs (password + magic-link),
  httpOnly session cookie via route handlers, server session helpers, sign-out.
- packages: fleshed refunds, dunning (retry schedules), disputes (state machine),
  payouts (settlement + available-balance) into real engines with stores+services.

Verified: full build 0 TS errors; 591 tests pass; live auth flow
(register->login->session->magic-link->bad-login 401) confirmed end-to-end.
2026-06-15 17:06:29 +03:00