Skip to content

Refactor data access to enforce guild-scoped multi-tenancy - #314

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
bridgetthnkechi87-cloud:refactor/guild-scoped-multi-tenancy
Jul 29, 2026
Merged

Refactor data access to enforce guild-scoped multi-tenancy#314
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
bridgetthnkechi87-cloud:refactor/guild-scoped-multi-tenancy

Conversation

@bridgetthnkechi87-cloud

Copy link
Copy Markdown
Contributor

Closes #298

Summary

  • Enforced guild-scoped activity repository access by requiring guildId for append/query operations
  • Updated mock and durable repository adapters so activity events are stored and queried per guild
  • Wired API/activity writers to pass the correct guild context
  • Added a dashboard migration for activity_events.guild_id
  • Added repository contract tests proving activity queries cannot leak across guilds
  • Documented the multi-tenancy model and known follow-up gaps in docs/multi-tenancy.md

Testing

  • pnpm --filter @guildpass/dashboard test apps/dashboard/test/repositories/mock-contract.test.ts apps/dashboard/test/repositories/durable-contract.test.ts apps/dashboard/test/dashboard-activity.test.ts
  • Result: 69 passed, 0 failed

Notes

This PR keeps the scope focused on the repository/query choke point for members, passes, and activity. Webhook-ingested activity and SSE live-stream scoping are documented as follow-up gaps rather than expanded into this PR.

@Lakes41
Lakes41 merged commit e46f5bc into Adamantine-guild:main Jul 29, 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

Development

Successfully merging this pull request may close these issues.

Refactor data access to enforce strict guild-scoped multi-tenancy across members, passes, and activity

2 participants