Flagsmith / flagsmith

Open Source Feature Flagging and Remote Config Service. Host on-prem or use our hosted version at https://flagsmith.com/
https://flagsmith.com/
BSD 3-Clause "New" or "Revised" License
4.94k stars 375 forks source link

Change requests for changes to Identity overrides #1439

Open dabeeeenster opened 2 years ago

dabeeeenster commented 2 years ago

Similar to #1204 but for Identity flag overrides.

matthewelwell commented 2 years ago

To achieve this, we need to consider the additional complexity that comes with edge identities.

To enable this for core / self hosted identities, we need to simply expose the identity attribute on the nested feature states within the change request.

To enable this for edge identities, we would need to expose a new attribute somewhere to link to the edge identity. We could do this on the change request itself (although this would break some of the future proofing added into change requests that allow for multiple feature states in a single change request). Alternatively, we could add it to the FeatureState (or create a polymorphic model which links to the original FeatureState) to link to the edge identity. In either scenario, we would need to ensure that these feature states are excluded from the current behaviour of the API. We may need to add a filter to all queries that retrieve FeatureState objects to exclude any of these 'pending edge identity feature override' feature states. On commit, we would need to add the feature override to the identity document in dynamo.

dabeeeenster commented 2 years ago

I quite like the idea of an external_id column in FeatureState - it may well come in useful down the line