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] backend tenant service #3123

Closed
5 tasks
Tracked by #2893
njlie opened this issue Nov 21, 2024 · 1 comment · Fixed by #3140
Closed
5 tasks
Tracked by #2893

[Multi-Tenant] backend tenant service #3123

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

Comments

@njlie
Copy link
Contributor

njlie commented Nov 21, 2024

The backend should provide a tenant service that other services can use to retrieve tenant information, given an id.

Pseudocode for Tenant service:

CreateOptions {
  publicName: string
  email: string
  apiSecret: string
  idpConsentUrl: string
  idpSecret: string
}

TenantService {
  create: (options: CreateOptions) => Tenant
  get: (id: string) => Tenant
  update(id: string, input: { ...tenantFields }
  delete: (id: string) => boolean
}
  • Create TenantService and add it to IoC container
  • create function
    • create function should call create tenant endpoint on auth server admin api
  • get function
  • update function
  • delete function
    • delete function should call delete tenant endpoint on auth server admin api
    • use soft deletion

Prerequisites

@github-project-automation github-project-automation bot moved this to Backlog in Rafiki Nov 21, 2024
@njlie njlie moved this from Todo to Ready for Review in Rafiki Dec 2, 2024
@njlie njlie linked a pull request Dec 2, 2024 that will close this issue
6 tasks
@koekiebox
Copy link
Collaborator

Could we also add caching to the tenant? Similar to what we did for walletAddress and asset?

@mkurapov mkurapov added the pkg: backend Changes in the backend package. label Dec 3, 2024
njlie added a commit that referenced this issue Dec 9, 2024
* 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: make some tenants fields optional, small refactors
@mkurapov mkurapov moved this from Ready for Review to Done in Rafiki Dec 9, 2024
@mkurapov mkurapov closed this as completed Dec 9, 2024
@golobitch golobitch added this to the Multi Tenant v1 milestone Dec 20, 2024
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.

4 participants