Skip to content

Commit

Permalink
Fix missing metadata on dataset decryption phase
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Libanori committed Mar 5, 2024
1 parent af3797e commit fab3c24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
import org.jasypt.exceptions.EncryptionInitializationException;
import org.jasypt.exceptions.EncryptionOperationNotPossibleException;

import it.eng.spagobi.tools.dataset.bo.IDataSet;
import it.eng.spagobi.tools.dataset.common.datastore.IDataStore;
import it.eng.spagobi.tools.dataset.common.datastore.IField;
import it.eng.spagobi.tools.dataset.common.datastore.IRecord;
import it.eng.spagobi.tools.dataset.common.metadata.IFieldMetaData;
import it.eng.spagobi.tools.dataset.common.metadata.IMetaData;
import it.eng.spagobi.tools.dataset.common.metadata.MetaData;
import it.eng.spagobi.tools.dataset.common.transformer.AbstractDataStoreTransformer;

public class DecryptionDataStoreTransformer extends AbstractDataStoreTransformer {
Expand All @@ -29,6 +31,10 @@ public class DecryptionDataStoreTransformer extends AbstractDataStoreTransformer
private PBEStringEncryptor encryptor;
private final IMetaData dataStoreMetadata;

public DecryptionDataStoreTransformer(IDataSet dataSet) {
this(dataSet.getDsMetadata() != null ? dataSet.getMetadata() : new MetaData());
}

public DecryptionDataStoreTransformer(IDataStore dataStore) {
this(dataStore.getMetaData());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public void loadData(int offset, int fetchSize, int maxResults) {

dataStore = dataProxy.load(dataReader);

addDataStoreTransformer(new DecryptionDataStoreTransformer(dataStore));
addDataStoreTransformer(new DecryptionDataStoreTransformer(this));
addDataStoreTransformer(new PrivacyManagerDataStoreTransformer(this));
addDataStoreTransformer(new DataStoreStatsTransformer());

Expand Down

0 comments on commit fab3c24

Please sign in to comment.