Skip to content

feat: implement issues #178, #179, #180, #181#201

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
zerosumsum:feat/issues-178-179-180-181
Apr 26, 2026
Merged

feat: implement issues #178, #179, #180, #181#201
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
zerosumsum:feat/issues-178-179-180-181

Conversation

@ogazboiz
Copy link
Copy Markdown

Summary

Bundles four issues into one PR.

  • Add gated resource access checks based on wallet ownership #181 — Wallet-ownership gated resource access. New utils/wallet-ownership.utils.ts exposes a single typed verdict (granted / wallet_not_found / forbidden) for "does this Stellar wallet own this creator profile?". middlewares/wallet-ownership.middleware.ts turns the verdict into HTTP responses with the existing { success: false, error: { code, message } } shape. Wired into PUT /api/v1/creators/:creatorId/profile — previously open, now requires the owning wallet in the x-wallet-address header. 13 new tests cover authorized and unauthorized paths.
  • Add service-layer tests for core creator flows #178 — Service-layer tests for creator flows. 13 new tests across creator.service.test.ts (pagination math, sort options, parallel query, edge cases) and creator-profile.service.test.ts (read shape, upsert envelope, schema-boundary contract). Tests mock prisma at the module boundary so they stay isolated from unrelated modules and remain deterministic.
  • Add seed and fixture guidance for contributors #179 — Seed/fixture guidance for contributors. Idempotent prisma/seed.ts creates three deterministic users (alice / bob / charlie) with wallets and creator profiles — enough to exercise list / read / ownership-gated update flows. docs/contributor-seed.md documents the fixture catalogue, reset workflow, and the exact requests that exercise each gated path. CONTRIBUTING.md links the new doc.
  • Add release checklist documentation for backend deploy safety #180 — Release checklist for backend deploy safety. docs/release-checklist.md with pre-deploy / rollout / post-deploy / rollback sections. Concrete and operational — real commands (pnpm exec prisma migrate diff, GET /api/v1/health/detailed), real endpoint names — so a contributor can use it cold without additional context.

Test plan

  • pnpm lint — clean
  • pnpm build — clean
  • pnpm exec jest — 99 tests pass across 10 suites (was 73 across 6 on main; +26 new tests, no regressions)
  • PUT /api/v1/creators/alice/profile with x-wallet-address: GA7XLM…ALICE returns 200 (manual; needs the seed)
  • Same request with x-wallet-address: GA7XLM…CHARLIE returns 403 (manual; needs the seed)
  • Same request with no header returns 401 (manual)

Pre-existing failures

main already has 8 test suites that error with "Your test suite must contain at least one test" — older bespoke test scripts that ran assertions in plain code without describe/it. This PR does not touch them; the same 8 suites still fail on this branch. Worth a follow-up issue if any of them carry behavior that should be retained.

Fixes

…layerorg#180, accesslayerorg#181

- accesslayerorg#178 Service-layer tests for creator flows: 13 new Jest tests across
  creator.service.test.ts (pagination math, sort options, parallel
  query, edge cases) and creator-profile.service.test.ts (read shape,
  upsert envelope, schema-boundary contract). Tests mock prisma at the
  module boundary so they stay isolated from unrelated modules.
- accesslayerorg#179 Seed/fixture guidance: idempotent prisma/seed.ts that creates
  three deterministic users (alice / bob / charlie) with wallets and
  creator profiles, plus docs/contributor-seed.md describing the
  fixture catalogue, reset workflow, and example requests for the
  most common dev scenarios. CONTRIBUTING.md links the new doc.
- accesslayerorg#180 Release checklist: docs/release-checklist.md with pre-deploy /
  rollout / post-deploy / rollback sections. Concrete and operational
  (real commands, real endpoint names) so a contributor can use it
  cold without additional context.
- accesslayerorg#181 Wallet-ownership gated access: new utils/wallet-ownership.utils.ts
  helper exposes a single typed verdict (granted / wallet_not_found /
  forbidden), and middlewares/wallet-ownership.middleware.ts applies it
  with consistent { code: 'UNAUTHORIZED' | 'FORBIDDEN', message } error
  shape. Wired into PUT /api/v1/creators/:creatorId/profile (previously
  open). 13 new tests cover authorized + unauthorized paths.

Total: 26 new passing tests across 4 new test files. No regressions —
the 8 pre-existing test-suite failures on main ("Your test suite must
contain at least one test" — older bespoke test scripts) are unchanged.
pnpm lint and pnpm build are clean.

Fixes: accesslayerorg#178
Fixes: accesslayerorg#179
Fixes: accesslayerorg#180
Fixes: accesslayerorg#181
@Chucks1093 Chucks1093 merged commit 6bcfe97 into accesslayerorg:main Apr 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants