Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-7674

Reliably set tenant_id for each record

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • System
    • Fix triggers and multitenancy
    • False
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • To Do
    • 50% To Do, 0% In Progress, 50% Done

      System code has a feature that relies on the field tenant_id to ensure that a record in the database is not leaked to another tenant.

      This field is set upon INSERT statement through a DATABASE trigger.

      Goal

      As INSERT triggers are executed inside the same transaction, and some of them are buggy, it might be better to set this tenant_id by code instead.

      Pros:

      • Modifying the code is easier than modifying a database trigger
      • Usage of DDL statement does not need to deactivate a trigger, which will be much more safe for operations
      • It can have better tests per model

      Sub-goals

      • ability to delete records from the database really reliably. Using only the tenant_id as the source of truth. That will simplify background deletion
      • All logic should be readable and testable.

              Unassigned Unassigned
              hramihaj Hery Ramihajamalala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: