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

fix(backend): full test of multi-tenancy-v1 #3176

Closed
wants to merge 12 commits into from

Conversation

koekiebox
Copy link
Collaborator

Changes proposed in this pull request

Context

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Make sure that all checks pass
  • Bruno collection updated (if necessary)
  • Documentation issue created with user-docs label (if necessary)
  • OpenAPI specs updated (if necessary)

njlie and others added 7 commits November 26, 2024 12:06
* feat(auth): tenants table v1

* fix: add updatedAt, createdAt

* feat: add deletedAt
* feat(auth): tenant service

* chore(auth): format

* fix(auth): jest test warning about migration

* fix(auth): remove temporary code

* feat(auth): soft delete tenants

* fix(auth): return erroneously removed tests
* 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
* feat(auth): migration to seed operator tenant

* feat(backend): migration to seed operator tenant

* chore(localenv): add env vars for operator tenant

* test(backend): set operator env variables in jest config

* test(auth): set operator env variables in jest config

* test(auth, backend): load env vars into jest environment script

* feat(auth,backend): update migrations with error messages

* test(integration): adding operator tenant vars

* chore(backend, localenv): replace OPERATOR_TENANT_SECRET with existing API_SECRET
@github-actions github-actions bot added type: tests Testing related pkg: backend Changes in the backend package. type: source Changes business logic pkg: auth Changes in the GNAP auth package. labels Dec 11, 2024
Copy link

netlify bot commented Dec 11, 2024

Deploy Preview for brilliant-pasca-3e80ec ready!

Name Link
🔨 Latest commit 8ade26a
🔍 Latest deploy log https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/678a3a066c326c00082e4fd0
😎 Deploy Preview https://deploy-preview-3176--brilliant-pasca-3e80ec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@koekiebox koekiebox changed the title 2893/multi tenancy v1 fix(backend): full test of multi-tenancy-v1 Dec 11, 2024
mkurapov and others added 3 commits December 16, 2024 12:45
…3177)

* fix(backend): await signature verification

* test(integration): add signatures to apollo client requests

* test(backend): sign GraphQL requests in test environment

* Revert "test(backend): sign GraphQL requests in test environment"

This reverts commit 0a128d1.

* chore(backend): remove sig verification in test files
* 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

* fix: remove admin api secret check from app

* fix: always expect tenant id in request

* chore: remove some logs

* feat: await signature verification, test improvements

* fix: better util parameters

* fix: add tenant info to apollo context

* feat: fix integration tests

* fix: make tenant required on extended apollo context
* feat(auth): add service api with /healtz endpoint

* feat(auth): tenant routes

* feat(auth): service api error handling

* chore(auth): rm old todo

* fix(auth): how errors are set

* fix(auth): improve tenant tests, cleanup tenant get response,

* feat(backend): auth service api client

* fix(auth): change status codes to 204 where no body

* fix(backend): format

* feat(auth): add required deletedAt to DELETE /tenant body

* feat(backend): AUTH_SERVICE_API_URL env var

* fix(backend): auth service client tests to mock codes correctly

* feat(backend): add AuthServiceClient dep

* feat(backend): use auth service client in tenant service

* chore(auth): format

* chore(auth): format

* fix(integration,localenv): auth service api config

* fix(backend,auth): update tenant api to support deletedAt

* docs: update with env vars

* fix(backend): dep container type

* fix(localenv): docker compose config

* fix(backend): add default header to api client
@github-actions github-actions bot added the pkg: documentation Changes in the documentation package. label Jan 14, 2025
* feat(backend): migration to backfill tenantId on assets

* feat(backend): add tenantId to asset, use it in service

* feat(backend): use tenantId in asset resolvers

* test(backend): update tests to use asset tenantId where necessary

* test(backend): truncate tenant table manually in tenant tests

* test(backend): update failing accounting tests

* test(backend): update tenant service test

* test: fix accounting tests linting

* test(backend): update accounting tests

* feat(backend): use tenantId when fetching asset

* test(backend): make tests work with separate middleware

* test(backend): keep operator tenant when truncating tables

* test(backend): skip tenant pagination tests for now

* test(backend): seed operator tenant in truncateTable

* test(backend): seed operator tenant after tenants service is done

* test(backend): use separate schema for tenant tests

* test(backend): pass operator tenant id in pagination tests

* feat(backend): make tenantId required in asset pagination

* test(backend): update tenant service tests

* chore(backend): update config file

* test: update truncateTables to take in dbSchema

* feat(backend): make tenantId optional in asset pagination
# Conflicts:
#	packages/backend/src/app.ts
#	pnpm-lock.yaml
#	test/integration/package.json
@mkurapov
Copy link
Contributor

@koekiebox do we need this PR still?

@koekiebox
Copy link
Collaborator Author

@koekiebox do we need this PR still?

Yes. Closed @mkurapov . 🙇

@koekiebox koekiebox closed this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: auth Changes in the GNAP auth package. pkg: backend Changes in the backend package. pkg: documentation Changes in the documentation package. type: source Changes business logic type: tests Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants