Subscriptions return all data regardless of tenant
I am running into an issue where all data is returned by a subscription even when multi-tenancy is set up.
I have a product resource that belongs to an organization. The tenant attribute is the organization_id on the product. When creating a product, all subscribers receive the data including for products outside their tenant.
Is this behavior not implemented yet or is this a bug?
5 Replies
100% if thats happening it is a bug
@barnabasj would need to confirm
But if you could create a reproduction repo showing this behavior, or a test case in
ash_graphql
that would be very helpful and would help us help you faster 🙇♂️I'll do that. Thank you!
I can probably investigate a bit tomorrow
I opened an issue here https://github.com/ash-project/ash_graphql/issues/352.
And a test case here https://github.com/ash-project/ash_graphql/pull/351
GitHub
ash-project/ash_graphql
The extension for building GraphQL APIs with Ash. Contribute to ash-project/ash_graphql development by creating an account on GitHub.
GitHub
test: checks if multitenancy is respected by subscriptions by ty-ni...
Contributor checklist
Leave anything that you believe does not apply unchecked.
I accept the AI Policy, or AI was not used in the creation of this PR.
Bug fixes include regression tests
Chores
...
I created a PR that should fix the problem https://github.com/ash-project/ash_graphql/pull/353
GitHub
fix: only resolve notifications for the same tenant by barnabasJ ·...
Contributor checklist
This should make the test in #351 in pass.
Ash.can doesn't add the filter for the tenant, that's why we allowed the data to be passed through. But that would h...