Skip to content

chore: Remove confidential values [DHIS2-21518]#23937

Merged
muilpp merged 11 commits into
masterfrom
DHIS2-21518
Jun 1, 2026
Merged

chore: Remove confidential values [DHIS2-21518]#23937
muilpp merged 11 commits into
masterfrom
DHIS2-21518

Conversation

@muilpp
Copy link
Copy Markdown
Contributor

@muilpp muilpp commented May 18, 2026

Summary

Removes the confidential/encryption feature from TrackedEntityAttribute and TrackedEntityAttributeValue.
Adding @dhis2/analytics-backend since this PR touches files under dhis-service-analytics.

Changes

  • Removes the confidential field.
  • Replaces the plainValue / encryptedValue staging design with a single plain value field.
  • Removes E1112 validation.
  • Removes all confidential filtering logic from the analytics table managers.
  • The encryption configuration stays, as it might still be used, as pointed out in Stian's comment

Migration

The migration script:

  • Removes the confidential field from trackedentityattribute.
  • Sets skipanalytics = true for attributes where confidential = true.
  • Removes the encrypted value from trackedentityattributevalue when a plain value is also present.
  • Fails the migration if an encrypted value exists without a corresponding plain value.

@muilpp muilpp marked this pull request as ready for review May 19, 2026 13:28
@muilpp muilpp requested a review from a team as a code owner May 19, 2026 13:28
@muilpp muilpp requested a review from a team May 19, 2026 13:28
Comment thread dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java Outdated
Comment thread dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java Outdated
Copy link
Copy Markdown
Contributor

@ameenhere ameenhere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that the encryption system config was only exclusively used by Tracker for TEAV confidential feature?

@maikelarabori maikelarabori added the run-api-analytics-tests Enables analytics e2e tests label May 27, 2026
@stian-sandvold
Copy link
Copy Markdown
Contributor

EncryptionStatus was used to determine if dhis.conf has a encryption key or not if I recall, which also relates to DhisConfigurationProvider getEncryptionStatus and checkSecurityConfiguration and SystemInfo.encryption. All of these were in place to know whether we could or could not encrypt.

In addition to confidential attributes, the same kind of encryption is used for settings (passwords, etc.). I'm not sure if it's used by the AES-128 encryption we use for RouteService and EventHookSecretManager, but I think in either case that part of the code should not be removed :)

@david-mackessy
Copy link
Copy Markdown
Contributor

Just for reference and to add to Stian's comment about which features use the encryption feature, the datastore and user datastore both use it.

@muilpp muilpp requested review from a team and enricocolasante May 27, 2026 15:10
Copy link
Copy Markdown
Contributor

@ameenhere ameenhere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment

.collect(Collectors.toList());
}

private boolean isNotConfidential(TrackedEntityAttribute trackedEntityAttribute) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a similar primitive safe method? How would the getSkipAnalytics behave if it happened to be null?

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 1, 2026

@muilpp muilpp merged commit b748998 into master Jun 1, 2026
22 checks passed
@muilpp muilpp deleted the DHIS2-21518 branch June 1, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-api-analytics-tests Enables analytics e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants