Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add target info to "Library.change!" pubsub message #603

Merged
merged 14 commits into from
Sep 5, 2024

Conversation

byewokko
Copy link
Collaborator

@byewokko byewokko commented Aug 27, 2024

Summary

  • LibraryService.subscribe is extended with optional target argument.
  • Possible target values:
    • None (default) or "global" to watch global target changes,
    • "tenant" to watch changes in ANY tenant,
    • ("tenant", TENANT_ID) to watch changes in a specific tenant.
  • The callback method must expect target argument, whose value is either "global" or ("tenant", TENANT_ID).
  • Backward compatibility: When LibraryService.subscribe is called without target argument (or its value is None), the callback is called without target argument.

Other changes

  • Fix: Superuser has access to any tenant.

@byewokko byewokko added the enhancement New feature or request label Aug 27, 2024
@byewokko byewokko self-assigned this Aug 27, 2024
@byewokko byewokko marked this pull request as draft August 27, 2024 14:24
asab/library/providers/zookeeper.py Outdated Show resolved Hide resolved
@byewokko byewokko changed the title Set tenant context when publishing "Library.change!" Add target info to "Library.change!" pubsub message Aug 27, 2024
@byewokko byewokko marked this pull request as ready for review August 30, 2024 14:07
@byewokko byewokko requested a review from ateska August 30, 2024 14:07
@byewokko byewokko marked this pull request as draft August 30, 2024 15:21
@byewokko byewokko removed the request for review from ateska August 30, 2024 15:21
@byewokko byewokko marked this pull request as ready for review August 30, 2024 16:28
@byewokko byewokko requested a review from ateska September 2, 2024 13:22
@byewokko byewokko merged commit 91da75e into master Sep 5, 2024
8 checks passed
@byewokko byewokko deleted the feature/library-change-tenant-in-pubsub branch September 5, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants