Skip to content

Commit

Permalink
Fixed bug in setting metrics and metadata (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornandre authored Apr 9, 2024
1 parent 78b4c16 commit 7d9974c
Showing 1 changed file with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,19 @@ private String process(PseudoOperation operation,
if (isSidMapping && mapFailureMetadata != null) {
// There has been an unsuccessful SID-mapping
metadataProcessor.addMetric(FieldMetric.MISSING_SID);
} else {
metadataProcessor.addMetadata(FieldMetadata.builder()
.shortName(field.getName())
.dataElementPath(field.getPath().substring(1).replace('/', '.')) // Skip leading slash and use dot as separator
.dataElementPattern(match.getRule().getPattern())
.encryptionKeyReference(funcDeclaration.getArgs().getOrDefault(KEY_REFERENCE, null))
.encryptionAlgorithm(match.getFunc().getAlgorithm())
.stableIdentifierVersion(sidSnapshotDate)
.stableIdentifierType(isSidMapping)
.encryptionAlgorithmParameters(funcDeclaration.getArgs())
.build());
}
if (isSidMapping) {
} else if (isSidMapping) {
metadataProcessor.addMetric(FieldMetric.MAPPED_SID);
}
metadataProcessor.addMetadata(FieldMetadata.builder()
.shortName(field.getName())
.dataElementPath(field.getPath().substring(1).replace('/', '.')) // Skip leading slash and use dot as separator
.dataElementPattern(match.getRule().getPattern())
.encryptionKeyReference(funcDeclaration.getArgs().getOrDefault(KEY_REFERENCE, null))
.encryptionAlgorithm(match.getFunc().getAlgorithm())
.stableIdentifierVersion(sidSnapshotDate)
.stableIdentifierType(isSidMapping)
.encryptionAlgorithmParameters(funcDeclaration.getArgs())
.build());
return mappedValue;

} else if (operation == DEPSEUDONYMIZE) {
Expand Down

0 comments on commit 7d9974c

Please sign in to comment.