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

[Multi-Tenant] Tenanted Wallet Addresses #3114

Closed
4 tasks done
Tracked by #2893
njlie opened this issue Nov 20, 2024 · 1 comment · Fixed by #3152
Closed
4 tasks done
Tracked by #2893

[Multi-Tenant] Tenanted Wallet Addresses #3114

njlie opened this issue Nov 20, 2024 · 1 comment · Fixed by #3152
Assignees
Labels
pkg: backend Changes in the backend package.

Comments

@njlie
Copy link
Contributor

njlie commented Nov 20, 2024

Wallet Addresses should become tenanted as per the Multi-Tenancy design, and will be logically separated in the backend database by a tenantId row that serves as a foreign key on the tenants table.

  • Add tenantId row to walletAddresses table that is required and maps to an id on the tenants table.
  • Add tenantId to database queries on wallet addresses
  • Acquire tenantId from request headers on wallet address GraphQL requests and pass them into wallet address service logic.
  • Include tenantId in base URL of authServer and resourceServer fields of the current wallet address response.

Prerequisites

Pull Request

#3152

@njlie njlie added the pkg: backend Changes in the backend package. label Nov 20, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Rafiki Nov 20, 2024
@njlie njlie mentioned this issue Nov 20, 2024
41 tasks
@golobitch
Copy link
Collaborator

Add tenantId to queries on wallet addresses

Note: this means to add tenantId to SQL queries and not GraphQL queries. Just for the clarification :)

@njlie njlie moved this from Backlog to Todo in Rafiki Nov 25, 2024
@koekiebox koekiebox moved this from Todo to In Progress in Rafiki Nov 28, 2024
@koekiebox koekiebox moved this from In Progress to Ready for Review in Rafiki Dec 9, 2024
@mkurapov mkurapov removed a link to a pull request Dec 9, 2024
5 tasks
@golobitch golobitch added this to the Multi Tenant v1 milestone Dec 20, 2024
@mkurapov mkurapov moved this from Ready for Review to In Progress in Rafiki Jan 7, 2025
@koekiebox koekiebox moved this from In Progress to Ready for Review in Rafiki Jan 8, 2025
koekiebox added a commit that referenced this issue Jan 26, 2025
* feat(backend): tenant service

* fix: integration tests

* feat: use soft delete

* refactor: compare whole object in test

* fix: better gql errors in tests

* feat: add idp columns to tenant model

* feat: pagination tests, push deletedAt to auth api call

* feat: add cache

* fix: update localenv environment variables

* feat(3114): add tenant to wallet address.

* feat(3114): test fixes.

* feat: make some tenants fields optional, small refactors

* feat(auth): tenants table v1

* feat(backend): tenant service

* feat: use soft delete

* feat: add idp columns to tenant model

* feat: pagination tests, push deletedAt to auth api call

* feat: add cache

* feat(backend): tenant signature validation for admin api

* fix: rebase errors

* feat(3114): update seed.ts

* fix: remove admin api secret check from app

* fix: always expect tenant id in request

* chore: remove some logs

* feat(3114): update for auth and resource server.

* feat(3114): fix asset service.test.ts

* feat(3114): fix tests.

* feat(3114): merged with latest tenant changes.

* feat(3114): extract tenant id from tenant context instead of admin input variable.

* feat(3114): test case updates, obtain tenant from header.

* feat(3114): fix test cases for wallet address.

* feat(3114): address review comments.

* feat(3114): rework tenantId to not be mandatory for wallet address service layer.

* feat(3114): rework tenantId to not be mandatory for wallet address service layer.

* feat(3114): rework tenantId to not be mandatory for wallet address service layer.

* feat(3114): fix tenant service test case.

* feat(3114): fix tenant service test case.

* feat(3114): fix tenant service test case.

* feat(3114): fix tenant service test case.

* feat(3114): fix tenant service test case.

* feat(3114): force 'forTenantId'.

* feat(3114): force 'forTenantId'.

* feat(3114): force 'forTenantId'.

* feat(3114): enhancements for 'forTenantId'.

* feat(3114): test case fixes.

* feat(3114): internal server error

* feat(3114): test case.

* feat(3114): test case.

* feat(3114): review feedback.

* feat(3114): review feedback.

* feat(3114): remove tenant on quote.

* feat(3114): default operator tenant.

* feat(3114): review feedback.

* feat(3114): review feedback from Max.

* feat(3114): review feedback from Max.

* feat(3114): fixed.

* feat(3114): review feedback.

* feat(3114): review feedback.

* feat(3114): review feedback. do not force error on graphql middleware.

* feat(3114): fix the integration test.

* feat(3114): further review comments.

* feat(3114): further review comments.

* feat(3114): final round with Max.

* feat(3114): revert.

* feat(3114): remove unused.

* feat(3114): set the correct operator id.

---------

Co-authored-by: Nathan Lie <lie4nathan@gmail.com>
@koekiebox koekiebox moved this from Ready for Review to Done in Rafiki Jan 26, 2025
@koekiebox koekiebox closed this as completed by moving to Done in Rafiki Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: backend Changes in the backend package.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants