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 Assets #3033

Open
3 tasks
Tracked by #2893
njlie opened this issue Oct 11, 2024 · 3 comments
Open
3 tasks
Tracked by #2893

[Multi-Tenant] Tenanted Assets #3033

njlie opened this issue Oct 11, 2024 · 3 comments
Assignees
Labels
pkg: backend Changes in the backend package.

Comments

@njlie
Copy link
Contributor

njlie commented Oct 11, 2024

Because assets aren't associated with a Wallet Address like Open Payments resources are, it becomes necessary to add a tenantId to them to determine which tenant that asset belongs to.

  • Add required tenantId column to assets table
  • Acquire tenantId from request header and pass into asset service logic during graphql requests
  • Add tenantId to database queries on assets

Prerequisites:

@njlie njlie added the pkg: backend Changes in the backend package. label Oct 11, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Rafiki Oct 11, 2024
@njlie njlie mentioned this issue Oct 11, 2024
38 tasks
@njlie
Copy link
Contributor Author

njlie commented Nov 15, 2024

Closing as the new design for Multi-Tenancy no longer uses logical barriers for tenanted resources.

@njlie njlie closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Rafiki Nov 15, 2024
@njlie njlie reopened this Nov 19, 2024
@github-project-automation github-project-automation bot moved this from Done to Backlog in Rafiki Nov 19, 2024
@njlie njlie changed the title [Multi-Tenant] Add tenantId to assets [Multi-Tenant] Tenanted Assets Nov 21, 2024
@mkurapov
Copy link
Contributor

@njlie re-posting my comment from the planning doc:

If we want to have assets be tenanted, we need to change how we create asset liquidity and settlement accounts.

Currently, when we create an account in TB, we use the auto-incrementing ledger value (smallint in PSQL) as the id for the asset settlement account. If we were to create an asset for a second tenant (in a separate schema/db), the settlement account creation would fail because of the id collision.

One way to solve this would be to just start storing liquidityAccountId and settlementAccountId on the assets table, or something in a different lookup table

@mkurapov mkurapov moved this from Backlog to In Progress in Rafiki Dec 3, 2024
@mkurapov mkurapov self-assigned this Dec 3, 2024
@mkurapov
Copy link
Contributor

mkurapov commented Dec 3, 2024

@njlie going to take this one on and come up with some solutions to the question of liquidity & settlement accounts

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: In Progress
Development

No branches or pull requests

2 participants